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 *http.Client, hostname, authToken string)
| 59 | // HasMinimumScopes performs a GitHub API request and returns an error if the token used in the request |
| 60 | // lacks the minimum required scopes for performing API operations with gh. |
| 61 | func HasMinimumScopes(httpClient *http.Client, hostname, authToken string) error { |
| 62 | scopesHeader, err := GetScopes(httpClient, hostname, authToken) |
| 63 | if err != nil { |
| 64 | return err |
| 65 | } |
| 66 | |
| 67 | return HeaderHasMinimumScopes(scopesHeader) |
| 68 | } |
| 69 | |
| 70 | // HeaderHasMinimumScopes parses the comma separated scopesHeader string and returns an error |
| 71 | // if it lacks the minimum required scopes for performing API operations with gh. |