Skip to content

Commit

Permalink
doc: Fix mistakes in the sample config
Browse files Browse the repository at this point in the history
  • Loading branch information
tlater-famedly committed Aug 23, 2024
1 parent be84201 commit be93082
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ Tests can then be run using:
cargo nextest run [--no-fail-fast] [-E 'test(<specific_test_to_run>)']
```

Note that tests need to be executed from the repository root since we
do not currently implement anything to find files required for tests
relative to it.

In addition, a modern docker with the `compose` subcommand is
required - importantly, this is not true for many distro docker
packages. Firewalls also need to be configured to allow container <->
Expand Down
6 changes: 2 additions & 4 deletions config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ ldap:
# The URl of the ldap server to be synced.
# Using `ldaps` as the scheme will enable TLS.
url: ldap://ldap.example.invalid
start_tls: false
no_tls_verify: false
root_certificates_path: /opt/famedly-sync-agent/certs/test-ldap.crt
# The base DN whose users to sync.
base_dn: ou=testorg,dc=example,dc=org
# The DN to bind - this should be a user with sufficient permissions
Expand Down Expand Up @@ -51,6 +48,7 @@ ldap:
# not have a phone number this will be silently ignored
phone: "telephoneNumber"

# TLS config is optional, and only needs to be set if TLS is needed
tls:
# The client TLS key/certificate. If both this and the certificate
# are unset, the client will not send any certificates.
Expand Down Expand Up @@ -79,7 +77,7 @@ famedly:
# The project to grant users access to.
project_id: 278274945274880004
# The identity provider ID to enable SSO login for
idp_id: tbd
idp_id: 281430143275106308

feature_flags:
- verify_email # Whether to ask users to verify their email addresses post sync
Expand Down
7 changes: 7 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,11 @@ mod tests {
vec!["*"]
);
}

#[tokio::test]
async fn test_sample_config() {
let config = Config::from_file(Path::new("./config.sample.yaml")).await;

assert!(config.is_ok(), "Invalid config: {:?}", config);
}
}

0 comments on commit be93082

Please sign in to comment.