auth
БесплатноБез исполняемых скриптовНе проверенActivate when code touches token management, credential resolution, git auth flows, GITHUB_APM_PAT, ADO_APM_PAT, AuthResolver, HostInfo, AuthContext, or any…
от microsoft★ 4 492 звезды на GitHubОб этом скилле
Auth Skill
When to activate
- Any change to
src/apm_cli/core/auth.pyorsrc/apm_cli/core/token_manager.py - Code that reads
GITHUB_APM_PAT,GITHUB_TOKEN,GH_TOKEN,ADO_APM_PAT - Code using
git ls-remote,git clone, or GitHub/ADO API calls - Error messages mentioning tokens, authentication, or credentials
- Changes to
github_downloader.pyauth paths - Per-host or per-org token resolution logic
Key rule
All auth flows MUST go through AuthResolver. No direct os.getenv() for token variables in application code.
Canonical reference
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.
Bearer-token authentication for ADO
Azure DevOps Services (dev.azure.com, *.visualstudio.com) use this chain:
ADO_APM_PATenv var if set- AAD bearer via
az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798ifazis installed andaz account showsucceeds - Operation-time path-scoped
git credential fill(org/project/_git/repo, sent as Basicusername:password, cached per repository) after an auth failure classified byclassify_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 error - Otherwise:
AdoAuthChainExhaustedError(with itsAuthAttemptLog) fromtry_with_fallback, orbuild_error_contexton resolve-time failures
AuthResolver.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.
[!] 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_PAT
Diagnostic cases (build_error_context in src/apm_cli/core/auth.py, AdoAuthChainExhaustedError in src/apm_cli/core/auth_chain.py):
Initial PAT/bearer diagnostics do not describe the later helper retry.
- No PAT, no
az:Azure DevOps requires authentication. You have two options-> installazandaz login, or setADO_APM_PAT. - No PAT,
aznot signed in: same two-options copy withaz loginfirst. - No PAT, wrong tenant:
Your az cli session (tenant: ...) returned a bearer token, but Azure DevOps rejected it (HTTP 401).->az login --tenant <correct-tenant>, or setADO_APM_PAT. - PAT set, request failed:
ADO_APM_PAT is set, but the Azure DevOps request failed.-> rotate the PAT,az loginon Services, or store a GCM credential. - Helper empty or rejected:
AdoAuthChainExhaustedErrorlists every chain step in order with its outcome (Azure DevOps authentication failed. Tried in order: ...) -> refresh PAT,az loginon Services, or store a repository credential in GCM. DNS, TLS, timeout, and not-found failures re-raise without unlocking fill or becoming auth exhaustion. - Server, no PAT:
Azure DevOps Server requires ADO_APM_PAT or a Git credential helper.-> setADO_APM_PATor store a GCM credential (azdoes not apply). azinstalled but token acquisition failed:Azure CLI is installed but could not get a token for Azure DevOps: <az reason>(reason such asAADSTS50076from the provider'slast_error; tenant lookup cached). Case 3 renders only
Установить auth в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл auth?
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.
Как установить скилл auth?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл auth запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic