Hi all,

While working on credentials rotation recently, I noticed that "reset"
means two different things, which is confusing:

1. The reset API (POST /principals/{name}/reset).
PolarisAdminService.resetCredentials() deletes the principal's secrets
and calls PolarisMetaStoreManager.resetPrincipalSecrets().

2. A reset flag on rotation:
PolarisMetaStoreManager.rotatePrincipalSecrets() has a "reset"
parameter. When true, the previous main secret is not kept as the
secondary secret, and the principal gets marked as requiring a
credential rotation.

Only the first path is used today. Polaris always passes reset=false
to rotatePrincipalSecrets(), and the branch where reset=true is
unreachable outside tests.

But there is more: when a principal created with
credentialRotationRequired rotates for the first time, the persistence
layer drops its initial secret instead of keeping it as the secondary.
That's also controlled by a parameter named "reset" in
IntegrationPersistence.rotatePrincipalSecrets(). This also adds to the
confusion.

Here is what I propose:

1. Clarify things: rename badly-named methods and parameters, remove
unused parameters in the service layer, document how rotate and reset
differ, fix stale javadocs. This is uncontroversial imho.

2. Change the SPI: since the reset=true branch is not exercised in
production, remove the unused parameter from
PolarisMetaStoreManager.rotatePrincipalSecrets() and delete the
unreachable branch in managers who implemented it. This requires
consensus, which is why I'm writing this message.

Please let me know your thoughts.

Thanks,
Alex

Reply via email to