Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConfOIDCWellKnownURL = "OIDC_WELL_KNOWN_URL" ConfTokenIntrospectionURL = "IDP_TOKEN_INTROSPECTION_URL" ConfIDPRequestTimeoutSeconds = "IDP_REQUEST_TIMEOUT_SECONDS" ConfIDPCacheEnabled = "IDP_CACHE_ENABLED" ConfIDPCacheRetentionSeconds = "IDP_CACHE_RETENTION_SECONDS" )
Variables ¶
This section is empty.
Functions ¶
func ConfigItems ¶
func ConfigItems() []auconfigapi.ConfigItem
Types ¶
type IdentityProviderClient ¶
type IdentityProviderClient interface { // SetupFromWellKnown must be called at least once before any other methods can be used. SetupFromWellKnown(ctx context.Context) error Issuer() string // UserInfo extracts the token from the context and performs a user info lookup UserInfo(ctx context.Context) (*UserinfoResponse, int, error) // TokenIntrospection extracts the token from the context and performs a token info lookup TokenIntrospection(ctx context.Context) (*TokenIntrospectionResponse, int, error) }
func New ¶
func New(options Options) IdentityProviderClient
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (*Impl) TokenIntrospection ¶
type Options ¶
type Options struct { RequestTimeout time.Duration CacheEnabled bool CacheRetentionTime time.Duration OIDCWellKnownURL string TokenIntrospectionURL string }
func OptionsFromConfig ¶
func OptionsFromConfig() Options
type TokenIntrospectionResponse ¶
type TokenIntrospectionResponse struct { Active bool `json:"active"` Scope string `json:"scope"` ClientId string `json:"client_id"` Sub string `json:"sub"` Exp int64 `json:"exp"` Iat int64 `json:"iat"` Nbf int64 `json:"nbf"` Aud []string `json:"aud"` Iss string `json:"iss"` TokenType string `json:"token_type"` TokenUse string `json:"token_use"` // in case of error, you get these fields instead ErrorMessage string `json:"message"` Errors map[string][]string `json:"errors"` }
type UserinfoResponse ¶
type UserinfoResponse struct { // can leave out fields - we are using a tolerant reader Audience []string `json:"aud"` AuthTime int64 `json:"auth_time"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Name string `json:"name"` // username Groups []string `json:"groups"` Issuer string `json:"iss"` IssuedAt int64 `json:"iat"` RequestedAt int64 `json:"rat"` Subject string `json:"sub"` // in case of error, you get these fields instead ErrorCode string `json:"error"` ErrorDescription string `json:"error_description"` }
type WellKnownResponse ¶
Click to show internal directories.
Click to hide internal directories.