Versions in this module Expand all Collapse all v0 v0.3.0 Apr 5, 2020 Changes in this version + var ErrClientIdMismatch = fmt.Errorf(`%w: "client_id" mismatch`, oidc.ErrInvalidRequest) + var ErrRequestExpired = fmt.Errorf(`%w: request had expired`, oidc.ErrInvalidRequest) + var ErrRequestNotFound = fmt.Errorf("%w: request not found or have expired", oidc.ErrInvalidRequest) + var ErrRequestObjectAndReference = fmt.Errorf(`%w: only one of "request" or "request_uri" may be specified'`, ...) + var ErrRequestUriUnregistered = fmt.Errorf(`%w: "request_uri" was not pre-registered`, oidc.ErrInvalidRequestUri) + var InteractionSignal = errors.New("interaction required") + type BrowserStateUserSessionResolver struct + func (r BrowserStateUserSessionResolver) Resolve(ctx context.Context, ar *Request, collector UserSessionCollector) error + type ConsentRecordResolver struct + ConsentStorage user.ConsentStorage + func (r *ConsentRecordResolver) Resolve(ctx context.Context, ar *Request, collector GrantedScopeCollector) error + type GrantedScopeCollector interface + AddScope func(scope oidc.Scope) + ClearAllScopes func() + ContainsScope func(scope oidc.Scope) bool + ForEachGrantedScope func(callback func(scope oidc.Scope) error) error + NumberOfGrantedScopes func() int + type IdTokenHintUserSessionResolver struct + ClientJwksStrategy client.KeySetStrategy + Logger *zerolog.Logger + PairwiseSalt []byte + ServerJwks *gojosev2.JSONWebKeySet + func (r *IdTokenHintUserSessionResolver) Resolve(ctx context.Context, ar *Request, collector UserSessionCollector) error + type InteractionStateCollector struct + func NewInteractionStateCollector() *InteractionStateCollector + func (c *InteractionStateCollector) AddScope(scope oidc.Scope) + func (c *InteractionStateCollector) AddSession(session *user.Session) + func (c *InteractionStateCollector) ClearAllScopes() + func (c *InteractionStateCollector) ClearAllSessions() + func (c *InteractionStateCollector) ContainsScope(scope oidc.Scope) bool + func (c *InteractionStateCollector) ForEachGrantedScope(callback func(scope oidc.Scope) error) error + func (c *InteractionStateCollector) ForEachSession(callback func(session *user.Session) error) error + func (c *InteractionStateCollector) GetFirst() *user.Session + func (c *InteractionStateCollector) HasGrantedScope(scope oidc.Scope) bool + func (c *InteractionStateCollector) HasMarkedConsentStage() bool + func (c *InteractionStateCollector) HasMarkedSubjectStage() bool + func (c *InteractionStateCollector) MarkConsentStage() + func (c *InteractionStateCollector) MarkSubjectStage() + func (c *InteractionStateCollector) MarshalJSON() ([]byte, error) + func (c *InteractionStateCollector) NumberOfGrantedScopes() int + func (c *InteractionStateCollector) NumberOfSessions() int + func (c *InteractionStateCollector) RemoveSession(subject string) + func (c *InteractionStateCollector) UnmarshalJSON(raw []byte) error + type Params struct + AcrValues string + AudienceHint string + Claims json.RawMessage + ClaimsLocales string + ClientId string + CodeChallenge string + CodeChallengeMethod string + Display string + IdTokenHint string + LoginHint string + MaxAge string + Nonce string + Prompt string + RedirectUri string + ResponseMode string + ResponseType string + Scope string + State string + UiLocales string + func (p *Params) FillRequest(req *Request) (err error) + func (p *Params) Merge(q *Params) error + type Parser struct + ClientJwksStrategy client.KeySetStrategy + ClientLookup client.Lookup + Provider *pkg.Provider + RequestObjectStrategy RequestObjectStrategy + RequestStorage RequestStorage + ServerJwks *gojosev2.JSONWebKeySet + func (s *Parser) ParseFirstAuthorize(ctx context.Context, r *http.Request) (req *Request, err error) + func (s *Parser) ParseInteraction(ctx context.Context, r *http.Request) (req *Request, err error) + func (s *Parser) ParseResumeAuthorize(ctx context.Context, r *http.Request) (req *Request, err error) + type PromptLogicConsentResolver struct + DownstreamResolvers []UserConsentResolver + func (r *PromptLogicConsentResolver) Resolve(ctx context.Context, ar *Request, collector GrantedScopeCollector) error + type PromptLogicUserSessionResolver struct + DownstreamResolvers []UserSessionResolver + func (r *PromptLogicUserSessionResolver) Resolve(ctx context.Context, ar *Request, collector UserSessionCollector) error + type RedisRequestStorage struct + ClientLookup client.Lookup + Logger *zerolog.Logger + RedisClient redis.UniversalClient + func (s *RedisRequestStorage) Delete(ctx context.Context, id string) error + func (s *RedisRequestStorage) Get(ctx context.Context, id string) (*Request, error) + func (s *RedisRequestStorage) Save(ctx context.Context, request *Request) error + type Request struct + AcrValues []string + AudienceHint []string + Claims *oidc.Claims + ClaimsLocales []string + Client *client.Client + CodeChallenge string + CodeChallengeMethod oidc.CodeChallengeMethod + Display oidc.Display + Expiry time.Time + Id string + IdTokenHint string + Interaction *InteractionStateCollector + LoginHint string + MaxAge oidc.MaxAge + Nonce string + Prompts oidc.PromptSet + RedirectUri oidc.RedirectUri + ResponseMode oidc.ResponseMode + ResponseType oidc.ResponseType + Scopes oidc.ScopeSet + State string + UiLocales []string + func (r *Request) AllScopesGranted() bool + func (r *Request) Expired() bool + func (r *Request) HasPrompt(p oidc.Prompt) bool + func (r *Request) MarshalJSON() ([]byte, error) + func (r *Request) RequestedScope(scope oidc.Scope) bool + func (r *Request) Validate(rules ...Rule) error + type RequestObjectStrategy interface + Resolve func(ctx context.Context, ref string) (raw string, err error) + func FetchRequestObjectStrategy() RequestObjectStrategy + type RequestStorage interface + Delete func(ctx context.Context, id string) error + Get func(ctx context.Context, id string) (*Request, error) + Save func(ctx context.Context, request *Request) error + func MemoryRequestStorage() RequestStorage + type Response struct + Code string + IdToken string + SessionState string + State string + type Rule func(ar *Request) error + type RuleSet struct + func (_ RuleSet) Basic(provider *pkg.Provider) Rule + func (_ RuleSet) Interaction() Rule + type UserConsentResolver interface + Resolve func(ctx context.Context, ar *Request, collector GrantedScopeCollector) error + type UserSessionCollector interface + AddSession func(session *user.Session) + ClearAllSessions func() + ForEachSession func(callback func(session *user.Session) error) error + GetFirst func() *user.Session + NumberOfSessions func() int + RemoveSession func(subject string) + type UserSessionResolver interface + Resolve func(ctx context.Context, ar *Request, collector UserSessionCollector) error