File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
polaris-core/src/main/java/org/apache/polaris/core/secrets Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public class UnsafeInMemorySecretsManager implements UserSecretsManager {
4343 private static final String CIPHERTEXT_HASH = "ciphertext-hash" ;
4444 private static final String ENCRYPTION_KEY = "encryption-key" ;
4545
46- private static final String SECRET_MANAGER_TYPE = "unsafe-in-memory" ;
46+ public static final String SECRET_MANAGER_TYPE = "unsafe-in-memory" ;
4747
4848 /** {@inheritDoc} */
4949 @ Override
@@ -74,9 +74,7 @@ public UserSecretReference writeSecret(
7474 String secretUrn ;
7575 for (int secretOrdinal = 0 ; ; ++secretOrdinal ) {
7676 String typeSpecificIdentifier = forEntity .getId () + ":" + secretOrdinal ;
77- secretUrn =
78- UserSecretReferenceUrnHelper .buildUrn (SECRET_MANAGER_TYPE , typeSpecificIdentifier );
79-
77+ secretUrn = buildUrn (SECRET_MANAGER_TYPE , typeSpecificIdentifier );
8078 // Store the base64-encoded encrypted ciphertext in the simulated "secret store".
8179 String existingSecret =
8280 rawSecretStore .putIfAbsent (secretUrn , encryptedSecretCipherTextBase64 );
Original file line number Diff line number Diff line change @@ -63,4 +63,17 @@ public interface UserSecretsManager {
6363 * @param secretReference Reference object for retrieving the original secret
6464 */
6565 void deleteSecret (@ Nonnull UserSecretReference secretReference );
66+
67+ /**
68+ * Builds a URN string from the given secret manager type and type-specific identifier.
69+ *
70+ * @param typeSpecificIdentifier The type-specific identifier (colon-separated alphanumeric
71+ * components with underscores and hyphens).
72+ * @return The constructed URN string.
73+ */
74+ @ Nonnull
75+ default String buildUrn (
76+ @ Nonnull String secretManagerType , @ Nonnull String typeSpecificIdentifier ) {
77+ return UserSecretReferenceUrnHelper .buildUrn (secretManagerType , typeSpecificIdentifier );
78+ }
6679}
You can’t perform that action at this time.
0 commit comments