Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

auth

/auth

Pomaga przy kodzie dotykającym zarządzania tokenami, rozwiązywania poświadczeń, przepływów uwierzytelniania git (GITHUB_APM_PAT, ADO_APM_PAT), AuthResolver i uwierzytelniania na zdalnych hostach.

Repozytorium
apm ↗
Licencja
MIT
Ostatnia zmiana repozytorium
23.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 23.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga przy kodzie dotykającym zarządzania tokenami, rozwiązywania poświadczeń, przepływów uwierzytelniania git (GITHUB_APM_PAT, ADO_APM_PAT), AuthResolver i uwierzytelniania na zdalnych hostach.

Wyzwalacze z opisu

auth
Oryginalny opis (EN)

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.

Jak działa

  1. When to activate
  2. Key rule
  3. Canonical reference
  4. Bearer-token authentication for ADO
Sekcje z nagłówków SKILL.md, w oryginale · 60 linii, 454 słów
Podgląd SKILL.md
---
name: auth
description: >
  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 Skill

[Auth expert persona](../../agents/auth-expert.agent.md)

## When to activate

- Any change to `src/apm_cli/core/auth.py` or `src/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.py` auth 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`](../../../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:

1. `ADO_APM_PAT` env var if set
2. AAD bearer via `az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798` if `az` is installed and `az account show` succeeds
3. Operation-time path-scoped `git credential fill` after HTTP 401/403 or a recognized Git authentication failure (`is_ado_auth_failure_signal`)
4. Otherwise: `AdoAuthChainExhaustedError` from `try_with_fallback`, or `build_error_context` on resolve-time failures

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` + `AdoAuthChainExhaustedError` in `src/apm_cli/core/auth.py`):

Initial PAT/bearer diagnostics do not describe the later helper retry.

1. No PAT, no `az`: `Azure DevOps requires authentication. You have two options` -> install `az` and `az login`, or set `ADO_APM_PAT`.
2. No PAT, `az` not signed in: same two-options copy with `az login` first.
3. 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 set `ADO_APM_PAT`.
4. PAT set, request failed: `ADO_APM_PAT is set, but the Azure DevOps request failed.` -> rotate the PAT, `az login` on Services, or store a GCM credential.
5. Helper empty or rejected: `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.
6. Server, no PAT: `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).

Wersje

RepozytoriumWynikLicencja
Ta strona · microsoft/apm100MIT
mixpanel/mixpanel-headless100MIT
microsoft/apm100MIT
EpicenterHQ/epicenter100MIT
felipefontoura/bento100MIT
tomaspozo/agentlink100MIT
githubnext/apm100MIT
vercel/vercel-plugin95Apache-2.0
420company/artemis95MIT

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 28.10.2026 · wersja paczki e92971baeed2 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100authentication-patterns
    Dostarcza wzorce uwierzytelniania dla kluczy API, OAuth i zarządzania tokenami, przy wdrażaniu lub przeglądzie uwierzytelniania usług i obsługi poświadczeń.
  • 100auth-security
    Opisuje dobre praktyki bezpieczeństwa uwierzytelniania OAuth 2.1 i JWT przy implementacji logowania, autoryzacji API i zarządzania tokenami według RFC 9700.
  • 100better-auth-authentication
    Obsługuje przepływy uwierzytelniania Better Auth w aplikacjach TypeScript: logowanie e-mailem i hasłem, dostawcy społecznościowi, rejestracja, logowanie i weryfikacja.
  • 100auth-flow-validation
    Waliduje przepływ uwierzytelniania między frontendem a backendem: JWT, OAuth2, odświeżanie tokenów i synchronizację zarządzania sesją, w tym obsługę błędu 401.
  • 95neon-auth-react
    Konfiguruje Neon Auth w aplikacjach React (Vite, CRA): adaptery uwierzytelniania, klient auth i komponenty interfejsu, do samego uwierzytelniania bez bazy danych.
  • 100building-api-authentication
    Buduje bezpieczne systemy uwierzytelniania API z OAuth2, JWT, kluczami API i zarządzaniem sesjami.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.