Skip to content

Commit e6a0407

Browse files
add a FF
1 parent 1b3ca19 commit e6a0407

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,4 +367,13 @@ public static void enforceFeatureEnabledOrThrow(
367367
+ "it is still possible to enforce the uniqueness of table locations within a catalog.")
368368
.defaultValue(false)
369369
.buildFeatureConfiguration();
370+
371+
public static final FeatureConfiguration<Boolean> ENABLE_CREDENTIAL_RESET =
372+
PolarisConfiguration.<Boolean>builder()
373+
.key("ENABLE_CREDENTIAL_RESET")
374+
.description(
375+
"Flag to enable or disable the API to reset principal credentials. "
376+
+ "Defaults to enabled, but service providers may want to disable it.")
377+
.defaultValue(true)
378+
.buildFeatureConfiguration();
370379
}

runtime/defaults/src/main/resources/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE"]
116116
# polaris.features."ENABLE_CATALOG_FEDERATION"=true
117117
polaris.features."SUPPORTED_CATALOG_CONNECTION_TYPES"=["ICEBERG_REST"]
118118
polaris.features."SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES"=["OAUTH", "BEARER"]
119+
polaris.features."ENABLE_CREDENTIAL_RESET"=true
119120

120121
# realm overrides
121122
# polaris.features.realm-overrides."my-realm"."SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION"=true

runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,8 @@ public void deletePrincipal(String name) {
11811181

11821182
public @Nonnull PrincipalWithCredentials resetCredentials(
11831183
String principalName, ResetPrincipalRequest resetPrincipalRequest) {
1184+
FeatureConfiguration.enforceFeatureEnabledOrThrow(
1185+
realmConfig, FeatureConfiguration.ENABLE_CREDENTIAL_RESET);
11841186
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.RESET_CREDENTIALS;
11851187
authorizeBasicTopLevelEntityOperationOrThrow(op, principalName, PolarisEntityType.PRINCIPAL);
11861188
var customClientId = resetPrincipalRequest.getClientId();

0 commit comments

Comments
 (0)