- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.8k
 
feat(NODE-6141): allow custom aws sdk config #4373
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
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    cc7c745    to
    39e8251      
    Compare
  
    
      
        
      
      
  
    3 tasks
  
cf513cc    to
    79272e8      
    Compare
  
    5469458    to
    32490b5      
    Compare
  
    001f3d5    to
    120f0e6      
    Compare
  
    
              
                    W-A-James
  
              
              previously requested changes
              
                  
                    Mar 4, 2025 
                  
              
              
            
            
        
          
                ...ient-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts
              
                Outdated
          
            Show resolved
            Hide resolved
        
      0418b98    to
    3733848      
    Compare
  
    
              
                    nbbeeken
  
              
              previously approved these changes
              
                  
                    Mar 10, 2025 
                  
              
              
            
            
test: skip fle setup
              
                    nbbeeken
  
              
              approved these changes
              
                  
                    Mar 13, 2025 
                  
              
              
            
            
              
                    baileympearson
  
              
              approved these changes
              
                  
                    Mar 14, 2025 
                  
              
              
            
            
| 
           CI failures unrelated and skipped in #4467.  | 
    
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Description
Allows users to provide a custom AWS credential provider for use with MONGODB-AWS authentication.
What is changing?
AWS_CREDENTIAL_PROVIDERauth mechanism property to fetch credentials.credentialProvidersoption to both client encryption options and auto encryption options.Is there new documentation needed for these changes?
Updates to the AWS auth section in the driver manual.
What is the motivation for this change?
NODE-6141
Release Highlight
Support for custom AWS credential providers
The driver now supports a user supplied custom AWS credentials provider for both authentication and for KMS requests when using client side encryption. The signature for the custom provider must be of
() => Promise<AWSCredentials>which matches that of the official AWS SDK provider API. Provider chains from the actual AWS SDK can also be provided, allowing users to customize any of those options.Example for authentication with a provider chain from the AWS SDK:
Example for using a custom provider for KMS requests only:
Custom providers do not need to come from the AWS SDK, they just need to be an async function that returns credentials:
Double check the following
npm run check:lintscripttype(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript