Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

wwuck/keyrings.envvars

Repository files navigation

Project moved

Project hosting has moved to https://codeberg.org/wwuck/keyrings.envvars.

keyrings.envvars

CI Codecov Sonar Coverage

pre-commit Black

keyrings.envvars is a keyring backend plugin for the keyring utility that provides credentials via environment variables.

Requirements

  • keyring >= 23.4.0
  • Python >= 3.9

Installation

You can install keyrings.envvars via pip from PyPI:

$ pip install keyrings.envvars

Usage

keyrings.envvars uses the following format for environment variables:

KEYRING_SERVICE_NAME_<n>=<service>
KEYRING_SERVICE_USERNAME_<n>=<username>
KEYRING_SERVICE_PASSWORD_<n>=<password>

Example for usage with pip credentials:

KEYRING_SERVICE_NAME_0=https://private-pypi-index.example.com
KEYRING_SERVICE_USERNAME_0=testusername
KEYRING_SERVICE_PASSWORD_0=testpassword
KEYRING_SERVICE_NAME_1=https://another-private-pypi-index.example.com
KEYRING_SERVICE_USERNAME_1=testusername
KEYRING_SERVICE_PASSWORD_1=testpassword

Note: Defining multiple identical credentials (service name and username) will result in the last defined password being returned as the environment variables are sorted by the keyring backend.

export KEYRING_SERVICE_NAME_0=https://private-pypi-index.example.com
export KEYRING_SERVICE_USERNAME_0=testusername
export KEYRING_SERVICE_PASSWORD_0=testpassword
export KEYRING_SERVICE_NAME_1=https://private-pypi-index.example.com
export KEYRING_SERVICE_USERNAME_1=testusername
export KEYRING_SERVICE_PASSWORD_1=testpassword_1
keyring get https://private-pypi-index.example.com testusername
testpassword_1

Contributing

Contributions including suggestions, pull requests, etc. are very welcome. keyrings.envvars uses Conventional Commits format for commit messages.

License

Distributed under the terms of the MIT license, keyrings.envvars is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Please read https://www.chiark.greenend.org.uk/~sgtatham/bugs.html before you file an issue.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

About

Python keyring backend to obtain credentials from environment variables

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages