r-lib / gh

Minimalistic GitHub API client in R
https://gh.r-lib.org
Other
223 stars 52 forks source link

Introduce gh_pat class #129

Closed jennybc closed 4 years ago

jennybc commented 4 years ago

Closes #125

What do you think the name of this class should be? It really doesn't matter. I contemplated gh_token but then I can't make gh_token() the constructor, because gh_token() already exists as a user-facing, higher-level function.

jennybc commented 4 years ago

Here's how it looks with no token:

library(gh)

gh_token()
#> <no PAT>

format(gh_token())
#> [1] "<no PAT>"

str(gh_token())
#> <gh_pat> <no PAT>

Created on 2020-08-10 by the reprex package (v0.3.0.9001)

And with:

library(gh)

credentials::set_github_pat()

gh_token()
#> e5fa...44

format(gh_token())
#> [1] "e5fa...44"

str(gh_token())
#> <gh_pat> e5fa...44

Created on 2020-08-10 by the reprex package (v0.3.0.9001)