mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
DeleteSecret without ForceDeleteWithoutRecovery keeps the secret in store with deletedDate set to a future date (recoverable via RestoreSecret) - it's only removed from store outright on a force delete, so resolveSecret() already raises ResourceNotFoundException on its own for a genuinely gone secret. Any getDeletedDate() != null check reached past resolveSecret() therefore always means "still present, scheduled for deletion", which real AWS reports as InvalidRequestException. getSecretValue, putSecretValue, updateSecret, claimTargetAttachment, rotateSecret, and updateSecretVersionStage all threw ResourceNotFoundException here instead, making a recoverable, still-restorable secret indistinguishable from one that's genuinely gone. batchGetSecretValue in the same file already had this right (InvalidRequestException with the correct message) - extracted that into a shared throwIfPendingDeletion(secret) helper and applied it consistently at the six other sites. Strengthened the existing deleteSecretWithRecoveryWindow test (it only asserted AwsException.class, which passes regardless of error code) to check the specific error code, and added a test covering all six affected operations. Fixes #2513