Skip to content

Commit

Permalink
add error for misconfigured secret
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonLuttenberger committed Aug 9, 2024
1 parent d11bc6e commit 4a91a7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions seedfarmer/mgmt/archive_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def _download_archive(archive_url: str, secret_name: Optional[str]) -> Response:
if secret_name:
session: boto3.Session = SessionManager().get_or_create().toolchain_session # type: ignore[no-redef]
secret_value = get_secrets_manager_value(secret_name, session)

if "username" not in secret_value or "password" not in secret_value:
raise InvalidConfigurationError("username and password required in secret %s", secret_name)

auth = HTTPBasicAuth(secret_value["username"], secret_value["password"])
else:
auth = None
Expand Down

0 comments on commit 4a91a7a

Please sign in to comment.