lasdf1234 commented on code in PR #12366:
URL: https://github.com/apache/gravitino/pull/12366#discussion_r3734440441
##########
common/src/main/java/org/apache/gravitino/dto/requests/CatalogCreateRequest.java:
##########
@@ -62,18 +94,26 @@ public class CatalogCreateRequest implements RESTRequest {
* @param provider The provider of the catalog.
* @param comment The comment for the catalog.
* @param properties The properties for the catalog.
+ * @param secretBindings Optional property key → binding DTO ({@code
provider} + {@code
+ * plaintext}) for write-through secrets.
+ * @param secretReferences Optional property key → secret locator DTO
({@code provider} plus
+ * provider-specific attributes).
*/
@JsonCreator
public CatalogCreateRequest(
@JsonProperty("name") String name,
@JsonProperty("type") Catalog.Type type,
@JsonProperty("provider") String provider,
@JsonProperty("comment") String comment,
- @JsonProperty("properties") Map<String, String> properties) {
+ @JsonProperty("properties") Map<String, String> properties,
+ @JsonProperty("secretBindings") Map<String, SecretBindingDTO>
secretBindings,
+ @JsonProperty("secretReferences") Map<String, SecretReferenceDTO>
secretReferences) {
this.name = name;
this.type = type;
this.comment = comment;
this.properties = properties;
+ this.secretBindings = secretBindings;
+ this.secretReferences = secretReferences;
Review Comment:
Thank you very much for your review. This issue has been fixed.
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -1303,7 +1320,10 @@ private Map<String, String>
getResolvedProperties(CatalogEntity entity) {
private BaseCatalog<?> createBaseCatalog(IsolatedClassLoader classLoader,
CatalogEntity entity) {
// Load Catalog class instance
BaseCatalog<?> catalog = createCatalogInstance(classLoader,
entity.getProvider());
- catalog.withCatalogConf(entity.getProperties()).withCatalogEntity(entity);
+ // Resolve secret URNs to plaintext for connector init only; entity
storage keeps URNs.
+ catalog
+
.withCatalogConf(secretManager.toPlaintextProperties(entity.getProperties()))
Review Comment:
Thanks — agreed. details=true now authorizes on catalog identifiers first
(listCatalogs + filterByExpression), then resolves catalog details only for the
allowed names via listCatalogsInfo(namespace, catalogNames). Unauthorized
catalogs are no longer loaded/resolved
##########
common/src/main/java/org/apache/gravitino/dto/requests/FilesetCreateRequest.java:
##########
@@ -64,6 +67,16 @@ public class FilesetCreateRequest implements RESTRequest {
@JsonProperty("properties")
private Map<String, String> properties;
+ @Nullable
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("secretBindings")
+ private Map<String, SecretBindingDTO> secretBindings;
Review Comment:
Thank you very much for your review. This issue has been fixed.
##########
api/src/main/java/org/apache/gravitino/SupportsCatalogs.java:
##########
@@ -84,23 +88,58 @@ default boolean catalogExists(String catalogName) {
* the created catalog is the managed catalog, like model, fileset catalog.
For the details of the
* provider definition, see {@link CatalogProvider}.
*
- * @param catalogName the name of the catalog.
- * @param type the type of the catalog.
- * @param provider the provider of the catalog, or null if the catalog is a
managed catalog.
- * @param comment the comment of the catalog.
- * @param properties the properties of the catalog.
- * @return The created catalog.
- * @throws NoSuchMetalakeException If the metalake does not exist.
- * @throws CatalogAlreadyExistsException If the catalog already exists.
+ * @param catalogName the name of the catalog
+ * @param type the type of the catalog
+ * @param provider the provider of the catalog, or null if the catalog is a
managed catalog
+ * @param comment the comment of the catalog
+ * @param properties the properties of the catalog
+ * @param secretBindings optional property key → binding ({@code provider} +
{@code plaintext})
+ * for write-through
+ * @param secretReferences optional property key → secret locator ({@code
provider} plus
+ * provider-specific attributes)
+ * @return the created catalog
+ * @throws NoSuchMetalakeException if the metalake does not exist
+ * @throws CatalogAlreadyExistsException if the catalog already exists
*/
Catalog createCatalog(
String catalogName,
Catalog.Type type,
String provider,
String comment,
- Map<String, String> properties)
+ Map<String, String> properties,
+ Map<String, SecretBinding> secretBindings,
Review Comment:
Thank you for your review. In the old method, the keyword used was
"abstract", while in the new method, "default" was used. The changes have been
made.
--
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]