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

Function WithEndpointScopes

api/client.go:92–96  ·  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

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

Callers 3

createGistFunction · 0.92
deleteRepoFunction · 0.92

Calls

no outgoing calls

Tested by 1