Documentation ¶
Index ¶
- func Endpoint(ctx context.Context, cfg EndpointConfig, g *echo.Group)
- func LoginHandler(ctx context.Context, cfg LoginHandlerConfig) func(ctx echo.Context) error
- func LogoutHandler() echo.HandlerFunc
- func NewLocalClient(dev bool, id string, domain string) op.Client
- func NewStorage(ctx context.Context, cfg StorageConfig) (op.Storage, error)
- func Server(ctx context.Context, cfg ServerConfig) (*mux.Router, error)
- type Client
- func (c *Client) AccessTokenType() op.AccessTokenType
- func (c *Client) ApplicationType() op.ApplicationType
- func (c *Client) AuthMethod() oidc.AuthMethod
- func (c *Client) ClockSkew() time.Duration
- func (c *Client) DevMode() bool
- func (c *Client) GetID() string
- func (c *Client) GrantTypes() []oidc.GrantType
- func (c *Client) IDTokenLifetime() time.Duration
- func (c *Client) IDTokenUserinfoClaimsAssertion() bool
- func (c *Client) IsScopeAllowed(scope string) bool
- func (c *Client) LoginURL(id string) string
- func (c *Client) PostLogoutRedirectURIs() []string
- func (c *Client) RedirectURIs() []string
- func (c *Client) ResponseTypes() []oidc.ResponseType
- func (c *Client) RestrictAdditionalAccessTokenScopes() func(scopes []string) []string
- func (c *Client) RestrictAdditionalIdTokenScopes() func(scopes []string) []string
- type Config
- type ConfigRepo
- type DNConfig
- type EndpointConfig
- type LoginHandlerConfig
- type Memory
- func (r *Memory) FindByCode(_ context.Context, s string) (*Request, error)
- func (r *Memory) FindByID(_ context.Context, id RequestID) (*Request, error)
- func (r *Memory) FindBySubject(_ context.Context, s string) (*Request, error)
- func (r *Memory) Remove(_ context.Context, requestID RequestID) error
- func (r *Memory) Save(_ context.Context, request *Request) error
- type Mongo
- func (r *Mongo) FindByCode(ctx context.Context, s string) (*Request, error)
- func (r *Mongo) FindByID(ctx context.Context, id2 RequestID) (*Request, error)
- func (r *Mongo) FindBySubject(ctx context.Context, s string) (*Request, error)
- func (r *Mongo) Init(ctx context.Context) error
- func (r *Mongo) Remove(ctx context.Context, requestID RequestID) error
- func (r *Mongo) Save(ctx context.Context, request *Request) error
- type Request
- func (a *Request) AuthorizedAt() *time.Time
- func (a *Request) Complete(sub string)
- func (a *Request) CreatedAt() time.Time
- func (a *Request) Done() bool
- func (a *Request) GetACR() string
- func (a *Request) GetAMR() []string
- func (a *Request) GetAudience() []string
- func (a *Request) GetAuthTime() time.Time
- func (a *Request) GetClientID() string
- func (a *Request) GetCode() string
- func (a *Request) GetCodeChallenge() *oidc.CodeChallenge
- func (a *Request) GetID() string
- func (a *Request) GetNonce() string
- func (a *Request) GetRedirectURI() string
- func (a *Request) GetResponseMode() oidc.ResponseMode
- func (a *Request) GetResponseType() oidc.ResponseType
- func (a *Request) GetScopes() []string
- func (a *Request) GetState() string
- func (a *Request) GetSubject() string
- func (a *Request) ID() RequestID
- func (a *Request) SetAuthorizedAt(authorizedAt *time.Time)
- func (a *Request) SetCode(code string)
- func (a *Request) SetCurrentScopes(scopes []string)
- type RequestBuilder
- func (b *RequestBuilder) Audiences(audiences []string) *RequestBuilder
- func (b *RequestBuilder) AuthorizedAt(authorizedAt *time.Time) *RequestBuilder
- func (b *RequestBuilder) Build() (*Request, error)
- func (b *RequestBuilder) ClientID(id string) *RequestBuilder
- func (b *RequestBuilder) Code(code string) *RequestBuilder
- func (b *RequestBuilder) CodeChallenge(CodeChallenge *oidc.CodeChallenge) *RequestBuilder
- func (b *RequestBuilder) ID(id RequestID) *RequestBuilder
- func (b *RequestBuilder) MustBuild() *Request
- func (b *RequestBuilder) NewID() *RequestBuilder
- func (b *RequestBuilder) Nonce(nonce string) *RequestBuilder
- func (b *RequestBuilder) RedirectURI(redirectURI string) *RequestBuilder
- func (b *RequestBuilder) ResponseType(rt oidc.ResponseType) *RequestBuilder
- func (b *RequestBuilder) Scopes(scopes []string) *RequestBuilder
- func (b *RequestBuilder) State(state string) *RequestBuilder
- func (b *RequestBuilder) Subject(subject string) *RequestBuilder
- type RequestID
- type RequestIDType
- type RequestRepo
- type ServerConfig
- type Storage
- func (s *Storage) AuthRequestByCode(ctx context.Context, code string) (op.AuthRequest, error)
- func (s *Storage) AuthRequestByID(ctx context.Context, requestID string) (op.AuthRequest, error)
- func (s *Storage) AuthRequestBySubject(ctx context.Context, subject string) (op.AuthRequest, error)
- func (s *Storage) AuthorizeClientIDSecret(_ context.Context, _ string, _ string) error
- func (s *Storage) CompleteAuthRequest(ctx context.Context, requestId, sub string) error
- func (s *Storage) CreateAccessAndRefreshTokens(ctx context.Context, request op.TokenRequest, refreshToken string) (accessTokenID string, newRefreshToken string, expiration time.Time, err error)
- func (s *Storage) CreateAccessToken(_ context.Context, _ op.TokenRequest) (string, time.Time, error)
- func (s *Storage) CreateAuthRequest(ctx context.Context, authReq *oidc.AuthRequest, _ string) (op.AuthRequest, error)
- func (s *Storage) DeleteAuthRequest(ctx context.Context, requestID string) error
- func (s *Storage) GetClientByClientID(_ context.Context, clientID string) (op.Client, error)
- func (s *Storage) GetKeyByIDAndUserID(_ context.Context, kid, _ string) (*jose.JSONWebKey, error)
- func (s *Storage) GetKeySet(_ context.Context) (*jose.JSONWebKeySet, error)
- func (s *Storage) GetPrivateClaimsFromScopes(_ context.Context, _, _ string, _ []string) (map[string]interface{}, error)
- func (s *Storage) GetSigningKey(_ context.Context, keyCh chan<- jose.SigningKey)
- func (s *Storage) Health(_ context.Context) error
- func (s *Storage) RevokeToken(_ context.Context, _ string, _ string, _ string) *oidc.Error
- func (s *Storage) SaveAuthCode(ctx context.Context, requestID, code string) error
- func (s *Storage) SetIntrospectionFromToken(ctx context.Context, introspect oidc.IntrospectionResponse, ...) error
- func (s *Storage) SetUserinfoFromScopes(ctx context.Context, userinfo oidc.UserInfoSetter, subject, _clientID string, ...) error
- func (s *Storage) SetUserinfoFromToken(ctx context.Context, userinfo oidc.UserInfoSetter, ...) error
- func (s *Storage) TerminateSession(_ context.Context, _, _ string) error
- func (s *Storage) TokenRequestByRefreshToken(ctx context.Context, refreshToken string) (op.RefreshTokenRequest, error)
- func (s *Storage) ValidateJWTProfileScopes(_ context.Context, _ string, scope []string) ([]string, error)
- type StorageConfig
- type SubLoader
- type UserInfoProvider
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Endpoint ¶
func Endpoint(ctx context.Context, cfg EndpointConfig, g *echo.Group)
func LoginHandler ¶
func LoginHandler(ctx context.Context, cfg LoginHandlerConfig) func(ctx echo.Context) error
func LogoutHandler ¶
func LogoutHandler() echo.HandlerFunc
func NewStorage ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AccessTokenType ¶
func (c *Client) AccessTokenType() op.AccessTokenType
func (*Client) ApplicationType ¶
func (c *Client) ApplicationType() op.ApplicationType
func (*Client) AuthMethod ¶
func (c *Client) AuthMethod() oidc.AuthMethod
func (*Client) GrantTypes ¶
func (*Client) IDTokenLifetime ¶
func (*Client) IDTokenUserinfoClaimsAssertion ¶
func (*Client) IsScopeAllowed ¶
func (*Client) PostLogoutRedirectURIs ¶
func (*Client) RedirectURIs ¶
func (*Client) ResponseTypes ¶
func (c *Client) ResponseTypes() []oidc.ResponseType
func (*Client) RestrictAdditionalAccessTokenScopes ¶
func (*Client) RestrictAdditionalIdTokenScopes ¶
type ConfigRepo ¶
type EndpointConfig ¶
type LoginHandlerConfig ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) FindByCode ¶
func (*Memory) FindBySubject ¶
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
func NewMongo ¶
func NewMongo(client *mongox.Collection) *Mongo
func (*Mongo) FindByCode ¶
func (*Mongo) FindBySubject ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) AuthorizedAt ¶
func (*Request) GetAudience ¶
func (*Request) GetAuthTime ¶
func (*Request) GetClientID ¶
func (*Request) GetCodeChallenge ¶
func (a *Request) GetCodeChallenge() *oidc.CodeChallenge
func (*Request) GetRedirectURI ¶
func (*Request) GetResponseMode ¶
func (a *Request) GetResponseMode() oidc.ResponseMode
func (*Request) GetResponseType ¶
func (a *Request) GetResponseType() oidc.ResponseType
func (*Request) GetSubject ¶
func (*Request) SetAuthorizedAt ¶
func (*Request) SetCurrentScopes ¶
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest() *RequestBuilder
func (*RequestBuilder) Audiences ¶
func (b *RequestBuilder) Audiences(audiences []string) *RequestBuilder
func (*RequestBuilder) AuthorizedAt ¶
func (b *RequestBuilder) AuthorizedAt(authorizedAt *time.Time) *RequestBuilder
func (*RequestBuilder) Build ¶
func (b *RequestBuilder) Build() (*Request, error)
func (*RequestBuilder) ClientID ¶
func (b *RequestBuilder) ClientID(id string) *RequestBuilder
func (*RequestBuilder) Code ¶
func (b *RequestBuilder) Code(code string) *RequestBuilder
func (*RequestBuilder) CodeChallenge ¶
func (b *RequestBuilder) CodeChallenge(CodeChallenge *oidc.CodeChallenge) *RequestBuilder
func (*RequestBuilder) ID ¶
func (b *RequestBuilder) ID(id RequestID) *RequestBuilder
func (*RequestBuilder) MustBuild ¶
func (b *RequestBuilder) MustBuild() *Request
func (*RequestBuilder) NewID ¶
func (b *RequestBuilder) NewID() *RequestBuilder
func (*RequestBuilder) Nonce ¶
func (b *RequestBuilder) Nonce(nonce string) *RequestBuilder
func (*RequestBuilder) RedirectURI ¶
func (b *RequestBuilder) RedirectURI(redirectURI string) *RequestBuilder
func (*RequestBuilder) ResponseType ¶
func (b *RequestBuilder) ResponseType(rt oidc.ResponseType) *RequestBuilder
func (*RequestBuilder) Scopes ¶
func (b *RequestBuilder) Scopes(scopes []string) *RequestBuilder
func (*RequestBuilder) State ¶
func (b *RequestBuilder) State(state string) *RequestBuilder
func (*RequestBuilder) Subject ¶
func (b *RequestBuilder) Subject(subject string) *RequestBuilder
type RequestID ¶
type RequestID = idx.ID[RequestIDType]
func NewRequestID ¶
func NewRequestID() RequestID
func RequestIDFrom ¶
type RequestIDType ¶
type RequestIDType struct{}
func (RequestIDType) Type ¶
func (a RequestIDType) Type() string
type RequestRepo ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) AuthRequestByCode ¶
func (*Storage) AuthRequestByID ¶
func (*Storage) AuthRequestBySubject ¶
func (*Storage) AuthorizeClientIDSecret ¶
func (*Storage) CompleteAuthRequest ¶
func (*Storage) CreateAccessAndRefreshTokens ¶
func (*Storage) CreateAccessToken ¶
func (*Storage) CreateAuthRequest ¶
func (s *Storage) CreateAuthRequest(ctx context.Context, authReq *oidc.AuthRequest, _ string) (op.AuthRequest, error)
func (*Storage) DeleteAuthRequest ¶
func (*Storage) GetClientByClientID ¶
func (*Storage) GetKeyByIDAndUserID ¶
func (*Storage) GetPrivateClaimsFromScopes ¶
func (*Storage) GetSigningKey ¶
func (*Storage) RevokeToken ¶
func (*Storage) SaveAuthCode ¶
func (*Storage) SetIntrospectionFromToken ¶
func (*Storage) SetUserinfoFromScopes ¶
func (*Storage) SetUserinfoFromToken ¶
func (*Storage) TerminateSession ¶
func (*Storage) TokenRequestByRefreshToken ¶
type StorageConfig ¶
type StorageConfig struct { ClientID string ClientDomain string Domain string Dev bool DN *DNConfig ConfigRepo ConfigRepo RequestRepo RequestRepo UserInfoSetter UserInfoProvider AudienceForTest string Issuer string }
type UserInfoProvider ¶
Click to show internal directories.
Click to hide internal directories.