Add Azure Workload Identity Federation auth for Azure DevOps#996
Add Azure Workload Identity Federation auth for Azure DevOps#996namnt2307 wants to merge 1 commit into
Conversation
Add a secretless auth mode for Azure DevOps repos using Azure Workload Identity Federation. The pod's projected ServiceAccount token is exchanged with Microsoft Entra ID for an access token, which is stored as the git credential. Enabled with --azure-workload-identity; client ID, tenant ID, token file, authority host, and scope are configurable via flags, each falling back to the AZURE_* env vars injected by the azure-workload-identity webhook. Mirrors the existing GitHub App auth mode.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: namnt2307 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @namnt2307! |
What
Adds a secretless authentication mode for Azure DevOps Services repos using Azure Workload Identity Federation. When
--azure-workload-identityis set, git-sync exchanges the pod's projected ServiceAccount token with Microsoft Entra ID for a short-lived access token and uses it as the git credential — no PAT, SSH key, or long-lived secret is stored. Mirrors the existing GitHub App auth mode.Why
Implements the request in #955: environments whose policies forbid PATs currently can't use git-sync with Azure DevOps even when the workload identity already has repo access.
Config
New flags (each with
GITSYNC_*andAZURE_*env fallbacks):--azure-workload-identity— opt in--azure-client-id/--azure-tenant-id/--azure-federated-token-file/--azure-authority-host— default to theAZURE_*vars injected by the azure-workload-identity webhook; overridable as flags--azure-scope— defaults to the Azure DevOps resource IDDocs in
docs/azure-workload-identity.md; flags documented inREADME.md.Testing
httptestfake — no real Azure required, per the maintainer note in Feature Request: Support Azure DevOps Git Repos via Managed Identity (WIF) Authentication #955.Ref #955