Versions in this module Expand all Collapse all v0 v0.3.0 Apr 5, 2020 Changes in this version + var ErrClientAuthFailed = fmt.Errorf("%w: client failed authentication", oidc.ErrInvalidClient) + var ErrClientExists = fmt.Errorf(`%w: client already exists`, oidc.ErrInvalidClient) + var ErrClientNotFound = fmt.Errorf(`%w: client is not found`, oidc.ErrInvalidClient) + var ErrMalformedAuthHeader = fmt.Errorf("%w: malformed authorization header", oidc.ErrInvalidRequest) + var ErrMultipleClientInAuth = fmt.Errorf("%w: multiple client_id discovered during authentication", ...) + var ErrNonPublicClientNeedAuth = fmt.Errorf("%w: non-public client require authentication", oidc.ErrInvalidClient) + var ErrUndecidedRedirectUri = fmt.Errorf(`%w: "redirect_uri" cannot be decided`, oidc.ErrInvalidRequest) + var ErrUndecidedSectorIdentifierURI = fmt.Errorf(...) + var ErrUnsupportedClientAuth = fmt.Errorf("%w: client does not support authentication", oidc.ErrInvalidClient) + type AuthTemplate interface + func NewClientSecretBasic() AuthTemplate + func NewClientSecretPost() AuthTemplate + func NewNoneAuth() AuthTemplate + type Authenticator interface + Authenticate func(ctx context.Context, rw http.ResponseWriter, r *http.Request) (*Client, error) + func NewAuthenticator(lookup Lookup, templates ...AuthTemplate) Authenticator + type Client struct + AppType oidc.AppType + ClientUri string + Contacts []string + DefaultAcrValues []string + DefaultMaxAge oidc.MaxAge + GrantTypes oidc.GrantTypeSet + HashedSecret string + Id string + IdTokenEncryptedResponseAlg jose.EncryptionAlgorithm + IdTokenEncryptedResponseEnc jose.ContentEncodingAlgorithm + IdTokenSignedResponseAlg jose.SignatureAlgorithm + InteractionProvider string + JwksRef string + JwksValue string + LogoUri string + Name string + PolicyUri string + Public bool + RedirectUris oidc.RedirectUriSet + RequestObjectEncryptedResponseAlg jose.EncryptionAlgorithm + RequestObjectEncryptedResponseEnc jose.ContentEncodingAlgorithm + RequestObjectSignedResponseAlg jose.SignatureAlgorithm + RequestUris map[string]json.RawMessage + ResponseTypes oidc.ResponseTypeSet + Scopes map[oidc.Scope]json.RawMessage + SectorIdUri string + SubjectType oidc.SubjectType + TokenEndpointAuthMethod oidc.AuthMethod + TokenEndpointAuthSigningAlg jose.SignatureAlgorithm + TosUri string + UserInfoEncryptedResponseAlg jose.EncryptionAlgorithm + UserInfoEncryptedResponseEnc jose.ContentEncodingAlgorithm + UserInfoSignedResponseAlg jose.SignatureAlgorithm + func (c *Client) CompareSecret(testSecret string) bool + func (c *Client) DecideAcrValues(requested []string) (decided []string) + func (c *Client) DecideMaxAge(requested oidc.MaxAge) (decided oidc.MaxAge) + func (c *Client) DecideRedirectUri(requested oidc.RedirectUri) (decided oidc.RedirectUri, err error) + func (c *Client) DecideSectorIdentifierURI() (string, error) + func (c *Client) HasGrantType(grantType oidc.GrantType) bool + func (c *Client) HasRequestUri(requestUri string) bool + func (c *Client) HasResponseType(responseType oidc.ResponseType) bool + func (c *Client) HasScope(scope oidc.Scope) bool + func (c *Client) RequestObjectByRef(ref string) (string, bool) + func (c *Client) ResolveJSONWebKeySet(ctx context.Context, strategy KeySetStrategy) (jwks *gojosev2.JSONWebKeySet, err error) + func (c *Client) ZeroFields() *Client + type KeySetStrategy interface + Resolve func(ctx context.Context, client *Client) (raw string, err error) + func FetchKeySetStrategy() KeySetStrategy + type Lookup interface + FindById func(ctx context.Context, clientId string) (*Client, error) + type RedisStorage struct + Logger *zerolog.Logger + RedisClient redis.UniversalClient + func (s *RedisStorage) Delete(ctx context.Context, clientId string) error + func (s *RedisStorage) FindById(ctx context.Context, clientId string) (*Client, error) + func (s *RedisStorage) Insert(ctx context.Context, client *Client) error + func (s *RedisStorage) Update(ctx context.Context, updated *Client, ref *Client) error + type Storage interface + Delete func(ctx context.Context, clientId string) error + Insert func(ctx context.Context, client *Client) error + Update func(ctx context.Context, updated *Client, ref *Client) error + func NewMemoryStorage() Storage