Polish CoreSecurityRuntimeHints

This commit is contained in:
Marcus Da Coregio 2022-08-23 15:05:58 -03:00
parent 0aac515737
commit bd5a05dcdd
1 changed files with 11 additions and 3 deletions

View File

@ -52,14 +52,22 @@ class CoreSecurityRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.reflection().registerTypes(getDefaultAuthenticationExceptionEventPublisherTypes(),
(builder) -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
registerExceptionEventsHints(hints);
registerExpressionEvaluationHints(hints);
hints.resources().registerResourceBundle("org.springframework.security.messages");
}
private void registerExpressionEvaluationHints(RuntimeHints hints) {
hints.reflection().registerTypes(
List.of(TypeReference.of(SecurityExpressionOperations.class),
TypeReference.of(SecurityExpressionRoot.class)),
(builder) -> builder.withMembers(MemberCategory.DECLARED_FIELDS,
MemberCategory.INVOKE_DECLARED_METHODS));
hints.resources().registerResourceBundle("org.springframework.security.messages");
}
private void registerExceptionEventsHints(RuntimeHints hints) {
hints.reflection().registerTypes(getDefaultAuthenticationExceptionEventPublisherTypes(),
(builder) -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
}
private List<TypeReference> getDefaultAuthenticationExceptionEventPublisherTypes() {