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

Function WithEndpointScopes

api/client.go:93–97  ·  view source on GitHub ↗

WithEndpointScopes adds OAuth scopes to a 4xx error as if the server endpoint had returned them. This improves error messaging for endpoints that do not explicitly list the scopes they need, and is the Request equivalent of calling EndpointNeedsScopes on a raw response.

(scopes string)

Source from the content-addressed store, hash-verified

91// This improves error messaging for endpoints that do not explicitly list the scopes they need, and
92// is the Request equivalent of calling EndpointNeedsScopes on a raw response.
93func WithEndpointScopes(scopes string) RequestOption {
94 return func(cfg *requestConfig) {
95 cfg.endpointScopes = scopes
96 }
97}
98
99func newRequestConfig(opts []RequestOption) requestConfig {
100 cfg := requestConfig{headers: map[string]string{}}

Callers 4

createGistFunction · 0.92
fetchForkInfoFunction · 0.92
deleteRepoFunction · 0.92

Calls

no outgoing calls

Tested by 1