0

Is there a way to programmatically get the SpEL contained in the @PreAuthorize annotation of a specified endpoint VERB+PATH?

TheOni
  • 810
  • 9
  • 26
  • Lots of ugly reflection probably. I'd try not to need this kind of deep dependency on framework internals. What's the problem you're trying to solve? – zapl May 15 '18 at 15:10
  • Using reflexion ? https://stackoverflow.com/questions/1805200/retrieve-java-annotation-attribute – Oreste Viron May 15 '18 at 15:10
  • @zapl I'm trying to find a way to have a full report of all the endpoints created and corresponding authorizations – TheOni May 15 '18 at 15:24
  • Uh, ok, something like https://github.com/spring-projects/spring-boot/blob/1.5.x/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/RequestMappingEndpoint.java is maybe a good start. Knows at least about paths verbs and methods - produces the overview available at `/mappings` when you have a boot application with actuator enabled – zapl May 16 '18 at 10:56
  • thanks @zapl i'll check it – TheOni May 16 '18 at 16:14

0 Answers0