Skip to content

fix(auth): warn on empty bearer token env var#3713

Open
rohan-patnaik wants to merge 1 commit into
boto:developfrom
rohan-patnaik:warn-empty-bearer-token
Open

fix(auth): warn on empty bearer token env var#3713
rohan-patnaik wants to merge 1 commit into
boto:developfrom
rohan-patnaik:warn-empty-bearer-token

Conversation

@rohan-patnaik
Copy link
Copy Markdown

@rohan-patnaik rohan-patnaik commented May 22, 2026

Fixes #3603

Summary

This logs a warning when a bearer token environment variable is set to an empty string.

Why

An empty bearer token is still treated as configured today, which matches the current environment-variable behavior. The hard part for users is diagnosing it: requests can fail later with confusing service-side auth errors. This warning makes the bad configuration visible without changing token resolution semantics.

Test plan

  • .venv/bin/python -m pytest tests/unit/test_utils.py::test_get_token_from_environment_warns_for_empty_token tests/unit/test_utils.py::test_get_token_from_environment_returns_token tests/unit/test_utils.py::test_get_token_from_environment_returns_none
  • git diff --check

@rohan-patnaik rohan-patnaik marked this pull request as ready for review May 22, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AWS_BEARER_TOKEN_BEDROCK with empty string causes incomplete signature errors

1 participant