Skip to content

Commit

Permalink
Update readme config examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpierce committed Nov 19, 2024
1 parent 3dd227e commit bee882e
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,37 @@ u.member_of_ldap_group?(['Some-Group'])

## Configuration

Create a file `config/ldap_groups_lookup.yml` that looks like:
### Initializer
Create an initializer `config/initializers/ldap_groups_lookup.rb` that looks like:
```ruby
LDAPGroupsLookup.config = {
enabled: true,
config: { host: 'ads.example.net',
port: 636,
encryption: {
method: :simple_tls,
tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS,
},
auth: {
method: :simple,
username: "cn=example",
password: 'changeme',
}
},
tree: 'dc=ads,dc=example,dc=net',
account_ou: 'ou=Accounts',
group_ou: 'ou=Groups',
member_whitelist: ['OU=Groups']
}
```

### YAML
Alternatively, create a file `config/ldap_groups_lookup.yml` that looks like:

```yaml
:enabled: true
:host: ads.example.net
:port: 636
:port: 389
:auth:
:method: :simple
:username: example
Expand All @@ -47,4 +72,5 @@ Create a file `config/ldap_groups_lookup.yml` that looks like:
:group_ou: ou=Groups
:member_whitelist:
- OU=Groups
```
```
Note: The yaml style does not allow for easy configuration of some properties like tls_options or other auth methods.

0 comments on commit bee882e

Please sign in to comment.