[PR #6377] feat(bedrock): config options and authentication precedence #11868

Closed
opened 2026-02-16 18:16:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6377

State: closed
Merged: Yes


Summary

Adds configuration file support for Amazon Bedrock provider with profile, region, and endpoint options. Documents authentication precedence to clarify that bearer tokens take priority over AWS credential chain methods.

Changes

Provider Configuration (provider.ts)

  • Added support for profile, region, and endpoint options in opencode.json
  • Implemented precedence logic: config file options override environment variables
  • Profile option now passed to fromNodeProviderChain() for proper credential resolution

Tests (amazon-bedrock.test.ts)

  • Added 4 tests covering config precedence scenarios
  • Tests verify profile precedence, endpoint configuration, and combined options

Documentation (config.mdx, providers.mdx)

  • Added "Provider-Specific Options" section to config docs
  • Added "Authentication Precedence" section to providers docs
  • Documents that bearer tokens (AWS_BEARER_TOKEN_BEDROCK or /connect) take precedence over credential chain

CLI (auth.ts)

  • Updated /connect amazon-bedrock help message to show clear credential priority order

Configuration Example

{
  "provider": {
    "amazon-bedrock": {
      "options": {
        "region": "us-east-1",
        "profile": "my-aws-profile",
        "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com"
      }
    }
  }
}

Authentication Precedence

  1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
  2. AWS credential chain (profile, access keys, IAM roles)

Notes:

  • Follows existing patterns for provider configuration
  • Maintains backward compatibility with environment variable configuration
  • Configuration file options take precedence over environment variables (except bearer tokens)
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6377 **State:** closed **Merged:** Yes --- ### Summary Adds configuration file support for Amazon Bedrock provider with `profile`, `region`, and `endpoint` options. Documents authentication precedence to clarify that bearer tokens take priority over AWS credential chain methods. ### Changes **Provider Configuration (`provider.ts`)** - Added support for `profile`, `region`, and `endpoint` options in `opencode.json` - Implemented precedence logic: config file options override environment variables - Profile option now passed to `fromNodeProviderChain()` for proper credential resolution **Tests (`amazon-bedrock.test.ts`)** - Added 4 tests covering config precedence scenarios - Tests verify profile precedence, endpoint configuration, and combined options **Documentation (`config.mdx`, `providers.mdx`)** - Added "Provider-Specific Options" section to config docs - Added "Authentication Precedence" section to providers docs - Documents that bearer tokens (`AWS_BEARER_TOKEN_BEDROCK` or `/connect`) take precedence over credential chain **CLI (`auth.ts`)** - Updated `/connect amazon-bedrock` help message to show clear credential priority order ### Configuration Example ```json { "provider": { "amazon-bedrock": { "options": { "region": "us-east-1", "profile": "my-aws-profile", "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com" } } } } ``` ### Authentication Precedence 1. Bearer token (`AWS_BEARER_TOKEN_BEDROCK` or `/connect`) 2. AWS credential chain (profile, access keys, IAM roles) --- **Notes:** - Follows existing patterns for provider configuration - Maintains backward compatibility with environment variable configuration - Configuration file options take precedence over environment variables (except bearer tokens)
yindo added the pull-request label 2026-02-16 18:16:48 -05:00
yindo closed this issue 2026-02-16 18:16:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11868