Fix issue with wrong parameter signed to secret_binary during secret rotation in Secrets Manager (#3348)

* fix issue with wrong parameter signed to secret_binary

* reformat test
This commit is contained in:
Roman Dmytrenko 2020-10-05 13:10:32 +03:00 committed by GitHub
parent a65c0f004c
commit c1a7f29c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -408,8 +408,8 @@ class SecretsManagerBackend(BaseBackend):
self._add_secret(
secret_id,
old_secret_version["secret_string"],
secret.description,
secret.tags,
description=secret.description,
tags=secret.tags,
version_id=new_version_id,
version_stages=["AWSCURRENT"],
)

View File

@ -502,7 +502,9 @@ def test_restore_secret_that_does_not_exist():
@mock_secretsmanager
def test_rotate_secret():
conn = boto3.client("secretsmanager", region_name="us-west-2")
conn.create_secret(Name=DEFAULT_SECRET_NAME, SecretString="foosecret")
conn.create_secret(
Name=DEFAULT_SECRET_NAME, SecretString="foosecret", Description="foodescription"
)
rotated_secret = conn.rotate_secret(SecretId=DEFAULT_SECRET_NAME)
@ -511,6 +513,10 @@ def test_rotate_secret():
assert rotated_secret["Name"] == DEFAULT_SECRET_NAME
assert rotated_secret["VersionId"] != ""
describe_secret = conn.describe_secret(SecretId=DEFAULT_SECRET_NAME)
assert describe_secret["Description"] == "foodescription"
@mock_secretsmanager
def test_rotate_secret_enable_rotation():