Skip to content

improvements to set_authorization function #13

Description

@AndrewIrwin

It would be great to enhance the set_authorization function to look in standard places for an API key, to encourage users to not put API keys in their source file and then accidentally distribute those keys.

For example, I put the following in ~/.Renviron:
CMAP_PAT_USER=xxxx

Then I use
# readRenviron("~/.Renviron") # put the API key in ~/.Renviron as CMAP_PAT_USER=XXXX
set_authorization(cmap_key = Sys.getenv("CMAP_PAT_USER"))

credentials::set_github_pat has other ideas as well.

Or perhaps just suggest this pattern in the documentation?

Activity

  1. sangwon-hyun commented on Jun 22, 2021

    @sangwon-hyun
    Collaborator

    Oops, we missed this, sorry! Your mainly suggesting a documentation update, right?

  2. AndrewIrwin commented on Jun 22, 2021

    @AndrewIrwin
    Author

    A documentation change would be good. Also possible would be setting the default value for cmap_key to read the environment variable.

    I see for example in the code Ginger showed in her talk this morning had a space for a hard-coded API key, although she didn't show it. Including the key in your code means its only a matter of time before someone / anyone publishes a key or commits it somewhere. So its a nice practice to encourage people to not put the PAT / API key in their code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions