Skip to main content

A simple package to read credentials generated by systemd's LoadCredential, with a fallback on environment variables.

Project description

loadcredential

This is a simple python package for interfacing with systemd's LoadCredential mechanism. It allows reading secrets from the credentials directory, with a fallback on environment variables if needed.

Usage

Basic usage

from loadcredential import Credentials

credentials = Credentials()

secret1 = credentials["SECRET_1"]

Changes

v1.1 (2024-05-10)

  • Added credentials.get(key, default=None) which returns a default value and does not raise an error when the key is absent
  • Added credentials.get_json(key, default = None) which treats the imported secret as json data

v1.0 (2024-05-09)

Initial version

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

loadcredential-1.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

loadcredential-1.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file loadcredential-1.3.tar.gz.

File metadata

  • Download URL: loadcredential-1.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for loadcredential-1.3.tar.gz
Algorithm Hash digest
SHA256 2b0061b5dea739177f5cf675fb07546b4689909886291713c78ed9ffabf0f25c
MD5 3bc4618b234d1bdc1fa00f81045607f8
BLAKE2b-256 033091b8c259d2f384f7491f9565f1ced3629227daa2230555f4817609faaa99

See more details on using hashes here.

File details

Details for the file loadcredential-1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for loadcredential-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0980e332db85c93808dade21da18c008b2191f1ac90fe8f04365e9c4c8ddb3c0
MD5 1886d0529b081806ec86abd5abc8bd40
BLAKE2b-256 80a5630dde382b5c54b2bac50bf65b20aa98169252726ef5e22f5dfb018ac038

See more details on using hashes here.

Supported by

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