adorsys / keycloak-config-cli

Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
https://adorsys.github.io/keycloak-config-cli/
Apache License 2.0
807 stars 148 forks source link

NPE with added Resource in AuthorizationSettings #1111

Closed bohmber closed 2 months ago

bohmber commented 4 months ago

Current Behavior

2024-07-23T07:39:16.190Z ERROR 317 --- [ main] o.s.boot.SpringApplication : Application run failed java.lang.NullPointerException: Cannot invoke "java.util.Map.isEmpty()" because the return value of "org.keycloak.representations.idm.authorization.ResourceRepresentation.getAttributes()" is null at de.adorsys.keycloak.config.service.ClientAuthorizationImportService.updateAuthorizationResource(ClientAuthorizationImportService.java:301) at de.adorsys.keycloak.config.service.ClientAuthorizationImportService.createOrUpdateAuthorizationResource(ClientAuthorizationImportService.java:267) at de.adorsys.keycloak.config.service.ClientAuthorizationImportService.createOrUpdateAuthorizationResources(ClientAuthorizationImportService.java:254) at de.adorsys.keycloak.config.service.ClientAuthorizationImportService.updateAuthorization(ClientAuthorizationImportService.java:154) at de.adorsys.keycloak.config.service.ClientAuthorizationImportService.updateClientAuthorizationSettings(ClientAuthorizationImportService.java:121) at de.adorsys.keycloak.config.service.ClientAuthorizationImportService.doImport(ClientAuthorizationImportService.java:98) at de.adorsys.keycloak.config.service.RealmImportService.configureRealm(RealmImportService.java:215) at de.adorsys.keycloak.config.service.RealmImportService.updateRealm(RealmImportService.java:196) at de.adorsys.keycloak.config.service.RealmImportService.updateRealmIfNecessary(RealmImportService.java:154) at de.adorsys.keycloak.config.service.RealmImportService.doImport(RealmImportService.java:145) at de.adorsys.keycloak.config.KeycloakConfigRunner.run(KeycloakConfigRunner.java:79) at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790) at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83) at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789) at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) at de.adorsys.keycloak.config.KeycloakConfigApplication.main(KeycloakConfigApplication.java:35) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) at org.springframework.boot.loader.launch.PropertiesLauncher.main(PropertiesLauncher.java:574)

Expected Behavior

No NPE

Steps To Reproduce

No response

Environment

Anything else?

No response