[CSHARP-4503] Refactor AWS authenticator to postpone feching credentials to actual auth call Created: 30/Jan/23  Updated: 20/Mar/23

Status: Backlog
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Dmitry Lukyanov (Inactive) Assignee: Dmitry Lukyanov (Inactive)
Resolution: Unresolved Votes: 0
Labels: tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently we fetch aws credentials right in the ctor during creatinghttps://github.com/mongodb/mongo-csharp-driver/blob/master/src/MongoDB.Driver.Core/Core/Authentication/MongoAWSAuthenticator.cs#L75 aws authenticator.
It's not the best approach for 2 reasons:
1. In the current code, we can't use async code path to fetch aws creds as well as cancellation token.
2. It technically contradicts to what is required by the spec where we need to fetch credentials right before actual authentication call. The reason why it's not a big problem is only coincidence that we create MongoAWSAuthenticator few lines above before actual auth call. In case we we move creating MongoAWSAuthenticator to let's say ClusterBuilder (which at first glance the right place to do it) we will break the spec intention


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