Activate when code touches token management, credential resolution, git auth flows, GITHUB_APM_PAT, ADO_APM_PAT, AuthResolver, HostInfo, AuthContext, or any remote host authentication -- even if 'auth' isn't mentioned explicitly.
60
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.apm/skills/auth/SKILL.mdsrc/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 after HTTP 401/403 or a recognized Git authentication failure (is_ado_auth_failure_signal)AdoAuthChainExhaustedError from try_with_fallback, or build_error_context on resolve-time failuresAzure 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.
[!] Consider unsetting the stale variable.Verbose source line (one per host, emitted under --verbose):
[i] dev.azure.com -- using bearer from az cli (source: AAD_BEARER_AZ_CLI)
[i] dev.azure.com -- token from ADO_APM_PATDiagnostic cases (build_error_context + AdoAuthChainExhaustedError in src/apm_cli/core/auth.py):
Initial PAT/bearer diagnostics do not describe the later helper retry.
az: Azure DevOps requires authentication. You have two options -> install az and az login, or set ADO_APM_PAT.az not signed in: same two-options copy with az login first.Your az cli session (tenant: ...) returned a bearer token, but Azure DevOps rejected it (HTTP 401). -> az login --tenant <correct-tenant>, or set ADO_APM_PAT.ADO_APM_PAT is set, but the Azure DevOps request failed. -> rotate the PAT, az login on Services, or store a GCM credential.AdoAuthChainExhaustedError names only attempted steps -> refresh PAT, az login on Services, or store a repository credential in GCM. DNS, TLS, and timeout failures re-raise without unlocking fill or becoming auth exhaustion.Azure DevOps Server requires ADO_APM_PAT or a Git credential helper. -> set ADO_APM_PAT or store a GCM credential (az does not apply).microsoft/apm
0495ced
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.