Skip to content

generic 'get access token' function #8

Description

@dcooley

I see here, for example, you look for Sys.getenv("MAPBOX_SECRET_TOKEN"). Would you consider something a bit more generic that looks for any string with "mapbox" in the environment?

Similar to what I have in mapdeck here

e <- Sys.getenv()
e <- e[ grep( "mapbox|mapdeck", names( e ), ignore.case = TRUE ) ]

(and the related thread)

Activity

  1. walkerke commented on Oct 5, 2020

    @walkerke
    Owner

    yes I like this a lot. The one thing I need to think through is how to handle the distinction between public tokens and secret tokens, as some tasks (e.g. uploading tilesets) require tokens with secret scope, whereas most others do not. When mb_access_token() saves the token to a user's .Renviron, it detects whether or not the token is secret and names it appropriately. I'd like to have more interoperability with other Mapbox packages though which is what your suggestion would achieve.

  2. dcooley commented on Oct 5, 2020

    @dcooley
    Author

    yeah good point, I hadn't considered the secret vs public tokens. But interoperability is certainly the goal where the same token can be set once and called by multiple packages.

  3. walkerke commented on Oct 6, 2020

    @walkerke
    Owner

    100% agree about interoperability - that's one of my priorities as I build out this package more.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions