Skip to content

Comments

allow API token to be retrieved from environment variable #24#25

Merged
kcondon merged 1 commit intomasterfrom
24-api-token-env-var
Oct 30, 2020
Merged

allow API token to be retrieved from environment variable #24#25
kcondon merged 1 commit intomasterfrom
24-api-token-env-var

Conversation

@pdurbin
Copy link
Member

@pdurbin pdurbin commented Oct 29, 2020

Closes #24 - Allow API token to be retrieved from an environment variable

I'm aware that there's a similar solution in pull request #14

I'm also aware that here the dvconfig.py file is edited directly: https://github.com/GlobalDataverseCommunityConsortium/dataverse-ansible/blob/56ae75de0a796e515200d6830115f60e6ce3fd5e/tasks/sampledata.yml#L59

This is a small chunk and makes things easier for me.

cp dvconfig.py.sample dvconfig.py
vi dvconfig.py

Note that the environment variable `$API_TOKEN` will override `api_token` in `dvconfig.py`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only question here is which token should take precedence, the environment variable or the one in dvconfig.py? (I have not looked at this code very deeply overall, so not necessarily advocating for the switch)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched online and it seems standard for environment variable to take precedence.

@kcondon kcondon self-assigned this Oct 30, 2020
@kcondon kcondon merged commit 8d705f0 into master Oct 30, 2020
@kcondon kcondon deleted the 24-api-token-env-var branch October 30, 2020 18:23
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.

Allow API token to be retrieved from an environment variable

3 participants