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

Add control over use of unsafe remotes #1721

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

mjcheetham
Copy link
Collaborator

Today, all the custom host providers (Azure Repos, Bitbucket, GitHub, GitLab) block the use of HTTP (unencrypted) remote URLs and error out. Only the generic host provider permits HTTP remotes.

From #1694, we learn that a common use case for self/corporate hosted Git servers is to use HTTP remotes. Even if this is not recommended, GCM should not outright block these.

Instead, we now add an option, GCM_ALLOW_UNSAFE_REMOTES or credential.allowUnsafeRemotes, for the user to explicitly set to allow the use of these unsafe remotes.

For the generic host provider we only print a warning when using HTTP remotes to reduce the churn for existing users who rely on GCM for HTTP remotes.

Add a new setting that allows users to express an explicit consent to
using unsafe remote URLs (such as those using HTTP rather than HTTPS).
Note that we only emit a warning for the generic host provider rather
than failing-fast like the other providers do. This is because we
never blocked HTTP remotes previously in the generic provider (which is
often used for localhost, custom hosts, etc) and don't want to break
any existing scenarios or scripts.

The new option can be used to dismiss this warning message.
@mjcheetham mjcheetham added the enhancement New feature or request label Oct 7, 2024
@mjcheetham mjcheetham requested a review from dscho October 7, 2024 12:28
@@ -226,6 +228,7 @@ public static class HelpUrls
public const string GcmAutoDetect = "https://aka.ms/gcm/autodetect";
public const string GcmDefaultAccount = "https://aka.ms/gcm/defaultaccount";
public const string GcmMultipleUsers = "https://aka.ms/gcm/multipleusers";
public const string GcmUnsafeRemotes = "https://aka.ms/gcm/unsaferemotes";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This shortlink has been configured to point to

https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/netconfig.md#unsafe-remote-urls

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.

This PR looks good to me!

There is a new error about a broken link:

✗ [404] https://specifications.freedesktop.org/secret-service/ | Failed: Network error: Not Found

This link is in GCM's documentation apparently 3 times. I think that this should be updated to https://specifications.freedesktop.org/secret-service-spec/.

@dscho
Copy link
Collaborator

dscho commented Oct 7, 2024

There is a new error about a broken link:

I have opened #1722 to fix this; This successful doc linting run suggests that I've managed 😊

@mjcheetham mjcheetham merged commit 7b60eee into git-ecosystem:main Oct 7, 2024
7 of 8 checks passed
@mjcheetham mjcheetham deleted the unsafe-remotes branch October 7, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants