* initial work - adding put_secret_value and list_secret_versions * Added support for versions in all functions except rotate_secret * more work - refactor rotate_secret method - now, adds a new version of the secret and points default version id to it - updated implementation coverage readme - element in list check to fix unit test - fixed linting errors - added tests, fixed exception, failing tests still - secrets_manager/test_server fails when running whole suite, but not when running that individual test file * fixed failing test_get_secret_value * Removed test.py. Fixed condition statement. * fixed default stages + adding AWSPREVIOUS * remove old AWSPREVIOUS stages
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from __future__ import unicode_literals
|
|
from moto.core.exceptions import JsonRESTError
|
|
|
|
|
|
class SecretsManagerClientError(JsonRESTError):
|
|
code = 400
|
|
|
|
|
|
class ResourceNotFoundException(SecretsManagerClientError):
|
|
def __init__(self):
|
|
self.code = 404
|
|
super(ResourceNotFoundException, self).__init__(
|
|
"ResourceNotFoundException",
|
|
"Secrets Manager can't find the specified secret"
|
|
)
|
|
|
|
|
|
class ClientError(SecretsManagerClientError):
|
|
def __init__(self, message):
|
|
super(ClientError, self).__init__(
|
|
'InvalidParameterValue',
|
|
message)
|
|
|
|
|
|
class InvalidParameterException(SecretsManagerClientError):
|
|
def __init__(self, message):
|
|
super(InvalidParameterException, self).__init__(
|
|
'InvalidParameterException',
|
|
message)
|
|
|
|
|
|
class ResourceExistsException(SecretsManagerClientError):
|
|
def __init__(self, message):
|
|
super(ResourceExistsException, self).__init__(
|
|
'ResourceExistsException',
|
|
message
|
|
)
|
|
|
|
|
|
class InvalidRequestException(SecretsManagerClientError):
|
|
def __init__(self, message):
|
|
super(InvalidRequestException, self).__init__(
|
|
'InvalidRequestException',
|
|
message)
|