Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6676986
x509: add utils to find certs by thumbprint
mjcheetham Aug 7, 2023
b627044
msauth: rename GetTokenAsync to GetTokenForUserAsync
mjcheetham Aug 3, 2023
89b099e
msauth: abstract token cache init helpers
mjcheetham Aug 8, 2023
6a90c36
msauth: add support for service principal auth
mjcheetham Aug 7, 2023
bfa87db
msauth: add support for managed identity
mjcheetham Aug 7, 2023
f00c859
msauth: add MSAL app token cache support for CCAs
mjcheetham Aug 8, 2023
aafbda4
azrepos: support service principals and managed IDs
mjcheetham Aug 7, 2023
eff4ea6
azrepos: add tests of MID and SP get credential
mjcheetham Aug 15, 2023
0704b42
release.yml: use correct target_commitish arg
mjcheetham Aug 16, 2023
a74fe18
release.yml: use correct target_commitish arg (#1381)
mjcheetham Aug 16, 2023
488aa48
Support managed identities and service principals (#1372)
mjcheetham Aug 16, 2023
527c41b
Use Avalonia 11.0.3
de1acr0ix Aug 17, 2023
cd0a34c
Update to Avalonia 11.0.4
de1acr0ix Aug 19, 2023
3fb216d
release: update homebrew deployment
ldennington Aug 19, 2023
e076f58
release: update homebrew deployment (#1386)
ldennington Aug 21, 2023
9902e8f
dependencies: update to Avalonia 11.0.4 (#1383)
ldennington Aug 28, 2023
b501b8b
github: support gist remote URLs for GitHub
mjcheetham Sep 5, 2023
afcb6b8
Support gist remote URLs for GitHub (#1402)
mjcheetham Sep 6, 2023
3774413
bitbucket: drop WPF-based UI helper for Bitbucket
mjcheetham Sep 11, 2023
7828213
github: drop WPF-based UI helper for GitHub
mjcheetham Sep 11, 2023
63133c9
gitlab: drop WPF-based UI helper for GitLab
mjcheetham Sep 11, 2023
11b5d50
gcm-ui: drop WPF-based UI helper for shared UI
mjcheetham Sep 11, 2023
8a098a4
wpf: drop shared WPF library
mjcheetham Sep 11, 2023
5c50a73
Support linux install path from src
m4ss1m0g Sep 12, 2023
53e2b48
install from source: custom install location edits
ldennington Sep 18, 2023
03a23a1
docs: update dev.azure.com product page URLs
mjcheetham Sep 18, 2023
e66805c
Merge pull request #1 from ldennington/install-from-source-suggestions
m4ss1m0g Sep 19, 2023
fde8bbd
Update dev.azure.com product page URLs (#1416)
mjcheetham Sep 19, 2023
c99ef6d
build(deps): bump DavidAnson/markdownlint-cli2-action
dependabot[bot] Sep 19, 2023
01ce22b
build(deps): bump DavidAnson/markdownlint-cli2-action from 11.0.0 to …
mjcheetham Sep 19, 2023
8f925d3
build(deps): bump actions/checkout from 3 to 4
dependabot[bot] Sep 19, 2023
6fbc243
build(deps): bump actions/checkout from 3 to 4 (#1397)
mjcheetham Sep 19, 2023
1e904d1
msauth: replace WPF progress window with Avalonia
mjcheetham Sep 11, 2023
24c1883
build(deps): bump DavidAnson/markdownlint-cli2-action
dependabot[bot] Sep 20, 2023
6e49d9e
build(deps): bump DavidAnson/markdownlint-cli2-action from 12.0.0 to …
ldennington Sep 21, 2023
ac0b264
Drop WPF-based UI helpers on Windows (#1417)
mjcheetham Sep 21, 2023
3b6b07d
install from source: refactor install location
ldennington Sep 25, 2023
720d347
install from source: correct path addition
ldennington Sep 25, 2023
e1064f3
avalonia: remove workaround for devtools and app lifetime
mjcheetham Sep 26, 2023
54f6b46
Merge pull request #2 from ldennington/linux-install-fixes
m4ss1m0g Oct 2, 2023
f4f3689
recognise GitLab hosts by WWW-Authenticate header
hickford Oct 3, 2023
531d7ed
release: change dotnet to .NET and loosen version requirements
ldennington Oct 6, 2023
5562307
release: add permissions and prereqs
ldennington Oct 6, 2023
27d7636
release: update Linux to use GPG signing
ldennington Oct 7, 2023
16e628a
release: update macOS signing
ldennington Oct 12, 2023
4d3a8f1
release: update Windows to use Azure Code Signing
ldennington Oct 10, 2023
961a213
release: update .NET tool azure connection/variables
ldennington Oct 7, 2023
8f93d56
release: validate linux signatures
ldennington Oct 16, 2023
d0ae441
recognise GitLab hosts by WWW-Authenticate header (#1428)
ldennington Oct 18, 2023
12ab89b
recognise BitBucket hosts by WWW-Authenticate header
hickford Oct 19, 2023
ba2dcec
recognise BitBucket hosts by WWW-Authenticate header (#1441)
mjcheetham Oct 19, 2023
62eb6ab
Support linux install path from src (#1409)
ldennington Oct 19, 2023
c512d1b
use universal Gitea OAuth configuration
hickford Oct 19, 2023
46810df
avalonia: introduce flag to switch to SW rendering
mjcheetham Sep 28, 2023
2fd111b
release: update Linux, macOS, and Windows signing (#1431)
ldennington Oct 21, 2023
ee35d7b
default OAuth redirect URI to http://127.0.0.1
hickford Oct 20, 2023
66292a9
Apply suggestions from code review
hickford Oct 23, 2023
6e06153
use universal Gitea OAuth configuration (#1442)
mjcheetham Oct 24, 2023
e549586
default OAuth redirect URI to http://127.0.0.1 (#1444)
mjcheetham Oct 24, 2023
3183801
settings: default SW rendering on Windows+ARM
mjcheetham Oct 23, 2023
81211fb
platformutils: drop unnecessary netfx #ifdefs
mjcheetham Oct 25, 2023
b30eab3
Add software rendering flag for Windows (#1445)
mjcheetham Oct 25, 2023
59f01d9
platformutils: drop unnecessary netfx #ifdefs (#1447)
mjcheetham Oct 25, 2023
d928878
avalonia: actually setup Avalonia before starting
mjcheetham Oct 30, 2023
97a217d
avalonia: actually setup Avalonia before starting (#1453)
mjcheetham Oct 30, 2023
3a60ecf
version: bump to 2.4.0
mjcheetham Nov 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
azrepos: support service principals and managed IDs
Allow a service principal or managed identity to be used to
authenticate against Azure Repos. Required information for
service principals is specified in Git config or environment
variables, as is the ID for a managed identity.
  • Loading branch information
mjcheetham committed Aug 15, 2023
commit aafbda4a1c1680a0a93d73e5f2f44470d698a6b8
99 changes: 99 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,95 @@ git config --global credential.azreposCredentialType oauth

---

### credential.azreposManagedIdentity

Use a [Managed Identity][managed-identity] to authenticate with Azure Repos.

The value `system` will tell GCM to use the system-assigned Managed Identity.

To specify a user-assigned Managed Identity, use the format `id://{clientId}`
where `{clientId}` is the client ID of the Managed Identity. Alternatively any
GUID-like value will also be interpreted as a user-assigned Managed Identity
client ID.

To specify a Managed Identity associated with an Azure resource, you can use the
format `resource://{resourceId}` where `{resourceId}` is the ID of the resource.

For more information about managed identities, see the Azure DevOps
[documentation][azrepos-sp-mid].

Value|Description
-|-
`system`|System-Assigned Managed Identity
`[guid]`|User-Assigned Managed Identity with the specified client ID
`id://[guid]`|User-Assigned Managed Identity with the specified client ID
`resource://[guid]`|User-Assigned Managed Identity for the associated resource

```shell
git config --global credential.azreposManagedIdentity "id://11111111-1111-1111-1111-111111111111"
```

**Also see: [GCM_AZREPOS_MANAGEDIDENTITY][gcm-azrepos-credentialmanagedidentity]**

---

### credential.azreposServicePrincipal

Specify the client and tenant IDs of a [service principal][service-principal]
to use when performing Microsoft authentication for Azure Repos.

The value of this setting should be in the format: `{tenantId}/{clientId}`.

You must also set at least one authentication mechanism if you set this value:

- [credential.azreposServicePrincipalSecret][credential-azrepos-sp-secret]
- [credential.azreposServicePrincipalCertificateThumbprint][credential-azrepos-sp-cert-thumbprint]

For more information about service principals, see the Azure DevOps
[documentation][azrepos-sp-mid].

#### Example

```shell
git config --global credential.azreposServicePrincipal "11111111-1111-1111-1111-111111111111/22222222-2222-2222-2222-222222222222"
```

**Also see: [GCM_AZREPOS_SERVICE_PRINCIPAL][gcm-azrepos-service-principal]**

---

### credential.azreposServicePrincipalSecret

Specifies the client secret for the [service principal][service-principal] when
performing Microsoft authentication for Azure Repos with
[credential.azreposServicePrincipalSecret][credential-azrepos-sp] set.

#### Example

```shell
git config --global credential.azreposServicePrincipalSecret "da39a3ee5e6b4b0d3255bfef95601890afd80709"
```

**Also see: [GCM_AZREPOS_SP_SECRET][gcm-azrepos-sp-secret]**

---

### credential.azreposServicePrincipalCertificateThumbprint

Specifies the thumbprint of a certificate to use when authenticating as a
[service principal][service-principal] for Azure Repos when
[GCM_AZREPOS_SERVICE_PRINCIPAL][credential-azrepos-sp] is set.

#### Example

```shell
git config --global credential.azreposServicePrincipalCertificateThumbprint "9b6555292e4ea21cbc2ebd23e66e2f91ebbe92dc"
```

**Also see: [GCM_AZREPOS_SP_CERT_THUMBPRINT][gcm-azrepos-sp-cert-thumbprint]**

---

### trace2.normalTarget

Turns on Trace2 Normal Format tracing - see [Git's Trace2 Normal Format
Expand Down Expand Up @@ -878,6 +967,7 @@ Defaults to disabled.
[gcm-authority]: environment.md#GCM_AUTHORITY-deprecated
[gcm-autodetect-timeout]: environment.md#GCM_AUTODETECT_TIMEOUT
[gcm-azrepos-credentialtype]: environment.md#GCM_AZREPOS_CREDENTIALTYPE
[gcm-azrepos-credentialmanagedidentity]: environment.md#GCM_AZREPOS_MANAGEDIDENTITY
[gcm-bitbucket-always-refresh-credentials]: environment.md#GCM_BITBUCKET_ALWAYS_REFRESH_CREDENTIALS
[gcm-bitbucket-authmodes]: environment.md#GCM_BITBUCKET_AUTHMODES
[gcm-credential-cache-options]: environment.md#GCM_CREDENTIAL_CACHE_OPTIONS
Expand Down Expand Up @@ -905,6 +995,7 @@ Defaults to disabled.
[http-proxy]: netconfig.md#http-proxy
[autodetect]: autodetect.md
[libsecret]: https://wiki.gnome.org/Projects/Libsecret
[managed-identity]: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
[provider-migrate]: migration.md#gcm_authority
[cache-options]: https://git-scm.com/docs/git-credential-cache#_options
[pass]: https://www.passwordstore.org/
Expand All @@ -915,3 +1006,11 @@ Defaults to disabled.
[trace2-performance-docs]: https://git-scm.com/docs/api-trace2#_the_performance_format_target
[trace2-performance-env]: environment.md#GIT_TRACE2_PERF
[wam]: windows-broker.md
[service-principal]: https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals
[azrepos-sp-mid]: https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity
[credential-azrepos-sp]: #credentialazreposserviceprincipal
[credential-azrepos-sp-secret]: #credentialazreposserviceprincipalsecret
[credential-azrepos-sp-cert-thumbprint]: #credentialazreposserviceprincipalcertificatethumbprint
[gcm-azrepos-service-principal]: environment.md#GCM_AZREPOS_SERVICE_PRINCIPAL
[gcm-azrepos-sp-secret]: environment.md#GCM_AZREPOS_SP_SECRET
[gcm-azrepos-sp-cert-thumbprint]: environment.md#GCM_AZREPOS_SP_CERT_THUMBPRINT
127 changes: 126 additions & 1 deletion docs/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,121 @@ export GCM_AZREPOS_CREDENTIALTYPE="oauth"

---

### GCM_AZREPOS_MANAGEDIDENTITY

Use a [Managed Identity][managed-identity] to authenticate with Azure Repos.

The value `system` will tell GCM to use the system-assigned Managed Identity.

To specify a user-assigned Managed Identity, use the format `id://{clientId}`
where `{clientId}` is the client ID of the Managed Identity. Alternatively any
GUID-like value will also be interpreted as a user-assigned Managed Identity
client ID.

To specify a Managed Identity associated with an Azure resource, you can use the
format `resource://{resourceId}` where `{resourceId}` is the ID of the resource.

For more information about managed identities, see the Azure DevOps
[documentation][azrepos-sp-mid].

Value|Description
-|-
`system`|System-Assigned Managed Identity
`[guid]`|User-Assigned Managed Identity with the specified client ID
`id://[guid]`|User-Assigned Managed Identity with the specified client ID
`resource://[guid]`|User-Assigned Managed Identity for the associated resource

#### Windows

```batch
SET GCM_AZREPOS_MANAGEDIDENTITY="id://11111111-1111-1111-1111-111111111111"
```

#### macOS/Linux

```bash
export GCM_AZREPOS_MANAGEDIDENTITY="id://11111111-1111-1111-1111-111111111111"
```

**Also see: [credential.azreposManagedIdentity][credential-azrepos-managedidentity]**

---

### GCM_AZREPOS_SERVICE_PRINCIPAL

Specify the client and tenant IDs of a [service principal][service-principal]
to use when performing Microsoft authentication for Azure Repos.

The value of this setting should be in the format: `{tenantId}/{clientId}`.

You must also set at least one authentication mechanism if you set this value:

- [GCM_AZREPOS_SP_SECRET][gcm-azrepos-sp-secret]
- [GCM_AZREPOS_SP_CERT_THUMBPRINT][gcm-azrepos-sp-cert-thumbprint]

For more information about service principals, see the Azure DevOps
[documentation][azrepos-sp-mid].

#### Windows

```batch
SET GCM_AZREPOS_SERVICE_PRINCIPAL="11111111-1111-1111-1111-111111111111/22222222-2222-2222-2222-222222222222"
```

#### macOS/Linux

```bash
export GCM_AZREPOS_SERVICE_PRINCIPAL="11111111-1111-1111-1111-111111111111/22222222-2222-2222-2222-222222222222"
```

**Also see: [credential.azreposServicePrincipal][credential-azrepos-sp]**

---

### GCM_AZREPOS_SP_SECRET

Specifies the client secret for the [service principal][service-principal] when
performing Microsoft authentication for Azure Repos with
[GCM_AZREPOS_SERVICE_PRINCIPAL][gcm-azrepos-sp] set.

#### Windows

```batch
SET GCM_AZREPOS_SP_SECRET="da39a3ee5e6b4b0d3255bfef95601890afd80709"
```

#### macOS/Linux

```bash
export GCM_AZREPOS_SP_SECRET="da39a3ee5e6b4b0d3255bfef95601890afd80709"
```

**Also see: [credential.azreposServicePrincipalSecret][credential-azrepos-sp-secret]**

---

### GCM_AZREPOS_SP_CERT_THUMBPRINT

Specifies the thumbprint of a certificate to use when authenticating as a
[service principal][service-principal] for Azure Repos when
[GCM_AZREPOS_SERVICE_PRINCIPAL][gcm-azrepos-sp] is set.

#### Windows

```batch
SET GCM_AZREPOS_SP_CERT_THUMBPRINT="9b6555292e4ea21cbc2ebd23e66e2f91ebbe92dc"
```

#### macOS/Linux

```bash
export GCM_AZREPOS_SP_CERT_THUMBPRINT="9b6555292e4ea21cbc2ebd23e66e2f91ebbe92dc"
```

**Also see: [credential.azreposServicePrincipalCertificateThumbprint][credential-azrepos-sp-cert-thumbprint]**

---

### GIT_TRACE2

Turns on Trace2 Normal Format tracing - see [Git's Trace2 Normal Format
Expand Down Expand Up @@ -985,7 +1100,8 @@ Defaults to disabled.
[credential-allowwindowsauth]: environment.md#credentialallowWindowsAuth
[credential-authority]: configuration.md#credentialauthority-deprecated
[credential-autodetecttimeout]: configuration.md#credentialautodetecttimeout
[credential-azrepos-credential-type]: configuration.md#azreposcredentialtype
[credential-azrepos-credential-type]: configuration.md#credentialazreposcredentialtype
[credential-azrepos-managedidentity]: configuration.md#credentialazreposmanagedidentity
[credential-bitbucketauthmodes]: configuration.md#credentialbitbucketAuthModes
[credential-cacheoptions]: configuration.md#credentialcacheoptions
[credential-credentialstore]: configuration.md#credentialcredentialstore
Expand Down Expand Up @@ -1022,6 +1138,7 @@ Defaults to disabled.
[github-emu]: https://docs.github.com/en/enterprise-cloud@latest/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users
[network-http-proxy]: netconfig.md#http-proxy
[libsecret]: https://wiki.gnome.org/Projects/Libsecret
[managed-identity]: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
[migration-guide]: migration.md#gcm_authority
[passwordstore]: https://www.passwordstore.org/
[trace2-normal-docs]: https://git-scm.com/docs/api-trace2#_the_normal_format_target
Expand All @@ -1031,3 +1148,11 @@ Defaults to disabled.
[trace2-performance-docs]: https://git-scm.com/docs/api-trace2#_the_performance_format_target
[trace2-performance-config]: configuration.md#trace2perfTarget
[windows-broker]: windows-broker.md
[service-principal]: https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals
[azrepos-sp-mid]: https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity
[gcm-azrepos-sp]: #gcm_azrepos_service_principal
[gcm-azrepos-sp-secret]: #gcm_azrepos_sp_secret
[gcm-azrepos-sp-cert-thumbprint]: #gcm_azrepos_sp_cert_thumbprint
[credential-azrepos-sp]: configuration.md#credentialazreposserviceprincipal
[credential-azrepos-sp-secret]: configuration.md#credentialazreposserviceprincipalsecret
[credential-azrepos-sp-cert-thumbprint]: configuration.md#credentialazreposserviceprincipalcertificatethumbprint
11 changes: 10 additions & 1 deletion src/shared/Microsoft.AzureRepos/AzureDevOpsConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ internal static class AzureDevOpsConstants
public const string AadAuthorityBaseUrl = "https://login.microsoftonline.com";

// Azure DevOps's app ID + default scopes
public static readonly string[] AzureDevOpsDefaultScopes = {"499b84ac-1321-427f-aa17-267ca6975798/.default"};
public const string AzureDevOpsResourceId = "499b84ac-1321-427f-aa17-267ca6975798";
public static readonly string[] AzureDevOpsDefaultScopes = {$"{AzureDevOpsResourceId}/.default"};

// Visual Studio's client ID
// We share this to be able to consume existing access tokens from the VS caches
Expand Down Expand Up @@ -40,6 +41,10 @@ public static class EnvironmentVariables
public const string DevAadRedirectUri = "GCM_DEV_AZREPOS_REDIRECTURI";
public const string DevAadAuthorityBaseUri = "GCM_DEV_AZREPOS_AUTHORITYBASEURI";
public const string CredentialType = "GCM_AZREPOS_CREDENTIALTYPE";
public const string ServicePrincipalId = "GCM_AZREPOS_SERVICE_PRINCIPAL";
public const string ServicePrincipalSecret = "GCM_AZREPOS_SP_SECRET";
public const string ServicePrincipalCertificateThumbprint = "GCM_AZREPOS_SP_CERT_THUMBPRINT";
public const string ManagedIdentity = "GCM_AZREPOS_MANAGEDIDENTITY";
}

public static class GitConfiguration
Expand All @@ -51,6 +56,10 @@ public static class Credential
public const string DevAadAuthorityBaseUri = "azreposDevAuthorityBaseUri";
public const string CredentialType = "azreposCredentialType";
public const string AzureAuthority = "azureAuthority";
public const string ServicePrincipal = "azreposServicePrincipal";
public const string ServicePrincipalSecret = "azreposServicePrincipalSecret";
public const string ServicePrincipalCertificateThumbprint = "azreposServicePrincipalCertificateThumbprint";
public const string ManagedIdentity = "azreposManagedIdentity";
}
}
}
Expand Down
Loading