-
Notifications
You must be signed in to change notification settings - Fork 780
feat: add AWS Bedrock authentication support #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughServer adds an AWS Bedrock path for Claude auth controlled by Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (Settings UI)
participant UI as Account UI
participant Server as Server (/claude/status)
participant Env as Env (CLAUDE_CODE_USE_BEDROCK)
Client->>Server: GET /claude/status
Note right of Server: Reads Env (CLAUDE_CODE_USE_BEDROCK)
Env-->>Server: flag value
alt CLAUDE_CODE_USE_BEDROCK == true
Server-->>Client: { authenticated: true, email: "AWS Bedrock", isBedrock: true, method: "bedrock" }
else
Server-->>Client: { authenticated: ..., isBedrock: false, method: "credentials_file" }
end
Client->>UI: update authStatus (includes isBedrock)
alt isBedrock == true
UI-->>UI: hide login/re-auth controls
else
UI-->>UI: show login/re-auth controls
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Detect CLAUDE_CODE_USE_BEDROCK env var for Bedrock auth - Hide OAuth login UI for Bedrock users (auth via AWS credentials) - Pass isBedrock flag through auth status to frontend Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
@claude please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.env.example:
- Around line 76-79: The .env.example contains duplicated active ANTHROPIC_MODEL
entries which causes the latter to silently override the former; remove one of
the active ANTHROPIC_MODEL lines so only a single default is uncommented (keep
alternatives commented), e.g., leave one ANTHROPIC_MODEL as the default and
comment the other(s) with a short description to avoid confusion for users
copying the file.
|
@Fl0p could you please use shared/modelConstants.js to store the models? also would it be possible to add an option to set this up from the UI as well? |
This commit refines the configuration setup for AWS Bedrock and Anthropic models in the `.env.example` file. Unnecessary Docker-specific configurations were removed, and a conditional structure was introduced for AWS Bedrock settings. The AWS region was changed to `eu-central-1`, and default Anthropic models are explicitly defined within the AWS Bedrock conditional block. Additionally, commented directives are provided for selecting default models for usage with Anthropic services, thereby improving clarity and usability of environment configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.env.example:
- Around line 51-76: Remove the Bash control and export syntax in the
CLAUDE_CODE_USE_BEDROCK block and replace it with dotenv-friendly content:
remove the lines "if [[ ... ]]; then", "export ...", and "fi", keep only plain
KEY=VALUE entries such as CLAUDE_CODE_USE_BEDROCK, AWS_REGION, AWS_PROFILE,
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, ANTHROPIC_DEFAULT_SONNET_MODEL,
ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_MODEL,
and ANTHROPIC_SMALL_FAST_MODEL, and if you need to provide guidance about
enabling options or defaults, convert those notes into commented lines starting
with # so the file remains compatible with dotenv parsers.
Refactor the AWS Bedrock and Anthropic model configuration section in the .env.example file to enhance clarity. Condensed the sections by removing redundant comments and grouping related configuration parameters together. Now, users can uncomment the lines for the desired setup and fill in the appropriate credentials easily. Included clear indicators for the start and end of the configuration block, making it straightforward to identify relevant sections for setting up AWS Bedrock and Anthropic models.
Included prerequisites for setting up the AWS Bedrock configuration in the .env.example file. The added comments guide users to ensure they have the AWS CLI installed and configured properly, either through 'aws configure' or via environment variables or IAM roles. These changes aim to facilitate setting up AWS Bedrock by providing necessary setup instructions directly in the environment example file.
|
@viper151 BTW simplified .env.example and added more info in it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.env.example:
- Around line 72-74: Replace the shell-style assignments in the .env example:
remove the leading "export" and any "$VARIABLE" expansions and instead provide
plain KEY=value entries using the actual model identifiers for ANTHROPIC_MODEL
and ANTHROPIC_SMALL_FAST_MODEL (e.g., set
ANTHROPIC_MODEL=<actual-sonnet-or-opus-model-string> and
ANTHROPIC_SMALL_FAST_MODEL=<actual-haiku-model-string>) so that ANTHROPIC_MODEL,
ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL,
ANTHROPIC_SMALL_FAST_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL are represented as
valid .env assignments users can uncomment directly.
🧹 Nitpick comments (1)
.env.example (1)
52-52: Remove extra blank line for cleaner formatting.🧹 Proposed fix
# - Or ensure AWS credentials are available via environment variables or IAM roles - # To use AWS Bedrock instead of Anthropic API
Refactored the Anthropic model configuration section in the .env.example file to enhance clarity. Adjusted comments explaining default model usage and selection through the use of a startup switch command. Streamlined the model assignment process by removing the commented-out export statements and directly specifying model variables for streamlined configuration. These changes aim to simplify understanding and customization of Anthropic model setups for different inference profiles, especially focusing on European region prefixes.
|
@Fl0p thanks for fixing these. Just one last question as I did a similar installation recently. Have you tried setting it up on claude code directly instead of this project? By following this https://code.claude.com/docs/en/amazon-bedrock#3-configure-claude-code I had aws working so adding the models here might not be needed at all. |

Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.