lasdf1234 opened a new pull request, #14926: URL: https://github.com/apache/gravitino/pull/14926
### What changes were proposed in this pull request? - Write-through secrets keep a **fixed URN** (`entityType:entityId:propertyKey`). Alters no longer overwrite the currently readable value in place or delete the old secret during prepare. - Providers that support versions (in-memory now; SPI defaults for Vault KV v2 / AWS Secrets Manager / GCP Secret Manager style backends) allocate a **new version** on rotate. The previous current value stays readable until the entity alter commits and the version is promoted. - Replaced versions are deleted **after commit** by version id (so remove+rebind or a later alter on the same URN is not wiped). Cross-provider replaced URNs are still deleted with `deleteSecret` after commit. - Failed prepare rolls back only pending versions / newly written materials; the old current value remains. ### Why are the changes needed? Fix: #13439 A failed alter could leave the entity referencing a deleted or overwritten write-through secret. Same-provider rotation overwrote the deterministic URN in place, so rollback deleted the still-referenced material. This approach follows industry multi-version secret stores and avoids putting a `writeId` segment in the URN. ### Does this PR introduce _any_ user-facing change? - Write-through URN shape is unchanged. - `SecretProvider` gains optional version APIs: `writeSecretVersion`, `promoteSecretVersion`, `deleteSecretVersion`, `currentSecretVersion` (defaults throw `UnsupportedOperationException`). - In-memory provider is multi-version; `readSecret` returns the current version. ### How was this patch tested? - `TestInMemorySecretsProvider.testWriteSecretVersionKeepsCurrentUntilPromote` - `TestSecretManagerAlter`: deferred remove deletion, failed rotate keeps old plaintext, failed remove+masked keeps secret readable, promote-on-commit rotation, remove+rebind keeps rewritten secret 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]
