Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Resolves and falls back through per-host tokens for git, GitHub, and Azure DevOps authentication, and classifies auth failures.
68% 95%+27 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 15 of 22 without it.
3 of 3 safety checks passed
134 agent runs
5 forksA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
Auth expert persona
src/apm_cli/core/auth.py or src/apm_cli/core/token_manager.pyGITHUB_APM_PAT, GITHUB_TOKEN, GH_TOKEN, ADO_APM_PATgit ls-remote, git clone, or GitHub/ADO API callsgithub_downloader.py auth pathsAll auth flows MUST go through AuthResolver. No direct os.getenv() for token variables in application code.
The full per-org -> global -> credential-fill -> fallback resolution flow is in docs/src/content/docs/getting-started/authentication.md (mermaid flowchart). Treat it as the single source of truth; if behavior diverges, fix the diagram in the same PR.
Azure DevOps Services (dev.azure.com, *.visualstudio.com) use this chain:
ADO_APM_PAT env var if setaz account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 if az is installed and az account show succeedsgit credential fill (org/project/_git/repo, sent as Basic username:password, cached per repository) after an auth failure classified by classify_auth_outcome (src/apm_cli/core/auth_outcome.py): HTTP 401/403, a redirect to the ADO sign-in service, an HTML sign-in page, or a Git auth errorAdoAuthChainExhaustedError (with its AuthAttemptLog) from try_with_fallback, or build_error_context on resolve-time failuresAuthResolver.try_with_fallback is the only chain entry; the chain lives in src/apm_cli/core/auth_chain.py. Call sites raise AuthAttemptFailed with the raw response or process result and never classify auth failures themselves (guard transport-platform-auth-outcome-owner). ADO HTTP requests pass auth=AttemptAuth(git_env) or allow_netrc=False so only the chain-selected credential is sent. Only auth_chain.report_helper_outcome reports a helper credential back to Git: approve after success, reject only after AuthOutcome.is_verified_rejection (status-anchored HTTP 401, never with a 403/not-found signal) and never for a secret the resolver's helper cache already saw approved on that host (no secret is hashed or copied for this), once per (host, port, path) and action per process, never for PAT, bearer, or gh tokens (guard transport-platform-credential-report-owner). Fill, approve, and reject run with GCM_INTERACTIVE=0 when stdin is not a TTY or CI is set.
Azure DevOps Server hosts (ADO_HOST / APM_ADO_HOSTS) skip az bearer: PAT, then fill.
ADO_APM_PAT is the env var name used by the auth flow. The AAD bearer source constant lives in src/apm_cli/core/token_manager.py as GitHubTokenManager.ADO_BEARER_SOURCE = "AAD_BEARER_AZ_CLI".
Stale-PAT fallback: on HTTP 401/403 or a recognized Git authentication failure, APM tries an available az bearer. A successful bearer retry emits:
[!] ADO_APM_PAT was rejected for {host}; fell back to az cli bearer.
Next to this one in the catalogue, plus more from the same author.