Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert LDAP authorization plugin configuration to YAML #4599

Merged
merged 8 commits into from
Aug 12, 2024

Conversation

vladak
Copy link
Member

@vladak vladak commented Jul 22, 2024

This is a little brother of #2329, just for the LDAP authorization plugins. I have chosen YAML.

I had to select the members by hand via tha @JsonProperty, otherwise this leads to stack overflow via infinite recursion by calling LdapServer#isWorking() from the Jackson serialization methods.

The integer fields not present in the configuration are deserialized to zero values,

if (this.connectTimeout > 0) {
env.put(LDAP_CONNECT_TIMEOUT_PARAMETER, Integer.toString(this.connectTimeout));
}
if (this.readTimeout > 0) {
env.put(LDAP_READ_TIMEOUT_PARAMETER, Integer.toString(this.readTimeout));
}
uses the defaults in such case.

This will also help with the stability of the tests, as I have seen plugins/src/test/java/opengrok/auth/plugin/configuration/ConfigurationTest.java fail in the same way as the indexer configuration (#4441).

@vladak vladak requested a review from ginoaugustine July 22, 2024 19:45
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 22, 2024
@vladak vladak force-pushed the ldap_plugin_config_yaml branch from 7dc2c07 to 067e135 Compare August 1, 2024 11:17
ginoaugustine
ginoaugustine previously approved these changes Aug 2, 2024
@vladak vladak force-pushed the ldap_plugin_config_yaml branch from 067e135 to c0884ab Compare August 2, 2024 21:57
@vladak
Copy link
Member Author

vladak commented Aug 12, 2024

https://github.com/oracle/opengrok/wiki/Authorization-plugins#ldap-setup will have to be updated once this is merged in.

@vladak vladak force-pushed the ldap_plugin_config_yaml branch from c0884ab to 5f69059 Compare August 12, 2024 13:25
@vladak
Copy link
Member Author

vladak commented Aug 12, 2024

Example multi-server configuration:

servers:
  - url: "ldaps://ldap-foo.example.com"
    username: cn=admin,ou=admins,dc=example,dc=com
    password: changeme
  - url: "ldaps://ldap-bar.example.com"
    username: cn=admin,ou=admins,dc=example,dc=com
    password: changeme
interval: 900000
countLimit: 3
connectTimeout: 3000
readTimeout: 3000
searchTimeout: 1000
searchBase: dc=example,dc=com

@vladak vladak merged commit 531be32 into oracle:master Aug 12, 2024
8 checks passed
@vladak vladak deleted the ldap_plugin_config_yaml branch August 12, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authorization OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants