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

Only set credential.provider for dynamic matches #535

Merged

Conversation

mjcheetham
Copy link
Collaborator

Only set the credential.provider setting after auto-detection of the provider that used dynamic (network calls) matches.

Currently we set the provider config setting after a successful auto-detection, even if we matched "simply" based on the host name (and didn't need a network call). This means we're setting things like credential.provider = github for github.com hosts. We don't need to do this (and probably shouldn't as this may make it harder in the future to make any changes here).

The original idea of this "set after detect" was really to avoid having to do auto-detection that involved a network call, and not the cheap static matches.

Change the logic in the host provider registry to only persist the provider setting if the network call was made.

Only set the credential.provider setting after auto-detection of the
provider that used dynamic (network calls) matches.

Currently we set the provider config setting after a successful
auto-detection, even if we matched "simply" based on the host name (and
didn't need a network call).

The original idea of this "set after detect" was really to avoid having
to do auto-detection _that involved a network call_, and not the cheap
static matches.

Change the logic in the host provider registry to only persist the
provider setting if the network call was made.
Copy link
Collaborator

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mjcheetham mjcheetham merged commit 7c4381c into git-ecosystem:main Nov 16, 2021
@mjcheetham mjcheetham deleted the dynamic-provider-setting-only branch November 16, 2021 15:30
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.

2 participants