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.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

loadcredential-1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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