Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct {
// contains filtered or unexported fields
}
type APIKeyConfig ¶
type Authenticator ¶
Authenticator defines an interface for applying authentication to outgoing requests.
func Build ¶ added in v0.2.0
func Build(authType string, options json.RawMessage) (Authenticator, error)
Build constructs an authenticator for the given auth type from its raw JSON options. It is the single entry point callers (e.g. the remote Manager) use, so they need not know about individual strategies. Secret references are resolved here, once; an unresolvable reference is a loud error.
type Bearer ¶
type Bearer struct {
// contains filtered or unexported fields
}
type BearerConfig ¶
type EndpointParams ¶ added in v0.6.0
EndpointParams carries extra parameters for the token request. They are sent in the request body alongside grant_type and scope, as RFC 6749 §3.2 requires — for example the RFC 8707 `resource` indicator, which names the resource server an access token is for.
It is url.Values so it drops straight into the token request (and into golang.org/x/oauth2/clientcredentials.Config.EndpointParams) without conversion, but its JSON accepts either a string or an array of strings per key, since a single value is the normal case:
"endpoint_params": { "resource": "https://api.example" }
"endpoint_params": { "resource": ["https://a.example", "https://b.example"] }
func (*EndpointParams) UnmarshalJSON ¶ added in v0.6.0
func (p *EndpointParams) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts a string or an array of strings for each key.
type OAuth2 ¶
type OAuth2 struct {
// contains filtered or unexported fields
}
func NewOAuth2 ¶
func NewOAuth2(tokenURL, clientID, clientSecret string, scopes []string, opts ...OAuth2Option) *OAuth2
NewOAuth2 builds an OAuth2 client-credentials authenticator from already-resolved values.
func (*OAuth2) SetInsecureSkipTLSVerify ¶ added in v0.2.0
SetInsecureSkipTLSVerify controls whether the OAuth2 token request client skips certificate verification. This is intended for local development with self-signed identity-provider certificates only.
type OAuth2Config ¶
type OAuth2Config struct {
TokenURL string `json:"token_url"`
ClientID string `json:"client_id"`
ClientSecret secret.SecretRef `json:"client_secret"`
Scopes []string `json:"scopes,omitempty"`
InsecureSkipTLSVerify bool `json:"insecure_skip_tls_verify,omitempty"`
EndpointParams EndpointParams `json:"endpoint_params,omitempty"`
}
type OAuth2Option ¶ added in v0.6.0
type OAuth2Option func(*OAuth2)
OAuth2Option configures an OAuth2 authenticator.
func WithEndpointParams ¶ added in v0.6.0
func WithEndpointParams(params url.Values) OAuth2Option
WithEndpointParams adds extra parameters to the token request body. Empty values are ignored. See EndpointParams for what belongs here.