Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHeaderTokenAuthenticator ¶
func NewHeaderTokenAuthenticator(headers []string, ts types.Storage, logger *zap.Logger) authenticator.Authenticator
NewHeaderTokenAuthenticator returns an authenticator checking requests based on the passed header, and the passed storage adapter
Types ¶
type HeaderTokenAuthenticator ¶
type HeaderTokenAuthenticator struct {
// contains filtered or unexported fields
}
HeaderTokenAuthenticator is carrying the state of token-adapter-based header-token authenticators
func (*HeaderTokenAuthenticator) Authenticate ¶
func (a *HeaderTokenAuthenticator) Authenticate(r *http.Request) (authenticator.Requestor, error)
Authenticate processes the passed request, checking if the configured header's FIRST value matches any of the the hard-coded tokens list.
type HeaderTokenConfig ¶
type HeaderTokenConfig struct { Headers []string `json:"headers"` Storage StorageConfig `json:"storage"` }
HeaderTokenConfig is used for configuring tokens-storage-based header-token authenticators
func (*HeaderTokenConfig) Open ¶
func (c *HeaderTokenConfig) Open(u *url.URL, serviceCerts *certs.ServiceCerts, logger *zap.Logger, _ id_token.ValidateIdTokenServiceClient) (authenticator.Authenticator, error)
Open returns an storage-adapter-based header token authenticator
type StorageConfig ¶
type StorageConfig struct { Type string `json:"type"` Config types.TokenConfig `json:"config"` }
StorageConfig is the type for unmarshalling token storage-adapter configs
func (*StorageConfig) UnmarshalJSON ¶
func (c *StorageConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON allows Token to implement the unmarshaler interface to dynamically determine the type of the storage adapter config.