Skip to main content

Keyring backend for HES Azure Artifacts — enables uv sync without PATs

Project description

hestia-keyring

A keyring backend that authenticates uv sync against the HES Azure Artifacts feed using your active az CLI session — no Personal Access Tokens required.

Install once per machine

uv tool install keyring --with hestia-keyring

What it does

When uv calls keyring get https://pkgs.dev.azure.com/... VssSessionToken, this backend runs az account get-access-token --resource https://app.vssps.visualstudio.com and returns the resulting bearer token. Your az login session is the only credential you need.

Requirements

  • Python 3.13+
  • Azure CLI installed and signed in (az login)

Why this package and not the official uv approach?

The uv Azure docs suggest two alternatives:

Option A — artifacts-keyring:

uv tool install keyring --with artifacts-keyring
export UV_KEYRING_PROVIDER=subprocess
export UV_INDEX_PRIVATE_REGISTRY_USERNAME=VssSessionToken

artifacts-keyring is a thin wrapper around the Azure Artifacts Credential Provider — a .NET binary (CredentialProvider.Microsoft.exe) that Microsoft ships separately. When artifacts-keyring is called, it shells out to that binary to acquire a token. On company hardware the binary is not installed (it requires the .NET SDK or the Azure DevOps agent toolchain), so artifacts-keyring silently returns nothing and every uv sync ends with a 401.

Option B — access token via env var:

export UV_INDEX_HES_INTERNAL_USERNAME=VssSessionToken
export UV_INDEX_HES_INTERNAL_PASSWORD=$(az account get-access-token \
  --resource https://app.vssps.visualstudio.com --query accessToken --output tsv)

This works, but the token expires every hour and must be re-exported manually each session. It also can't be wired into pyproject.toml — each developer must set the env var themselves.

Why hestia-keyring:

  • Pure Python — uses azure-identity.DefaultAzureCredential with no .NET runtime or binary dependencies
  • Transparent — once installed, uv sync just works; no env vars to set per session
  • Token caching — the access token is reused for 5 minutes so repeated uv sync calls are fast
  • One az login — authenticates using the same browser session you already have

Consumer app configuration

Add to your app's pyproject.toml:

[[tool.uv.index]]
name = "hes-internal"
url = "https://VssSessionToken@pkgs.dev.azure.com/<org>/<project>/_packaging/<feed>/pypi/simple/"
default = false
explicit = true

[tool.uv.sources]
hestia = { index = "hes-internal" }

[tool.uv]
keyring-provider = "subprocess"

The VssSessionToken@ prefix in the URL is required — uv passes the URL username to keyring get, and VssSessionToken is the username this backend recognises.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

hestia_keyring-1.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file hestia_keyring-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: hestia_keyring-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hestia_keyring-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34ed105168d6315cdfcd4e1865b1f585a8cde023aee8cc84abf4bfae50238ebc
MD5 a99f7593779b211cd08b48699e8854fc
BLAKE2b-256 93b9a055dfbb800f3c2df6ccba7927721f24c5039dfbe45e25667286ca209292

See more details on using hashes here.

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