Skip to content

Commit

Permalink
Merge pull request #339 from microsoft/master
Browse files Browse the repository at this point in the history
Cut new release
  • Loading branch information
mjcheetham committed May 6, 2021
2 parents 3fc6791 + 39efe03 commit 4123596
Show file tree
Hide file tree
Showing 25 changed files with 431 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/auth-problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Authentication failure
about: An authentication problem occurred when running a Git command.
title: ''
labels: 'auth-failure'
labels: 'auth-issue'
assignees: ''
---

Expand Down
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/experimental.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Experimental feature issues
about: A problem or issue occurred when using an experimental feature.
title: ''
labels: 'experimental'
assignees: ''
---

**Which version of GCM Core are you using?**

From a terminal, run `git-credential-manager-core version` and paste the output.

<!-- Ex:
Git Credential Manager version 2.0.8-beta+e1f8492d04 (macOS, .NET Core 4.6.27129.04)
-->

**Which Git host provider are you trying to connect to?**

* [ ] Azure DevOps
* [ ] Azure DevOps Server (TFS/on-prem)
* [ ] GitHub
* [ ] GitHub Enterprise
* [ ] Bitbucket
* [ ] Other - please describe

**Can you access the remote repository directly in the browser using the remote URL?**

From a terminal, run `git remote -v` to see your remote URL.

<!-- Ex:
origin https://dev.azure.com/contoso/_git/widgets
-->

* [ ] Yes
* [ ] No, I get a permission error
* [ ] No, for a different reason - please describe

---

**_[Azure DevOps only]_ What format is your remote URL?**

* [ ] Not applicable
* [ ] https://dev.azure.com/`{org}`/...
* [ ] https://`{org}`@dev.azure.com/`{org}`/...
* [ ] https://`{org}`.visualstudio.com/...

**_[Azure DevOps only]_ If the account picker shows more than one identity as you authenticate, check that you selected the same one that has access on the web.**

* [ ] Not applicable
* [ ] I only see one identity
* [ ] I checked each identity and none worked

---

**Expected behavior**

I am authenticated and my Git operation completes successfully.

**Actual behavior**

A clear and concise description of what happens. For example: exception is thrown, UI freezes, etc.

**Logs**

Set the environment variables `GCM_TRACE=1` and `GIT_TRACE=1` and re-run your Git command. Review and redact any private information and attach the log.
33 changes: 18 additions & 15 deletions .github/workflows/release-winget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Update winget repository
uses: mjcheetham/update-winget@v1.0
- id: update-winget
name: Update winget repository
uses: mjcheetham/update-winget@v1.2.1
with:
token: ${{ secrets.WINGET_TOKEN }}
repo: microsoft/winget-pkgs
id: Microsoft.GitCredentialManagerCore
token: ${{ secrets.WINGET_TOKEN }}
releaseAsset: gcmcore-win-x86-(.*)\.exe
manifestText: |
Id: {{id}}
Version: {{version}}
Name: Git Credential Manager Core
PackageIdentifier: {{id}}
PackageVersion: {{version}}
PackageName: Git Credential Manager Core
Publisher: Microsoft Corporation
AppMoniker: git-credential-manager-core
Homepage: https://aka.ms/gcmcore
Tags: "gcm, gcmcore, git, credential"
Moniker: git-credential-manager-core
PackageUrl: https://aka.ms/gcmcore
Tags: [ gcm, gcmcore, git, credential ]
License: Copyright (C) Microsoft Corporation
Description: Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
ShortDescription: Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
Installers:
- Arch: x86
Url: {{url}}
InstallerType: Inno
Sha256: {{sha256}}
- Architecture: x86
InstallerUrl: {{url}}
InstallerType: inno
InstallerSha256: {{sha256}}
PackageLocale: en-US
ManifestType: singleton
ManifestVersion: 1.0.0
alwaysUsePullRequest: true
7 changes: 6 additions & 1 deletion docs/azrepos-users-and-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ The Azure Repos host provider supports creating multiple types of credential:
- Azure DevOps personal access tokens
- Microsoft identity OAuth tokens (experimental)

To select which type of credential the Azure Repos host provider will create
and use, you can set the [`credential.azreposCredentialType`](https://github.com/microsoft/Git-Credential-Manager-Core/blob/master/docs/configuration.md#credentialazreposcredentialtype-experimental)
configuration entry (or [`GCM_AZREPOS_CREDENTIALTYPE`](https://github.com/microsoft/Git-Credential-Manager-Core/blob/master/docs/environment.md#GCM_AZREPOS_CREDENTIALTYPE-experimental)
environment variable).

### Azure DevOps personal access tokens

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](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page).
DevOps user settings page](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page) or [REST API](https://docs.microsoft.com/en-gb/rest/api/azure/devops/tokens/pats).

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
28 changes: 27 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ git config --global credential.plaintextStorePath /mnt/external-drive/credential

Specify which authentication flow should be used when performing Microsoft authentication and an interactive flow is required.

Defaults to the value `auto`.
Defaults to `auto`.

**Note:** If [`credential.msauthUseBroker`](#credentialmsauthusebroker) is set
to `true` and the operating system authentication broker is available, all flows
will be delegated to the broker. If both of those things are true, then the
value of `credential.msauthFlow` has no effect.

Value|Authentication Flow
-|-
Expand All @@ -275,6 +280,27 @@ git config --global credential.msauthFlow devicecode

---

### credential.msauthUseBroker

Use the operating system account manager where available.

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

Value|Description
-|-
`true`|Use the operating system account manager as an authentication broker.
`false` _(default)_|Do not use the broker.

#### Example

```shell
git config --global credential.msauthUseBroker true
```

**Also see: [GCM_MSAUTH_USEBROKER](environment.md#GCM_MSAUTH_USEBROKER)**

---

### 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](https://git-scm.com/docs/gitcredentials/#Documentation/gitcredentials.txt-useHttpPath), not GCM Core.)
Expand Down
5 changes: 3 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Start by cloning this repository:
git clone https://github.com/microsoft/Git-Credential-Manager-Core
```

You also need the latest version of the .NET SDK which can be downloaded and installed from [here](https://dotnet.microsoft.com/).

## Building

The `Git-Credential-Manager.sln` solution can be opened and built in Visual Studio, Visual Studio for Mac, Visual Studio Code, or JetBrains Rider.
Expand All @@ -31,8 +33,7 @@ To build from inside an IDE, make sure to select the `WindowsDebug` or `WindowsR
To build from the command line, run:

```powershell
msbuild /t:restore /p:Configuration=WindowsDebug
msbuild /p:Configuration=WindowsDebug
dotnet build -c WindowsDebug
```

You can find a copy of the installer .exe file in `out\windows\Installer.Windows\bin\Debug\net472`.
Expand Down
36 changes: 34 additions & 2 deletions docs/environment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Environment variables

[Git Credential Manager Core](usage.md) work out of the box for most users. Configuration options are available to customize or tweak behavior.
[Git Credential Manager Core](usage.md) works out of the box for most users. Configuration options are available to customize or tweak behavior.

Git Credential Manager Core (GCM Core) can be configured using environment variables. **Environment variables take precedence over [configuration](configuration.md) options.**

Expand Down Expand Up @@ -402,7 +402,12 @@ export GCM_PLAINTEXT_STORE_PATH=/mnt/external-drive/credentials

Specify which authentication flow should be used when performing Microsoft authentication and an interactive flow is required.

Defaults to the value `auto`.
Defaults to `auto`.

**Note:** If [`GCM_MSAUTH_USEBROKER`](#gcm_msauth_usebroker) is set to `true`
and the operating system authentication broker is available, all flows will be
delegated to the broker. If both of those things are true, then the value of
`GCM_MSAUTH_FLOW` has no effect.

Value|Authentication Flow
-|-
Expand All @@ -427,6 +432,33 @@ export GCM_MSAUTH_FLOW="devicecode"

---

### GCM_MSAUTH_USEBROKER

Use the operating system account manager where available.

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

Value|Description
-|-
`true`|Use the operating system account manager as an authentication broker.
`false` _(default)_|Do not use the broker.

##### Windows

```batch
SET GCM_MSAUTH_USEBROKER="true"
```

##### macOS/Linux

```bash
export GCM_MSAUTH_USEBROKER="false"
```

**Also see: [credential.msauthUseBroker](configuration.md#credentialmsauthusebroker)**

---

### GCM_AZREPOS_CREDENTIALTYPE _(experimental)_

Specify the type of credential the Azure Repos host provider should return.
Expand Down
5 changes: 3 additions & 2 deletions src/osx/Installer.Mac/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ fi
mkdir -p /usr/local/bin
/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager-core" /usr/local/bin/git-credential-manager-core

# Configure GCM for the current user
"$INSTALL_DESTINATION/git-credential-manager-core" configure
# Configure GCM for the current user (running as the current user to avoid root
# from taking ownership of ~/.gitconfig)
sudo -u ${USER} "$INSTALL_DESTINATION/git-credential-manager-core" configure

exit 0
4 changes: 2 additions & 2 deletions src/osx/Installer.Mac/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ then
exit $?
fi

# Unconfigure
# Unconfigure (as the current user)
echo "Unconfiguring credential helper..."
"$GCMBIN" unconfigure
sudo -u `/usr/bin/logname` "$GCMBIN" unconfigure

# Remove symlink
if [ -L /usr/local/bin/git-credential-manager-core ]
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Git-Credential-Manager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static class Program
public static void Main(string[] args)
{
string appPath = GetApplicationPath();
using (var context = new CommandContext())
using (var app = new Application(context, appPath))
using (var context = new CommandContext(appPath))
using (var app = new Application(context))
{
// Register all supported host providers at the normal priority.
// The generic provider should never win against a more specific one, so register it with low priority.
Expand Down
Loading

0 comments on commit 4123596

Please sign in to comment.