Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew John Cheetham <[email protected]>
  • Loading branch information
wolf99 and mjcheetham authored May 14, 2022
1 parent 9ded9ba commit 60a179f
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ When using GitHub logos, please be sure to follow the [GitHub logo guidelines][g
[git-for-windows]: https://gitforwindows.org/
[git-for-windows-screenshot]: https://user-images.githubusercontent.com/5658207/140082529-1ac133c1-0922-4a24-af03-067e27b3988b.png
[git-tools-credential-storage]: https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
[GitHub]: https://github.com
[GitHub SSH]: https://help.github.com/en/articles/connecting-to-github-with-ssh
[github]: https://github.com
[github-ssh]: https://help.github.com/en/articles/connecting-to-github-with-ssh
[github-logos]: https://github.com/logos
[latest-release]: https://github.com/GitCredentialManager/git-credential-manager/releases/latest
[ms-package-repos]: https://packages.microsoft.com/repos/
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ library (C#). The library targets .NET Standard as well as .NET Framework.
> **Note**
>
> The reason for also targeting .NET Framework directly is that the
> `Microsoft.Identity.Client` ([MSAL.NET][])
> `Microsoft.Identity.Client` ([MSAL.NET][msal])
> library requires a .NET Framework target to be able to show the embedded web
> browser auth pop-up on Windows platforms.
>
> There are extension points that now exist in MSAL.NET meaning we can plug-in
> our own browser pop-up handling code on .NET meaning both Windows and
> Mac. We haven't yet gotten around to exploring this.
>
> See [GCM issue 113][] for more information.
> See [GCM issue 113][issue-113] for more information.
The entry-point for GCM can be found in the `Git-Credential-Manager`
project, a console application that targets both .NET and .NET Framework.
Expand Down Expand Up @@ -81,7 +81,7 @@ helpers on Windows.

We hope to be able to migrate the WPF/Windows only helpers to [Avalonia][]
in order to gain cross-platform graphical user interface support. See
[GCM issue 136][] for up-to-date progress on this effort.
[GCM issue 136][issue-136] for up-to-date progress on this effort.

### Microsoft authentication

Expand Down Expand Up @@ -147,7 +147,7 @@ Git Credential Manager maintains a set of known commands including
GCM also maintains a set of known, registered host providers that implement
the `IHostProvider` interface. Providers register themselves by adding an
instance of the provider to the `Application` object via the `RegisterProvider`
method in [`Core.Program`][].
method in [`Core.Program`][core-program].
The `GenericHostProvider` is registered last so that it can handle all other
HTTP-based remotes as a catch-all, and provide basic username/password auth and
detect the presence of Windows Integrated Authentication (Kerberos, NTLM,
Expand Down
6 changes: 3 additions & 3 deletions docs/autodetect.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In order to detect which host provider to use for a self-hosted instance, each
provider can provide some heuristic matching of the hostname. For example any
hostname that begins "github.*" will be matched to the GitHub host provider.

If a heuristic matches incorrectly, you can always [explicitly configure][]
If a heuristic matches incorrectly, you can always [explicitly configure][explicit-config]
GCM to use a particular provider.

## Remote URL probing
Expand All @@ -28,7 +28,7 @@ URL and inspect HTTP response headers to try and detect a self-hosted instance.

This network call is only performed if neither an exact nor fuzzy match by
hostname can be made. Only one HTTP `HEAD` call is made per credential request
received by Git. To avoid this network call, please [explicitly configure][]
received by Git. To avoid this network call, please [explicitly configure][explicit-config]
the host provider for your self-hosted instance.

After a successful detection of the host provider, GCM will automatically set
Expand Down Expand Up @@ -65,6 +65,6 @@ git config --global credential.ghe.example.com.provider github

[`credential.autoDetectTimeout`]: configuration.md#credentialautodetecttimeout
[`credential.provider`]: configuration.md#credentialprovider
[explicitly configure]: #manual-configuration
[explicit-config]: #manual-configuration
[`GCM_AUTODETECT_TIMEOUT`]: environment.md#GCM_AUTODETECT_TIMEOUT
[`GCM_PROVIDER`]: environment.md#GCM_PROVIDER
8 changes: 4 additions & 4 deletions docs/azrepos-users-and-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Historically, the only option supported by the Azure Repos host provider was
Azure DevOps Personal Access Tokens (PATs).

These PATs are only used by Azure DevOps, and must be [managed through the Azure
DevOps user settings page][azure-devops-pats] or [REST API][].
DevOps user settings page][azure-devops-pats] or [REST API][azure-devops-api].

PATs have a limited lifetime and new tokens must be created once they expire. In
Git Credential Manager, when a PAT expired (or was manually revoked) this
Expand Down Expand Up @@ -188,7 +188,7 @@ inherited).

To associate a user account with a particular Git remote you must manually edit
the remote URL using `git config` commands to include the username in the
[user information][] part of the URL.
[user information][rfc3986-s321] part of the URL.

```shell
git config --local remote.origin.url https://alice-alt%[email protected]/project/_git/repo
Expand Down Expand Up @@ -221,5 +221,5 @@ fabrikam:
[azure-devops-pats]: https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page
[`credential.azreposCredentialType`]: configuration.md#credentialazreposcredentialtype
[`GCM_AZREPOS_CREDENTIALTYPE`]: environment.md#GCM_AZREPOS_CREDENTIALTYPE
[REST API]: https://docs.microsoft.com/en-gb/rest/api/azure/devops/tokens/pats
[user information]: https://tools.ietf.org/html/rfc3986#section-3.2.1
[azure-devops-api]: https://docs.microsoft.com/en-gb/rest/api/azure/devops/tokens/pats
[rfc3986-s321]: https://tools.ietf.org/html/rfc3986#section-3.2.1
16 changes: 8 additions & 8 deletions docs/bitbucket-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Additionally Bitbucket supports App-specific passwords which can be used via Bas
To enhance security Bitbucket offers optional Two-Factor Authentication (2FA). When 2FA is enabled username/password Basic Auth access to the REST APIs and to Git repositories is suspended.
At that point users are left with the choice of username/apps-specific-password Basic Auth for REST APIs and Git interactions, OAuth for REST APIs and Git/Hg interactions or SSH for Git/HG interactions and one of the previous choices for REST APIs.
SSH and REST API access are beyond the scope of this document.
Read about [Bitbucket's 2FA implementation][].
Read about [Bitbucket's 2FA implementation][2fa-impl].

App-specific passwords are not particularly user friendly as once created Bitbucket hides their value, even from the owner.
They are intended for use within application that talk to Bitbucket where application can remember and use the app-specific-password.
[Additional information][].
[Additional information][additional-info].

OAuth is the intended authentication method for user interactions with HTTPS remote URL for Git repositories when 2FA is active.
Essentially once a client application has an OAuth access token it can be used in place of a user's password.
Read more about information [Bitbucket's OAuth implementation][].
Read more about information [Bitbucket's OAuth implementation][oauth-impl].

Bitbucket's OAuth implementation follows the standard specifications for OAuth 2.0, which is out of scope for this document.
However it implements a comparatively rare part of OAuth 2.0 Refresh Tokens.
Expand All @@ -30,7 +30,7 @@ This is explained in more detail below.

## Multiple User Accounts

Unlike the GitHub implementation within the Git Credential Manager, the Bitbucket implementation stores 'secrets', passwords, app-specific passwords, or OAuth tokens, with usernames in the [Windows Credential Manager][] vault.
Unlike the GitHub implementation within the Git Credential Manager, the Bitbucket implementation stores 'secrets', passwords, app-specific passwords, or OAuth tokens, with usernames in the [Windows Credential Manager][wincred-manager] vault.

Depending on the circumstances this means either saving an explicit username in to the Windows Credential Manager/Vault or including the username in the URL used as the identifying key of entries in the Windows Credential Manager vault, i.e. using a key such as `git:https://[email protected]/` rather than `git:https://bitbucket.org`.
This means that the Bitbucket implementation in the GCM can support multiple accounts, and usernames, for a single user against Bitbucket, e.g. a personal account and a work account.
Expand Down Expand Up @@ -81,10 +81,10 @@ This will download and run a standalone instance of Bitbucket Server which can b

Atlassian has [documentation][] on how to download and install their SDK.

[Additional information]:https://confluence.atlassian.com/display/BITBUCKET/App+passwords
[additional-info]:https://confluence.atlassian.com/display/BITBUCKET/App+passwords
[atlas-run-standalone]: https://developer.atlassian.com/server/framework/atlassian-sdk/atlas-run-standalone/
[bitbucket.org]: https://bitbucket.org
[Bitbucket's 2FA implementation]: https://confluence.atlassian.com/bitbucket/two-step-verification-777023203.html
[Bitbucket's OAuth implementation]: https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html
[2fa-impl]: https://confluence.atlassian.com/bitbucket/two-step-verification-777023203.html
[oauth-impl]: https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html
[documentation]: https://developer.atlassian.com/server/framework/atlassian-sdk/
[Windows Credential Manager]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa374792(v=vs.85).aspx
[wincred-manager]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa374792(v=vs.85).aspx
52 changes: 26 additions & 26 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration options

[Git Credential Manager][] works out of the box for most users.
[Git Credential Manager][usage] works out of the box for most users.

Git Credential Manager (GCM) can be configured using Git's configuration files, and follows all of the same rules Git does when consuming the files.

Expand All @@ -9,7 +9,7 @@ Global configuration settings override system configuration settings, and local
GCM honors several levels of settings, in addition to the standard local \> global \> system tiering Git uses.
URL-specific settings or overrides can be applied to any value in the `credential` namespace with the syntax below.

Additionally, GCM respects several GCM-specific [environment variables][] **which take precedence over configuration options**. System administrators may also configure [default values][] for many settings used by GCM.
Additionally, GCM respects several GCM-specific [environment variables][envars] **which take precedence over configuration options**. System administrators may also configure [default values][enterprise-config] for many settings used by GCM.

GCM will only be used by Git if it is installed and configured. Use `git config --global credential.helper manager-core` to assign GCM as your credential helper. Use `git config credential.helper` to see the current configuration.

Expand Down Expand Up @@ -60,7 +60,7 @@ Define the host provider to use when authenticating.

ID|Provider
-|-
`auto` _(default)_|_\[automatic\]_ ([learn more][])
`auto` _(default)_|_\[automatic\]_ ([learn more][autodetect])
`azure-repos`|Azure Repos
`github`|GitHub
`bitbucket`|Bitbucket
Expand All @@ -85,7 +85,7 @@ git config --global credential.ghe.contoso.com.provider github

> This setting is deprecated and should be replaced by `credential.provider` with the corresponding provider ID value.
>
> See the [migration guide][] for more information.
> See the [migration guide][provider-migrate] for more information.
Select the host provider to use when authenticating by which authority is supported by the providers.

Expand Down Expand Up @@ -175,7 +175,7 @@ git config --global credential.tfsonprem123.allowWindowsAuth false

> This setting is deprecated and should be replaced by the [standard `http.proxy` Git configuration option][git-config-http-proxy].
>
> See [HTTP Proxy][] for more information.
> See [HTTP Proxy][http-proxy] for more information.
Configure GCM to use the a proxy for network operations.

Expand Down Expand Up @@ -316,17 +316,17 @@ Select the type of credential store to use on supported platforms.

Default value on Windows is `wincredman`, on macOS is `keychain`, and is unset on Linux.

**Note:** See more information about configuring secret stores in [credential stores][].
**Note:** See more information about configuring secret stores in [cred-stores][].

Value|Credential Store|Platforms
-|-|-
_(unset)_|Windows: `wincredman`, macOS: `keychain`, Linux: _(none)_|-
`wincredman`|Windows Credential Manager (not available over SSH).|Windows
`dpapi`|DPAPI protected files. Customize the DPAPI store location with [credential.dpapiStorePath][]|Windows
`keychain`|macOS Keychain.|macOS
`secretservice`|[freedesktop.org Secret Service API][] via [libsecret][] (requires a graphical interface to unlock secret collections).|Linux
`gpg`|Use GPG to store encrypted files that are compatible with the [`pass` utility][] (requires GPG and `pass` to initialize the store).|macOS, Linux
`cache`|Git's built-in [credential cache][].|Windows, macOS, Linux
`secretservice`|[freedesktop.org Secret Service API][freedesktop-ss] via [libsecret][] (requires a graphical interface to unlock secret collections).|Linux
`gpg`|Use GPG to store encrypted files that are compatible with the [pass][] (requires GPG and `pass` to initialize the store).|macOS, Linux
`cache`|Git's built-in [credential cache][credential-cache].|Windows, macOS, Linux
`plaintext`|Store credentials in plaintext files (**UNSECURE**). Customize the plaintext store location with [`credential.plaintextStorePath`][].|Windows, macOS, Linux

#### Example
Expand Down Expand Up @@ -426,7 +426,7 @@ Use the operating system account manager where available.

Defaults to `false`. This default is subject to change in the future.

_**Note:** before you enable this option on Windows, please review the [Windows Broker][] details for what this means to your local Windows user account._
_**Note:** before you enable this option on Windows, please review the [Windows Broker][wam] details for what this means to your local Windows user account._

Value|Description
-|-
Expand All @@ -445,7 +445,7 @@ git config --global credential.msauthUseBroker true

### credential.useHttpPath

Tells Git to pass the entire repository URL, rather than just the hostname, when calling out to a credential provider. (This setting [comes from Git itself][], not GCM.)
Tells Git to pass the entire repository URL, rather than just the hostname, when calling out to a credential provider. (This setting [comes from Git itself][use-http-path], not GCM.)

Defaults to `false`.

Expand Down Expand Up @@ -519,7 +519,7 @@ Value|Description
`pat` _(default)_|Azure DevOps personal access tokens
`oauth`|Microsoft identity OAuth tokens (AAD or MSA tokens)

Here is more information about [Azure Access tokens][].
Here is more information about [Azure Access tokens][azure-tokens].

#### Example

Expand All @@ -530,18 +530,18 @@ git config --global credential.azreposCredentialType oauth
**Also see: [GCM_AZREPOS_CREDENTIALTYPE][]**

[auto-detection]: autodetect.md
[Azure Access Tokens]: azrepos-azuretokens.md
[comes from Git itself]: https://git-scm.com/docs/gitcredentials/#Documentation/gitcredentials.txt-useHttpPath
[azure-tokens]: azrepos-azuretokens.md
[use-http-path]: https://git-scm.com/docs/gitcredentials/#Documentation/gitcredentials.txt-useHttpPath
[`credential.credentialStore`]: #credentialcredentialstore
[credential.dpapiStorePath]: #credentialdpapistorepath
[credential.interactive]: #credentialinteractive
[`credential.msauthUseBroker`]: #credentialmsauthusebroker-experimental
[`credential.plaintextStorePath`]: #credentialplaintextstorepath
[credential cache]: https://git-scm.com/docs/git-credential-cache
[credential stores]: credstores.md
[default values]: enterprise-config.md
[environment variables]: environment.md
[freedesktop.org Secret Service API]: https://specifications.freedesktop.org/secret-service/
[credential-cache]: https://git-scm.com/docs/git-credential-cache
[cred-stores]: credstores.md
[enterprise-conf]: enterprise-config.md
[envars]: environment.md
[freedesktop-ss]: https://specifications.freedesktop.org/secret-service/
[GCM_ALLOW_WINDOWSAUTH]: environment.md#GCM_ALLOW_WINDOWSAUTH
[GCM_AUTHORITY]: environment.md#GCM_AUTHORITY-deprecated
[GCM_AUTODETECT_TIMEOUT]: environment.md#GCM_AUTODETECT_TIMEOUT
Expand All @@ -561,12 +561,12 @@ git config --global credential.azreposCredentialType oauth
[GCM_NAMESPACE]: environment.md#GCM_NAMESPACE
[GCM_PLAINTEXT_STORE_PATH]: environment.md#GCM_PLAINTEXT_STORE_PATH
[GCM_PROVIDER]: environment.md#GCM_PROVIDER
[Git Credential Manager]: usage.md
[usage]: usage.md
[git-config-http-proxy]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpproxy
[HTTP Proxy]: netconfig.md#http-proxy
[learn more]: autodetect.md
[http-proxy]: netconfig.md#http-proxy
[autodetect]: autodetect.md
[libsecret]: https://wiki.gnome.org/Projects/Libsecret
[migration guide]: migration.md#gcm_authority
[options]: https://git-scm.com/docs/git-credential-cache#_options
[`pass` utility]: https://www.passwordstore.org/
[Windows Broker]: windows-broker.md
[provider-migrate]: migration.md#gcm_authority
[cache-options]: https://git-scm.com/docs/git-credential-cache#_options
[pass]: https://www.passwordstore.org/
[wam]: windows-broker.md

0 comments on commit 60a179f

Please sign in to comment.