Skip to content

Commit

Permalink
Register the password provider at runtime
Browse files Browse the repository at this point in the history
This prevents the Graal 19.3.0 NPE when checking the
providers list.
  • Loading branch information
stuartwdouglas committed Dec 3, 2019
1 parent 8e20d02 commit 43e36e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ SecurityDomainBuildItem build(ElytronRecorder recorder, List<SecurityRealmBuildI
return null;
}

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
public void registerPasswordProvider(ElytronRecorder recorder) {
recorder.registerPasswordProvider();
}

@BuildStep
@Record(ExecutionTime.STATIC_INIT)
void identityManager(ElytronRecorder recorder, SecurityDomainBuildItem securityDomain, BeanContainerBuildItem bc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ public void addRealm(RuntimeValue<SecurityDomain.Builder> builder, String realmN
* @return the security domain runtime value
*/
public RuntimeValue<SecurityDomain> buildDomain(RuntimeValue<SecurityDomain.Builder> builder) {
Security.addProvider(new WildFlyElytronPasswordProvider());
return new RuntimeValue<>(builder.getValue().build());
}

/**
* As of Graal 19.3.0 this has to be registered at runtime, due to a bug.
*
* 19.3.1 should fix this, see https://github.com/oracle/graal/issues/1883
*/
public void registerPasswordProvider() {
Security.addProvider(new WildFlyElytronPasswordProvider());
}
}

0 comments on commit 43e36e5

Please sign in to comment.