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 uv
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.2.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.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ado_keyring-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 24c04e15edd0d6fa299718b2b8f4a27b563b685566a22c62ae63500eb27b27df
MD5 ca8b585f1297e4bfe360d8994b822722
BLAKE2b-256 b22ddcef737a99f1552ecd7d64fc1eb68364b3f8744c91e4453615d765ed5755

See more details on using hashes here.

Provenance

The following attestation bundles were made for ado_keyring-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: ado_keyring-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfb16a295ce1855ab6383470dca6b7a4b140d2f0f36db28f8bff0e9285117376
MD5 3497e20d59df47eb678d84dbc0462aae
BLAKE2b-256 2ebd3adac856d2070ac887900a1cc8921eee91e130843d06902ca172f9e686b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ado_keyring-0.1.2-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