spring-projects / spring-projects/spring-security
SEC-1922: Improve error-message when user property file has wrong format
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
David J. M. Karlsen (Migrated from SEC-1922) said:
If the user details file has the wrong format (I had a configline which was "OK" but forgot to chuck in the '"' character) you will get this stacktrace:
Caused by: java.lang.NullPointerException: null
at org.springframework.security.provisioning.InMemoryUserDetailsManager.<init>(InMemoryUserDetailsManager.java:52) ~[spring-security-core-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56) ~[na:1.6.0]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39) ~[na:1.6.0]
at java.lang.reflect.Constructor.newInstance(Constructor.java:527) ~[na:1.6.0]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) ~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
... 101 common frames omitted
it would be nicer to say that the file has an unexpected format.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in org.springframework.security.provisioning.InMemoryUserDetailsManager at the constructor line shown in the stack trace, and inspect how malformed user-detail configuration is handled. Reproduce the wrong-format input described in the issue; done means it reports an unexpected file format instead of a NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100