Skip to content

DRY local configuration changes and apikey autoloading #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 16, 2021

Conversation

couture-ql
Copy link
Contributor

@couture-ql couture-ql commented Nov 5, 2021

This series introduces a change to reduce duplication of configuration file derivation as well as tucking config files into a default standard path.

Building on top of the standard path, introduce apikey autoload. When imported, attempt to find the apikey in our standard path: if a file exists try to read it. Adds convenience to avoid unnecessary boilerpate; help prevent people from committing their api key.

A future topic will allow API key to be defined via environment variables.

couture-ql and others added 3 commits November 5, 2021 09:46
Currently the config file path derivation logic is duplicated and
defines a default name in $HOME instead of tucking itself into a utility
directory.

Establish a default ~/.nasdaq directory for possible configuration files
and rename the apikey config file.  Adds logic to check if the file path
exists and add logic that tries hard to create the directories if they
don't exist.

Ideally the explicit call to read_key() should not be required by users
and the client should attempt to set they key for convenience.  A future
commit will attempt to add read_key() convenience.

Signed-off-by: Jamie Couture <jamie.couture@nasdaq.com>
Currently the data link library allows users to define a simple
credential file where the api key is anticipated, but requires an
explicit call to read_key().  Introduce convenience logic to set the api
key in global configuration, if the file exist.

Update documentation in support of read_key() convenience.

Signed-off-by: Jamie Couture <jamie.couture@nasdaq.com>
@ericvautour-quandl ericvautour-quandl merged commit 44e60b7 into main Nov 16, 2021
@ericvautour-quandl ericvautour-quandl deleted the jc/local-credentials branch November 16, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy