lundybernard / lundybernard/project_template

key-ring or multi-config

Open
#4 0 comments 0 reactions 1 assignee View on GitHub

@tomato-gits is already working on this.

Since May 1, 2022.

enhancement help wanted
Dominant language
Python
Stars
0
Forks
0
Avg merge
3m
Merged PRs (30d)
1

Description

We need to work out a configuration API for a key-ring, or a type of configuration object that can contain multiple variants of the same config type.

Motivating Example:

we have a class that manages credentials and/or authentication, but we need to use it to sign in as multiple users to the same systems.

  • we don't want each module for accessing some system to duplicate the credential config structure and specific credentials.
  • we need to be able to over-ride the config through ENV variables and CLI args
  • we may want to use an external credential storage file or service

Example:

cfg = get_config()

a_token_creds = cfg.credentials.user_a.auth_token
a_user = AuthToken(a_token_creds)
a_remote = RemoteService(auth_token=a_user.string)

b_token_creds = cfg.credentials.user_b.auth_token
b_user = AuthToken(b_token_creds)
b_remote = RemoteService(auth_token=b_user.string)

Related to: lundybernard/batconf/issues/11

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.