Skip to content

Commit

Permalink
Add Jose4j static init recording to OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
sberyozkin committed Aug 26, 2024
1 parent 60994bf commit 24d15c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import io.quarkus.oidc.runtime.DefaultTenantConfigResolver;
import io.quarkus.oidc.runtime.DefaultTokenIntrospectionUserInfoCache;
import io.quarkus.oidc.runtime.DefaultTokenStateManager;
import io.quarkus.oidc.runtime.Jose4jRecorder;
import io.quarkus.oidc.runtime.OidcAuthenticationMechanism;
import io.quarkus.oidc.runtime.OidcConfig;
import io.quarkus.oidc.runtime.OidcConfigurationMetadataProducer;
Expand Down Expand Up @@ -139,6 +140,12 @@ public void additionalBeans(BuildProducer<AdditionalBeanBuildItem> additionalBea
additionalBeans.produce(builder.build());
}

@BuildStep
@Record(ExecutionTime.STATIC_INIT)
public void initJose4J(Jose4jRecorder recorder) {
recorder.initialize();
}

@BuildStep(onlyIf = IsCacheEnabled.class)
@Record(ExecutionTime.RUNTIME_INIT)
public SyntheticBeanBuildItem addDefaultCacheBean(OidcConfig config,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.oidc.runtime;

import org.jose4j.jwa.AlgorithmFactoryFactory;

import io.quarkus.runtime.annotations.Recorder;

@Recorder
public class Jose4jRecorder {

public void initialize() {
AlgorithmFactoryFactory.getInstance();
}

}

0 comments on commit 24d15c2

Please sign in to comment.