[CSHARP-4430] AwsAuthenticationTests.AwsSdk_should_support_all_required_handlers throws if only basic AWS credentials are defined in ~/.aws/credentials Created: 24/Nov/22  Updated: 28/Oct/23  Resolved: 24/Nov/22

Status: Closed
Project: C# Driver
Component/s: Security, Testing
Affects Version/s: None
Fix Version/s: 2.19.0

Type: Bug Priority: Unknown
Reporter: James Kovacs Assignee: James Kovacs
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

If ~/.aws/credentials only contains aws_access_key_id and aws_secret_access_key, but no aws_session_token, the test fails with the following stack trace:

Expected type to be Amazon.Runtime.SessionAWSCredentials, but found Amazon.Runtime.BasicAWSCredentials.
   at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message)
   at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)
   at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
   at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)
   at FluentAssertions.Types.TypeAssertions.Be(Type expected, String because, Object[] becauseArgs)
   at FluentAssertions.Primitives.ReferenceTypeAssertions`2.BeOfType(Type expectedType, String because, Object[] becauseArgs)
   at FluentAssertions.Primitives.ReferenceTypeAssertions`2.BeOfType[T](String because, Object[] becauseArgs)
   at MongoDB.Driver.Tests.Communication.Security.AwsAuthenticationTests.AwsSdk_should_support_all_required_handlers() in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/tests/MongoDB.Driver.Tests/Communication/Security/AwsAuthenticationTests.cs:line 102 

This test should allow both BasicAWSCredentials and SessionAWSCredentials to be configured.



 Comments   
Comment by Githook User [ 24/Nov/22 ]

Author:

{'name': 'James Kovacs', 'email': 'jkovacs@post.harvard.edu', 'username': 'JamesKovacs'}

Message: CSHARP-4430: Allow BasicAWSCredentials or SessionAWSCredentials to be configured for testing. (#973)
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/ebbfde64894cc2c5b3bb6314e51129629fe824cf

Generated at Wed Feb 07 21:48:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.