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)
| 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. |
| 92 | func WithEndpointScopes(scopes string) RequestOption { |
| 93 | return func(cfg *requestConfig) { |
| 94 | cfg.endpointScopes = scopes |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func newRequestConfig(opts []RequestOption) requestConfig { |
| 99 | cfg := requestConfig{headers: map[string]string{}} |
no outgoing calls