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

Use alwaysApplyingWhenNonNull PropertyMapper to set the values in the LdapContextSource #17861

Conversation

filiphr
Copy link
Contributor

@filiphr filiphr commented Aug 14, 2019

The userDn and password in LdapContextSource are not nullable.
The default values for userDn and password in LdapProperties are `null.

When the values are set to null there will eventually be a NullPointerException
during AbstractContextSource#setupAuthenticatedEnvironment since HashTable doesn't allow null for values

I am not sure whether this should be fixed here in spring-boot, or perhaps directly within LdapContextSource.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 14, 2019
filiphr added a commit to flowable/flowable-engine that referenced this pull request Aug 14, 2019
…m tests

Before 2.1.0 the LdapHealthIndicator was not created due to the missing LdapOperations.
However since 2.1 the LdapOperations bean creation was moved into the LdapAutoConfiguration (see spring-projects/spring-boot#13136)
which lead to the LdapHealthIndicator being created and thus the FlowableIdmApplicationSecurityTest was failing due to the ldap user and password being null.
See  spring-projects/spring-boot#17861 for the problem in Spring Boot
… LdapContextSource

The userDn and password in LdapContextSource are not nullable.
The default values for userDn and password in LdapProperties are null.
When the values are set to null there will eventually be a NullPointerException
during AbstractContextSource#setupAuthenticatedEnvironment since HashTable doesn't allow
null for values
@philwebb
Copy link
Member

Thanks for spotting this one, it looks like a legitimate bug on our side but also something that could be improved in spring-ldap. I've raised spring-projects/spring-ldap#538 to see if they can make things more robust.

@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 16, 2019
@philwebb philwebb added this to the 2.1.x milestone Aug 16, 2019
@filiphr
Copy link
Contributor Author

filiphr commented Aug 16, 2019

Thanks for raising the issue in spring-ldap. Once I started writing the fix for Spring Boot I also realized that making it more robust in spring-ldap might be the best thing. Something like that is already done in setBaseName.

Thanks for taking the fix into consideration.

@snicoll snicoll self-assigned this Aug 17, 2019
@snicoll snicoll modified the milestones: 2.1.x, 2.1.8 Aug 17, 2019
snicoll pushed a commit that referenced this pull request Aug 17, 2019
The userDn and password in LdapContextSource are not nullable. The
default values for userDn and password in LdapProperties are null. When
the values are set to null there will eventually be a
NullPointerException during
AbstractContextSource#setupAuthenticatedEnvironment since HashTable
doesn't allow null for values.

See gh-17861
@snicoll snicoll closed this in 3a20b1d Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants