Also throw exception if client tries to RotateSecret on a soft-deleted secret
This commit is contained in:
parent
749f4f63e6
commit
bd8aa341f2
2 changed files with 22 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ class SecretsManagerBackend(BaseBackend):
|
|||
|
||||
if 'deleted_date' in self.secrets[secret_id]:
|
||||
raise InvalidRequestException(
|
||||
"An error occurred (InvalidRequestException) when calling the DeleteSecret operation: You tried to \
|
||||
"An error occurred (InvalidRequestException) when calling the GetSecretValue operation: You tried to \
|
||||
perform the operation on a secret that's currently marked deleted."
|
||||
)
|
||||
|
||||
|
|
@ -127,6 +127,12 @@ class SecretsManagerBackend(BaseBackend):
|
|||
if not self._is_valid_identifier(secret_id):
|
||||
raise ResourceNotFoundException
|
||||
|
||||
if 'deleted_date' in self.secrets[secret_id]:
|
||||
raise InvalidRequestException(
|
||||
"An error occurred (InvalidRequestException) when calling the RotateSecret operation: You tried to \
|
||||
perform the operation on a secret that's currently marked deleted."
|
||||
)
|
||||
|
||||
if client_request_token:
|
||||
token_length = len(client_request_token)
|
||||
if token_length < 32 or token_length > 64:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue