TokenForHost returns string "oauth_token" as source when config is read from file
Open
enhancement
- Dominant language
- Go
- Stars
- 438
- Forks
- 94
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 6
Description
TokenForHost `source` return value should be a value like GH_TOKEN or GITHUB_TOKEN when the token comes from an environment variable, or a file path (e.g. `/path/to/hosts.yml`) when the value comes from a file. However, a static string `oauth_token` is returned instead of a file name: https://github.com/cli/go-gh/blob/da64a13f361b2a1b9a1eb5358b7d7eee7506f6a2/pkg/auth/auth.go#L64
Since `oauth_token` source is not useful to find out where a value comes from, printing the file name would be better.
Ref. https://github.com/cli/go-gh/pull/44
Contributor guide
Assessment
This issue has not been assessed yet.