From 75b49be719d64c81a11805ee1c8d9562027c22e8 Mon Sep 17 00:00:00 2001 From: Dhaval D <343411+ossdhaval@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:38:33 +0530 Subject: [PATCH] fix: feature flag default values (#6857) * fix(auth-server): make fields mandatory feature Feature flag documentation should always have `description` and `Default Value` for every feature flag. So making them mandatory fields by removing the defaults. Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com> * fix(auth-server): added default values to feature flags Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com> --------- Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com> --- .../jans/as/model/common/FeatureFlagType.java | 60 ++++++++++++------- .../jans/doc/annotation/DocFeatureFlag.java | 4 +- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/jans-auth-server/model/src/main/java/io/jans/as/model/common/FeatureFlagType.java b/jans-auth-server/model/src/main/java/io/jans/as/model/common/FeatureFlagType.java index dd0b11276dd..653638e5b13 100644 --- a/jans-auth-server/model/src/main/java/io/jans/as/model/common/FeatureFlagType.java +++ b/jans-auth-server/model/src/main/java/io/jans/as/model/common/FeatureFlagType.java @@ -14,46 +14,66 @@ public enum FeatureFlagType { UNKNOWN("unknown"), - @DocFeatureFlag(description = "Enable/Disable health-check endpoint") + @DocFeatureFlag(description = "Enable/Disable health-check endpoint", + defaultValue = "Enabled") HEALTH_CHECK("health_check"), - @DocFeatureFlag(description = "Enable/Disable OpenID Connect [userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)") + @DocFeatureFlag(description = "Enable/Disable OpenID Connect [userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)", + defaultValue = "Enabled") USERINFO("userinfo"), - @DocFeatureFlag(description = "Enable/Disable client info endpoint") + @DocFeatureFlag(description = "Enable/Disable client info endpoint", + defaultValue = "Enabled") CLIENTINFO("clientinfo"), - @DocFeatureFlag(description = "Enable/Disable ID Generation endpoint") + @DocFeatureFlag(description = "Enable/Disable ID Generation endpoint", + defaultValue = "Enabled") ID_GENERATION("id_generation"), - @DocFeatureFlag(description = "Enable/Disable client registration endpoint") + @DocFeatureFlag(description = "Enable/Disable client registration endpoint", + defaultValue = "Enabled") REGISTRATION("registration"), - @DocFeatureFlag(description = "Enable/Disable token introspection endpoint") + @DocFeatureFlag(description = "Enable/Disable token introspection endpoint", + defaultValue = "Enabled") INTROSPECTION("introspection"), - @DocFeatureFlag(description = "Enable/Disable token revocation endpoint") + @DocFeatureFlag(description = "Enable/Disable token revocation endpoint", + defaultValue = "Enabled") REVOKE_TOKEN("revoke_token"), - @DocFeatureFlag(description = "Enable/Disable session revocation endpoint") + @DocFeatureFlag(description = "Enable/Disable session revocation endpoint", + defaultValue = "Enabled") REVOKE_SESSION("revoke_session"), - @DocFeatureFlag(description = "Enable/Disable active session endpoint") + @DocFeatureFlag(description = "Enable/Disable active session endpoint", + defaultValue = "Enabled") ACTIVE_SESSION("active_session"), - @DocFeatureFlag(description = "Enable/Disable end session endpoint") + @DocFeatureFlag(description = "Enable/Disable end session endpoint", + defaultValue = "Enabled") END_SESSION("end_session"), - @DocFeatureFlag(description = "Enable/Disable session status check endpoint") + @DocFeatureFlag(description = "Enable/Disable session status check endpoint", + defaultValue = "Enabled") STATUS_SESSION("status_session"), - @DocFeatureFlag(description = "Enable/Disable *.well-known* configuration endpoint") + @DocFeatureFlag(description = "Enable/Disable *.well-known* configuration endpoint", + defaultValue = "Enabled") JANS_CONFIGURATION("jans_configuration"), // /.well-known/jans-configuration - @DocFeatureFlag(description = "Enable/Disable OpenID Connect Client Initiated Backchannel Authentication Flow(CIBA) flow support") + @DocFeatureFlag(description = "Enable/Disable OpenID Connect Client Initiated Backchannel Authentication Flow(CIBA) flow support", + defaultValue = "Enabled") CIBA("ciba"), - @DocFeatureFlag(description = "Enable/Disable support for User-Managed Access (UMA)") + @DocFeatureFlag(description = "Enable/Disable support for User-Managed Access (UMA)", + defaultValue = "Disabled") UMA("uma"), - @DocFeatureFlag(description = "Enable/Disable support for Universal 2nd Factor(U2F) protocol") + @DocFeatureFlag(description = "Enable/Disable support for Universal 2nd Factor(U2F) protocol", + defaultValue = "Disabled") U2F("u2f"), - @DocFeatureFlag(description = "Enable/Disable support for device authorization") + @DocFeatureFlag(description = "Enable/Disable support for device authorization", + defaultValue = "Enabled") DEVICE_AUTHZ("device_authz"), - @DocFeatureFlag(description = "Enable/Disable metric reporter feature") + @DocFeatureFlag(description = "Enable/Disable metric reporter feature", + defaultValue = "Enabled") METRIC("metric"), - @DocFeatureFlag(description = "Enable/Disable Stat service") + @DocFeatureFlag(description = "Enable/Disable Stat service", + defaultValue = "Enabled") STAT("stat"), - @DocFeatureFlag(description = "Enable/Disable Pushed Authorization Requests(PAR) feature") + @DocFeatureFlag(description = "Enable/Disable Pushed Authorization Requests(PAR) feature", + defaultValue = "Enabled") PAR("par"), - @DocFeatureFlag(description = "Enable/Disable Software Statement Assertion(SSA) feature") + @DocFeatureFlag(description = "Enable/Disable Software Statement Assertion(SSA) feature", + defaultValue = "Enabled") SSA("ssa"); private final String value; diff --git a/jans-core/doc/src/main/java/io/jans/doc/annotation/DocFeatureFlag.java b/jans-core/doc/src/main/java/io/jans/doc/annotation/DocFeatureFlag.java index 8aaed803ba9..2a5ae524e7d 100644 --- a/jans-core/doc/src/main/java/io/jans/doc/annotation/DocFeatureFlag.java +++ b/jans-core/doc/src/main/java/io/jans/doc/annotation/DocFeatureFlag.java @@ -8,9 +8,9 @@ @Target(ElementType.FIELD) @Retention(RetentionPolicy.SOURCE) public @interface DocFeatureFlag { - String description() default "None"; + String description(); boolean isRequired() default false; - String defaultValue() default "None"; + String defaultValue(); }