lasdf1234 commented on code in PR #13204:
URL: https://github.com/apache/gravitino/pull/13204#discussion_r4027687967
##########
core/src/main/java/org/apache/gravitino/secret/SecretPropertyOperationDispatcher.java:
##########
@@ -242,9 +258,55 @@ private Map<String, String>
loadModelVersionRawProperties(NameIdentifier identif
modelVersion =
wrapper.doWithModelOps(ops -> ops.getModelVersion(modelIdent,
versionName));
}
- return modelVersion.properties() == null ? Map.of() :
modelVersion.properties();
+ Map<String, String> raw =
+ modelVersion.properties() == null ? Map.of() :
modelVersion.properties();
+ return new RawPropertiesAndMetadata(
+ raw,
+ propertiesMetadataOrNull(
+ wrapper,
HasPropertyMetadata::modelVersionPropertiesMetadata));
},
NoSuchCatalogException.class,
NoSuchModelVersionException.class);
}
+
+ private Map<String, String> loadMetalakeRawProperties(NameIdentifier
identifier) {
+ try {
+ BaseMetalake entity = store.get(identifier, Entity.EntityType.METALAKE,
BaseMetalake.class);
+ return entity.properties() == null ? Map.of() : entity.properties();
+ } catch (NoSuchEntityException e) {
+ throw new NoSuchMetalakeException(e, "Metalake %s does not exist",
identifier);
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to load metalake entity " +
identifier, e);
+ }
+ }
+
+ /**
+ * Returns properties metadata under the catalog connector classloader, or
{@code null} when the
+ * catalog does not support it for this entity type.
+ */
+ @Nullable
+ static PropertiesMetadata propertiesMetadataOrNull(
+ CatalogManager.CatalogWrapper wrapper,
+ ThrowableFunction<HasPropertyMetadata, PropertiesMetadata> getter) {
+ try {
+ return wrapper.doWithPropertiesMeta(getter);
+ } catch (UnsupportedOperationException e) {
+ return null;
Review Comment:
Fixed in `fe5350175`.
On `UnsupportedOperationException`, `resolvePropertiesMetadata` now returns
`FallbackPropertiesMetadata.INSTANCE` instead of `null`.
That fallback still registers the shared base / credential / cloud property
entries, so official non-hidden keys (`credential-providers`,
`s3-access-key-id`, …) are not fuzzy-recovered into `getSecrets`, while
undeclared sensitive-named keys keep fuzzy recovery and declared hidden secrets
remain recoverable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]