-
Notifications
You must be signed in to change notification settings - Fork 6k
No log message or exception if expected ldif file does not exist #7791
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
Comments
Thanks for the report @ybbabr19. I agree that the application should not fail silently if the LDIF file is not found. Are you interested in submitting a PR to fix this? |
If this still an option I would like to contribute to this issue. |
@dratler thank you, it's yours |
@dratler Have you had the chance to look into this issue? |
Hi @eleftherias , |
@dratler We have an LDAP sample in this repository that you can use https://github.com/spring-projects/spring-security/tree/master/samples/javaconfig/ldap |
Hi @eleftherias , |
@dratler This issue can be demonstrated using the LDAP sample with a few modifications. If you run the application, you will see that no exception is thrown, even though the file The changes required to fix this will be in Could you please clarify what you mean in your comment above about the missing gradle dependency? Please don't hesitate to reach out if you need any help or clarifications. |
Hi @eleftherias ,
It affects For example the error
|
@dratler You do not need to add any additional gradle dependencies. |
Hi @eddumelendez , thanks you for all the help |
@dratler Spring Framework is already a dependency of Spring Security. There is no additional work needed to use Spring Framework.
If you are able to run
You can add that to the LDAP sample which is found in If you have any further questions, you could open a draft pull request and we can discuss there. |
Hi @eleftherias , |
Hi @eleftherias , |
Summary
When configuring an embedded ldap server to import an ldif file (e.g., users.ldif), no log message (at not level) is written nor any exception is thrown if the provided file does not exist (e.g., uesrs.ldif):
While it is arguably legitimate not to throw an exception in this case and load the ldif file from a default location, logging a message out that warns the user that the configured ldif file was not found could spare some debugging time ;)
Actual Behavior
No log message is provided upon an unsuccessful import of a ldif file.
Expected Behavior
A log message that warns the users that the configured ldif file does not exist
Configuration
On the file system however, the file is: ${configpath}/users.ldif
Version
5.2.1.RELEASE
Sample
https://github.com/spring-projects/spring-security/blob/master/ldap/src/main/java/org/springframework/security/ldap/server/UnboundIdContainer.java
The text was updated successfully, but these errors were encountered: