-
Notifications
You must be signed in to change notification settings - Fork 1.1k
AWS_BEARER_TOKEN_BEDROCK with empty string causes incomplete signature errors #3603
Copy link
Copy link
Open
Labels
guidanceQuestion that needs advice or information.Question that needs advice or information.
Description
Describe the bug
When AWS_BEARER_TOKEN_BEDROCK is set to an empty string (via export AWS_BEARER_TOKEN_BEDROCK=), boto3 treats it as a valid bearer token and uses it for authentication,
causing "incomplete signature" errors. The empty string should be treated as if the variable is unset.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
- Empty string should be ignored
- Fall back to AWS credentials (IAM role, assume role, etc.)
Current Behavior
- boto3 uses empty bearer token in HTTP request headers
- Requests fail with incomplete signature errors
- Only unset AWS_BEARER_TOKEN_BEDROCK works (not export AWS_BEARER_TOKEN_BEDROCK=)
Reproduction Steps
export AWS_BEARER_TOKEN_BEDROCK=
python3 << EOF
import boto3
import logging
boto3.set_stream_logger('', logging.DEBUG)
client = boto3.client('bedrock-runtime', region_name='us-east-1')
# Fails with incomplete signature error
# Debug log shows BEARER_TOKEN in request headers
EOF
Possible Solution
No response
Additional Information/Context
No response
SDK version used
boto3: 1.35.69; botocore: 1.35.69
Environment details (OS name and version, etc.)
macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
guidanceQuestion that needs advice or information.Question that needs advice or information.