artifacts-keyring-nofuss
Copilot instructions6 starsChanged 9 months agoMITView on GitHub
Versioning is dynamic via setuptools-scm from git tags. This is a keyring backend plugin (~435 lines) that authenticates pip/twine against Azure DevOps Artifacts feeds using pure Python — no .NET, no MSAL. Authentication flow (_backend.py → _provider.py → _session_token.py): Provider chain (_provider.py): - Providers implement the TokenProvider Protocol (structural subtyping — no base class inheritance) - run_chain() tries each provider in order, catches all exceptions, and returns the first successful token - Default chain: ["azure_cli", "azure_identity"] — overridable via ARTIFACTS_KEYRING_NOFUSS_PROVIDER…
- Installs packages
The file
We split this copilot-instructions.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Default chain: ["azure_cli", "azure_identity"] — overridable via ARTIFACTS_KEYRING_NOFUSS_PROVIDER env var or keyringrc.cfg
- Very specific: line 37
Read-only: set_password() and delete_password() raise NotImplementedError
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions
Build & Lint
pip install -e ".[dev]" # editable install with dev tools
pre-commit install # one-time git hook setup
pre-commit run --all-files # run all hooks manually
ruff check src/ # lint only
ruff format src/ # format only
mypy src/ # type-check (strict mode)Versioning is dynamic via setuptools-scm from git tags.
Architecture
This is a keyring backend plugin (~435 lines) that authenticates pip/twine against Azure DevOps Artifacts feeds using pure Python — no .NET, no MSAL.
Authentication flow (_backend.py → _provider.py → _session_token.py):
- Validate the service URL against
SUPPORTED_NETLOCSin_constants.py - Discover the Azure AD tenant by making an unauthenticated GET to the feed URL and parsing the
WWW-Authenticateheader - Get a bearer token by running the provider chain (Azure CLI → Managed Identity)
- Exchange the bearer token for a scoped Azure DevOps session token (
vso.packaging, read-only) - Cache and return the session token as Basic auth credentials
Provider chain (_provider.py):
- Providers implement the
TokenProviderProtocol (structural subtyping — no base class inheritance) run_chain()tries each provider in order, catches all exceptions, and returns the first successful token- Default chain:
["azure_cli", "azure_identity"]— overridable viaARTIFACTS_KEYRING_NOFUSS_PROVIDERenv var orkeyringrc.cfg - New providers: add the implementation in a
_<name>.pymodule, then register it in thePROVIDERSdict andDEFAULT_CHAINlist in_backend.py
Keyring integration:
ArtifactsKeyringBackendextendskeyring.backend.KeyringBackendwith priority 9.9- Registered via the
[project.entry-points."keyring.backends"]inpyproject.toml - Read-only:
set_password()anddelete_password()raiseNotImplementedError
Key Conventions
- Graceful degradation: provider failures are caught, logged, and the chain continues to the next provider. Never raise from a provider.
- Debug logging: controlled by
ARTIFACTS_KEYRING_NOFUSS_DEBUG=1env var. Log to stderr via the package-level logger in__init__.py. - All modules except
__init__.pyare prefixed with_(private).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

