Skip to content

Commit

Permalink
Avoid mixing @ConfigMapping and legacy @configroot in OIDC token prop…
Browse files Browse the repository at this point in the history
…agation

This is going to be a problem with the new extension annotation
processor.
  • Loading branch information
gsmet committed Jul 20, 2024
1 parent 1a31077 commit 160e95b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ public static class IsEnabled implements BooleanSupplier {
OidcTokenPropagationBuildTimeConfig config;

public boolean getAsBoolean() {
return config.enabled;
return config.enabled();
}
}

public static class IsEnabledDuringAuth implements BooleanSupplier {
OidcTokenPropagationBuildTimeConfig config;

public boolean getAsBoolean() {
return config.enabledDuringAuthentication;
return config.enabledDuringAuthentication();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package io.quarkus.oidc.token.propagation.runtime;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;

/**
* Build time configuration for OIDC Token Propagation.
*/
@ConfigRoot(name = "resteasy-client-oidc-token-propagation")
public class OidcTokenPropagationBuildTimeConfig {
@ConfigMapping(prefix = "quarkus.resteasy-client-oidc-token-propagation")
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public interface OidcTokenPropagationBuildTimeConfig {

/**
* If the OIDC Token Propagation is enabled.
*/
@ConfigItem(defaultValue = "true")
public boolean enabled;
@WithDefault("true")
boolean enabled();

/**
* Whether the token propagation is enabled during the `SecurityIdentity` augmentation.
Expand All @@ -25,6 +29,6 @@ public class OidcTokenPropagationBuildTimeConfig {
*
* @asciidoclet
*/
@ConfigItem(defaultValue = "false")
public boolean enabledDuringAuthentication;
@WithDefault("false")
boolean enabledDuringAuthentication();
}

0 comments on commit 160e95b

Please sign in to comment.