HasMinimumScopes performs a GitHub API request and returns an error if the token used in the request lacks the minimum required scopes for performing API operations with gh.
(httpClient httpClient, hostname, authToken string)
| 68 | // HasMinimumScopes performs a GitHub API request and returns an error if the token used in the request |
| 69 | // lacks the minimum required scopes for performing API operations with gh. |
| 70 | func HasMinimumScopes(httpClient httpClient, hostname, authToken string) error { |
| 71 | scopesHeader, err := GetScopes(httpClient, hostname, authToken) |
| 72 | if err != nil { |
| 73 | return err |
| 74 | } |
| 75 | |
| 76 | return HeaderHasMinimumScopes(scopesHeader) |
| 77 | } |
| 78 | |
| 79 | // HeaderHasMinimumScopes parses the comma separated scopesHeader string and returns an error |
| 80 | // if it lacks the minimum required scopes for performing API operations with gh. |