Skip to main content

A keyring backend that authenticates to Azure DevOps package feeds using browser-based OAuth2 with PKCE.

Project description

ado-keyring

A keyring backend in pure python that authenticates to Azure DevOps package feeds using browser-based OAuth2 with PKCE.

Once installed, keyring automatically discovers ado-keyring as a backend. Any tool that uses keyring, such as uv for alternative indexes, will trigger browser auth when accessing Azure DevOps feeds.

Install from PyPi

uv tool install keyring --with ado-keyring

Features

  • Browser-based OAuth2 + PKCE — secure, no secrets stored in config files
  • Persistent token cache — avoids repeated browser prompts (~/.ado-keyring/)
  • Automatic token refresh — uses refresh tokens to silently renew access
  • Per-org session tokens — supports multiple Azure DevOps organizations
  • WSL-aware — opens the Windows browser from WSL via cmd.exe
  • No .NET dependency — pure Python, unlike artifacts-keyring

Install from source

just install

Install on WSL from source

tdnf install -y python3 python3-pip
python3 -m pip install
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
uv tool install rust-just
just install

How It Works

  1. Binds a localhost callback server on a random port
  2. Opens the browser to Azure AD's OAuth2 authorize endpoint (PKCE, select_account prompt)
  3. Receives the authorization code via redirect
  4. Exchanges the code for access + refresh tokens
  5. Exchanges the access token for a VssSessionToken scoped to vso.packaging
  6. Caches all tokens to ~/.ado-keyring/token-cache.json (file: 0600, dir: 0700)
  7. On subsequent calls, uses cached session tokens or silently refreshes via the refresh token

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ado_keyring-0.1.1.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ado_keyring-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file ado_keyring-0.1.1.tar.gz.

File metadata

  • Download URL: ado_keyring-0.1.1.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ado_keyring-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e15ff221ac8f80db28b92c588a09abf2986765a75d9cb510af51dc34b1533f3c
MD5 df588ea38217c0ae59b8de08fdc95d1a
BLAKE2b-256 4cbdae14bd6401743095dba4ba98c4b9c0e993979ac5783a0d64d390c066da96

See more details on using hashes here.

Provenance

The following attestation bundles were made for ado_keyring-0.1.1.tar.gz:

Publisher: pypi.yml on cataggar/ado-keyring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ado_keyring-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ado_keyring-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ado_keyring-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e006f49df6e37102bca05cae38834676faf729fe4e7458ab689fd091805c0057
MD5 5cc36ac9fd30e8ca2da1f7c448c22677
BLAKE2b-256 746032f85489d60ab69f46c9c39be8f71650064cbf92e7d16e7d3a4a4813de4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ado_keyring-0.1.1-py3-none-any.whl:

Publisher: pypi.yml on cataggar/ado-keyring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page