agentleFS
MicrosoftKnown publishermicrosoft/artifacts-keyring-nofuss/.github/copilot-instructions.md

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
  1. Very specific:

    Default chain: ["azure_cli", "azure_identity"] — overridable via ARTIFACTS_KEYRING_NOFUSS_PROVIDER env var or keyringrc.cfg

    line 31
  2. Very specific:

    Read-only: set_password() and delete_password() raise NotImplementedError

    line 37

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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):

  1. Validate the service URL against SUPPORTED_NETLOCS in _constants.py
  2. Discover the Azure AD tenant by making an unauthenticated GET to the feed URL and parsing the WWW-Authenticate header
  3. Get a bearer token by running the provider chain (Azure CLI → Managed Identity)
  4. Exchange the bearer token for a scoped Azure DevOps session token (vso.packaging, read-only)
  5. Cache and return the session token as Basic auth credentials

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 env var or keyringrc.cfg
  • New providers: add the implementation in a _<name>.py module, then register it in the PROVIDERS dict and DEFAULT_CHAIN list in _backend.py

Keyring integration:

  • ArtifactsKeyringBackend extends keyring.backend.KeyringBackend with priority 9.9
  • Registered via the [project.entry-points."keyring.backends"] in pyproject.toml
  • Read-only: set_password() and delete_password() raise NotImplementedError

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=1 env var. Log to stderr via the package-level logger in __init__.py.
  • All modules except __init__.py are prefixed with _ (private).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.