Refactor AWS authenticator to postpone feching credentials to actual auth call

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Dmitry Lukyanov (Inactive)
            Reporter:
            Dmitry Lukyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: