Skip to content
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

🔐 feat: Enhance Bedrock Credential Handling #4051

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Sep 14, 2024

Summary

A user reported they were still not able to use AWS IAM role policy with the changes from #4038. It was found that making these changes made it work, despite that the previous changes were working with ~/.aws/credentials when access keys were omitted.

  • Modified the getOptions function in the Bedrock options file to omit the credentials field from the initial requestOptions object.
  • Added a conditional check to include credentials in requestOptions only if they are explicitly provided.
  • This change allows the AWS SDK to fall back to its default credential chain when no specific credentials are set, improving flexibility and adherence to AWS best practices.
  • Maintained existing functionality for cases where credentials are explicitly provided.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

To test this change:

  1. Ensure that AWS credentials are properly configured in your environment (e.g., in ~/.aws/credentials, environment variables, or EC2 instance profile).
  2. Run the application and attempt to use the Bedrock endpoint without explicitly providing credentials.
  3. Verify that the application successfully authenticates with AWS and can interact with Bedrock services.
  4. Test again with explicitly provided credentials to ensure that functionality is maintained.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have tested my changes in various AWS credential scenarios

@danny-avila danny-avila changed the title feat: Enhance Bedrock Credential Handling 🔐 🔐 feat: Enhance Bedrock Credential Handling Sep 14, 2024
@danny-avila danny-avila merged commit ab82966 into main Sep 14, 2024
2 checks passed
@danny-avila danny-avila deleted the fix/bedrock-ensure-creds branch September 14, 2024 16:52
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
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.

1 participant