Skip to main content

rb-credentials

Resolve named credentials without storing, logging or printing secrets.

The package knows credential names; the environment knows addresses. You map a name such as github to an address such as an environment variable or a keychain entry, and the package resolves it to a Credential whose token is a SecretStr. No address is hard-coded, and nothing is written to disk.

Install

uv add rb-credentials
uv add "rb-credentials[keyring]"

Use

from rb_credentials import providers_for, resolve_credential

providers = providers_for({"github": "env:GITHUB_TOKEN"})
credential = resolve_credential(*providers, name="github")
token = credential.token.get_secret_value()

Addresses:

  • env:NAME reads the environment variable NAME.
  • keyring:service/account reads the OS keychain through the optional keyring extra. Without the extra the lookup returns nothing; there is no plaintext fallback.

Provide your own source with CallableCredentials, or implement CredentialProvider:

from rb_credentials import CallableCredentials, providers_for, resolve_credential

providers = (*providers_for({}), CallableCredentials(lambda name: vault.read(name)))
credential = resolve_credential(*providers, name="github")

A missing credential raises CredentialsUnavailable with the credential name and never with a value. Pass a Credential or a ready client into your operations; do not read the environment inside them.

Rules

  • Secrets stay in SecretStr, never in str, arguments, results or logs.
  • Expiry is explicit: credential.is_expired() and expires_at.
  • No storage, no caching, no plaintext file.

Develop

uv sync
uv run poe check
uv build
uvx --from 'twine>=6,<7' twine check dist/*

The library version is independent of any project that depends on it.

Metadata

Release files for rb-credentials 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rb-credentials 0.7.2
File Size Uploaded Provenance Actions
rb_credentials-0.7.2.tar.gz 13.4 kB Without provenance Details for rb_credentials-0.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rb-credentials 0.7.2
File Interpreter ABI Platform Actions
rb_credentials-0.7.2-py3-none-any.whl Python 3 none any Details for rb_credentials-0.7.2-py3-none-any.whl

Total release size: 24.2 kB

Release files / rb_credentials-0.7.2.tar.gz

Download URL rb_credentials-0.7.2.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0e1434121c65972d4b4890a947436808ee687cf172efbd95c1a19453aa9f9279
BLAKE2b-256 checksum
How to use checksums
814e5cee509067eb431884e32d96b9c3c2a862cc99e8d2ce0ab0a82378ee6eff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rb_credentials-0.7.2-py3-none-any.whl

Download URL rb_credentials-0.7.2-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55d317adde70dfbf828593cbdfaddaa4e9a55418d732aacfcbc5fd16ad33ad48
BLAKE2b-256 checksum
How to use checksums
47cbd0ce780b5c9c269ad4fc5b59d187e62935ec39a3356052202a27634172e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rb-credentials 0.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page