lasdf1234 opened a new pull request, #14479:
URL: https://github.com/apache/gravitino/pull/14479

   ### What changes were proposed in this pull request?
   
   - Map unsupported metadata-object secret reads to 400 
(`IllegalArgumentException` / legacy `NotSupportedException`).
   - Reject create-time `secretBindings` whose plaintext is the masked 
placeholder `******` (same rule as alter `setSecretBinding`).
   - Reject scalar/array `SecretBindingDTO` values without quoting them, and 
omit Jackson stacks from malformed-JSON 400 responses so plaintext is not 
echoed.
   - Add `SecretManager.toPlaintextOrMasked` for catalog load so list / disable 
/ drop / re-bind still work when a bound secret cannot be resolved; isolate 
listing failures per catalog.
   
   ### Why are the changes needed?
   
   Fixes #14305, #14306, #14437, #14442.
   
   Incomplete or missing secrets currently surface as 500s, leak plaintext in 
error stacks, accept the read-path mask as a real secret on create, or brick 
catalog management and detailed listing when the provider no longer has the 
material.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes.
   - Unsupported object-type secret GETs return 400 instead of 500.
   - Create with `plaintext: "******"` is rejected.
   - Malformed `secretBindings` 400 responses no longer include Jackson stacks 
that may quote secrets.
   - Catalogs whose secrets cannot be resolved remain manageable (list / 
disable / drop / re-bind).
   
   ### How was this patch tested?
   
   - `./gradlew :common:test --tests 
org.apache.gravitino.dto.secret.TestSecretBindingDTO`
   - `./gradlew :core:test --tests 
org.apache.gravitino.secret.TestSecretManager --tests 
org.apache.gravitino.catalog.TestCatalogManager.testCreateRejectsMaskedPlaceholderSecretBinding
 --tests 
org.apache.gravitino.catalog.TestCatalogManager.testCatalogManageableWhenSecretMissing`
   - `./gradlew :server:test --tests 
org.apache.gravitino.server.web.rest.TestExceptionHandlers.testUnsupportedSecretObjectTypeReturnsBadRequest
 --tests org.apache.gravitino.server.web.mapper.TestJsonMappingExceptionMapper`
   
   
   Made with [Cursor](https://cursor.com)


-- 
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]

Reply via email to