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