MCPcopy Create free account
hub / github.com/cli/cli / ScopesSuggestion

Function ScopesSuggestion

api/client.go:187–192  ·  view source on GitHub ↗

ScopesSuggestion is an error messaging utility that prints the suggestion to request additional OAuth scopes in case a server response indicates that there are missing scopes.

(resp *http.Response)

Source from the content-addressed store, hash-verified

185// ScopesSuggestion is an error messaging utility that prints the suggestion to request additional OAuth
186// scopes in case a server response indicates that there are missing scopes.
187func ScopesSuggestion(resp *http.Response) string {
188 return generateScopesSuggestion(resp.StatusCode,
189 resp.Header.Get("X-Accepted-Oauth-Scopes"),
190 resp.Header.Get("X-Oauth-Scopes"),
191 resp.Request.URL.Hostname())
192}
193
194// EndpointNeedsScopes adds additional OAuth scopes to an HTTP response as if they were returned from the
195// server endpoint. This improves HTTP 4xx error messaging for endpoints that don't explicitly list the

Callers 1

processResponseFunction · 0.92

Calls 2

generateScopesSuggestionFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected