diff --git a/CHANGES.md b/CHANGES.md index a9b7dda9..6b6327c1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,14 @@ development source code and as such may not be routinely kept up to date. # __NEXT__ +## Bug fixes + +* Commands that authenticate with nextstrain.org, such as `nextstrain login`, + `nextstrain whoami`, and `nextstrain remote` with nextstrain.org addresses, + no longer load AWS credentials, which they don't use. Previously, a local + AWS profile using console login credentials (from `aws login`) caused these + commands to fail with an error about a missing `botocore[crt]` dependency. + ([#533](https://github.com/nextstrain/cli/issues/533), [#552](https://github.com/nextstrain/cli/pull/552)) # 11.1.1 (22 October 2026) diff --git a/doc/changes.md b/doc/changes.md index 6bd35ab7..01f61c73 100644 --- a/doc/changes.md +++ b/doc/changes.md @@ -16,6 +16,15 @@ development source code and as such may not be routinely kept up to date. (v-next)= ## __NEXT__ +(v-next-bug-fixes)= +### Bug fixes + +* Commands that authenticate with nextstrain.org, such as `nextstrain login`, + `nextstrain whoami`, and `nextstrain remote` with nextstrain.org addresses, + no longer load AWS credentials, which they don't use. Previously, a local + AWS profile using console login credentials (from `aws login`) caused these + commands to fail with an error about a missing `botocore[crt]` dependency. + ([#533](https://github.com/nextstrain/cli/issues/533), [#552](https://github.com/nextstrain/cli/pull/552)) (v11-1-1)= ## 11.1.1 (22 October 2026) diff --git a/nextstrain/cli/authn/session.py b/nextstrain/cli/authn/session.py index f252bc1c..1fdaa620 100644 --- a/nextstrain/cli/authn/session.py +++ b/nextstrain/cli/authn/session.py @@ -7,6 +7,8 @@ import secrets from base64 import b64encode +from botocore import UNSIGNED +from botocore.config import Config from errno import EADDRINUSE from hashlib import sha256 from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler @@ -704,7 +706,15 @@ def __init__(self, origin: Origin): self.user_pool_id = self.client_configuration["aws_cognito_user_pool_id"] self.user_pool_region = self.user_pool_id.split("_")[0] - self.cognito = boto3.client("cognito-idp", region_name = self.user_pool_region) + # Cognito's user pool auth APIs (InitiateAuth, RespondToAuthChallenge) + # don't use AWS credentials, so don't load any. Loading them can fail + # depending on local AWS configuration, e.g. a profile from `aws login` + # when the optional awscrt dependency isn't installed. + # + self.cognito = boto3.client( + "cognito-idp", + region_name = self.user_pool_region, + config = Config(signature_version = UNSIGNED)) self.can_authenticate_with_password = True