Versions in this module Expand all Collapse all v0 v0.0.4 May 9, 2023 Changes in this version + const BitsPerByte + const CookiePrefix + const MaxSessionAge + const MaxSessionKeyLength + const SessionKeyBitLength + const StateKeyBitLength + var ErrAlgorithmValidationFailed = errors.New("algorithm validation failed") + var ErrMissingAuthorizationHeader = errors.New("missing authorization header") + var ErrMissingSessionID = errors.New("missing session id") + var ErrNotFound = errors.New("not found") + var ErrSessionTokenTooLong = errors.New("session token too long") + var ErrStateMismatch = errors.New("state mismatch") + var ErrTokenHeaderMissing = errors.New("token header missing") + var ErrUnknownIssuer = errors.New("unknown issuer") + type Authorizer struct + func NewAuthorizer(signingKey *jose.SigningKey, opts ...Option) *Authorizer + func (authorizer *Authorizer) Apply(server *cachaca.Server) error + func (authorizer *Authorizer) AuthorizeGrpc(ctx context.Context) (context.Context, error) + func (authorizer *Authorizer) AuthorizeHTTP(ctx *gin.Context) error + func (authorizer *Authorizer) RegisterRelyingParty(name string, relyingParty rp.RelyingParty) + type Credentials struct + func (c *Credentials) GetCustomClaims(claims ...interface{}) error + func (c *Credentials) GetProvider() rp.RelyingParty + func (c *Credentials) GetSession(ctx context.Context) (*Session, error) + func (c *Credentials) Refresh(ctx context.Context) error + type MemoryStorage struct + func NewMemoryStorage() *MemoryStorage + func (s *MemoryStorage) Delete(_ context.Context, sessionID string) error + func (s *MemoryStorage) Get(_ context.Context, sessionID string) (*Session, error) + func (s *MemoryStorage) Set(_ context.Context, session *Session) error + type Option interface + func WithCallbackURL(url string) Option + func WithErrorURL(url string) Option + func WithLoginURL(url string) Option + func WithLogoutURL(url string) Option + func WithStorage(storage Storage) Option + func WithSuccessURL(url string) Option + func WithTokenCallback(tokenCallback SessionCallbackFunc) Option + type RedisStorage struct + func NewRedisStorage(client rueidis.Client, cacheTimeout time.Duration) *RedisStorage + func (s *RedisStorage) Delete(ctx context.Context, sessionID string) error + func (s *RedisStorage) Get(ctx context.Context, sessionID string) (*Session, error) + func (s *RedisStorage) Set(ctx context.Context, session *Session) error + type Session struct + ID string + Issuer string + UserInfo *oidc.UserInfo + func NewSessionFromCodeExchange(ctx context.Context, code string, provider rp.RelyingParty) (*Session, error) + type SessionCallbackFunc func(ctx context.Context, session *Session) (interface{}, error) + type Storage interface + Delete func(ctx context.Context, sessionID string) error + Get func(ctx context.Context, sessionID string) (*Session, error) + Set func(ctx context.Context, session *Session) error + type StorageOptions struct + type TokenCallBackOptions struct + type URLOptions struct