"""Class to interact with AWS Secrets Manager.""" import boto3 class SecretsManager(): """Class to interact with AWS Secrets Manager. This class is meant to be used by OwsClient so it should respect this protocol: https://github.com/theorchard/python-owsclient/blob/master/owsclient/protocols.py#L33-L38 """ def __init__(self): """Initialize the Secrets Manager client.""" self.client = boto3.client('secretsmanager') def get_secret(self, secret_name: str) -> str: """Get a secret's value from Secrets Manager.""" secret_value = self.client.get_secret_value(SecretId=secret_name) return secret_value.get('SecretString')