Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid mixing @ConfigMapping and legacy @ConfigRoot in OIDC token propagation #42019

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}