Documentation
¶
Index ¶
- func AssertEndpointWithProvider(t *testing.T, provider Provider, url string, method string, ...)
- type GetTokenOption
- type GetTokenOptions
- type Provider
- type RequestOption
- func WithGetTokenOption(opt GetTokenOption) RequestOption
- func WithGetTokenOptions(opt ...GetTokenOption) RequestOption
- func WithHeaders(headers map[string]string) RequestOption
- func WithTokenFromParam(param string) RequestOption
- func WithTokenHeader(header string) RequestOption
- func WithTokenOverride(token string) RequestOption
- func WithTokenPrefix(prefix string) RequestOption
- func WithoutToken() RequestOption
- type RequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEndpointWithProvider ¶
func AssertEndpointWithProvider(t *testing.T, provider Provider, url string, method string, options ...RequestOption)
AssertEndpointWithProvider asserts that the given endpoint responds correctly with a token from the provided OAuth2 provider. It checks that requests:
- without a token return response code 403,
- with an invalid token return response code 401,
- with a valid token return response code 200.
Types ¶
type GetTokenOption ¶
type GetTokenOption func(*GetTokenOptions)
func WithAudience ¶
func WithAudience(audience string) GetTokenOption
func WithJWTTokenFormat ¶
func WithJWTTokenFormat() GetTokenOption
func WithOpaqueTokenFormat ¶
func WithOpaqueTokenFormat() GetTokenOption
func WithScope ¶
func WithScope(scope string) GetTokenOption
type GetTokenOptions ¶
type RequestOption ¶
type RequestOption func(*RequestOptions)
func WithGetTokenOption ¶
func WithGetTokenOption(opt GetTokenOption) RequestOption
func WithGetTokenOptions ¶
func WithGetTokenOptions(opt ...GetTokenOption) RequestOption
func WithHeaders ¶
func WithHeaders(headers map[string]string) RequestOption
func WithTokenFromParam ¶
func WithTokenFromParam(param string) RequestOption
func WithTokenHeader ¶
func WithTokenHeader(header string) RequestOption
func WithTokenOverride ¶
func WithTokenOverride(token string) RequestOption
func WithTokenPrefix ¶
func WithTokenPrefix(prefix string) RequestOption
func WithoutToken ¶
func WithoutToken() RequestOption
type RequestOptions ¶
Click to show internal directories.
Click to hide internal directories.