Skip to content

Commit d83df43

Browse files
add a FF
1 parent e2b03cb commit d83df43

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ at locations that better optimize for object storage.
8383

8484
- Introduced bootstrap command options to specify custom schema files for database initialization.
8585

86-
- Added Management API endpoint to reset existing principal credentials with custom values(currently restricted to root).
87-
86+
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
8887

8988
### Changes
9089

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)