Documentation
¶
Index ¶
- Constants
- Variables
- type Allowlist
- type Config
- type Identity
- type IdentityProvider
- type MagicLink
- type MagicLinkConsumption
- type MagicLinkStore
- type Message
- type OIDCConfig
- type Option
- type SMTPConfig
- type Sender
- type Service
- func (s *Service) Authenticate(ctx context.Context, token string) (Session, error)
- func (s *Service) ConsumeLink(ctx context.Context, token string) (string, Session, error)
- func (s *Service) CreateLink(ctx context.Context, email string, next string) (string, time.Time, error)
- func (s *Service) CreateSession(ctx context.Context, email string) (string, Session, error)
- func (s *Service) RequestLink(ctx context.Context, email string, next string) error
- func (s *Service) SecureCookie() bool
- type Session
- type SessionConfig
- type SessionRecord
- type SessionStore
- type Store
Constants ¶
View Source
const IdentityProviderOIDC = "oidc"
Variables ¶
View Source
var ( ErrOIDCExchange = errors.New("oidc authorization code exchange failed") ErrOIDCInvalidToken = errors.New("oidc ID token is invalid") ErrOIDCInvalidNonce = errors.New("oidc nonce is invalid") ErrOIDCMissingEmail = errors.New("oidc ID token does not contain an email") ErrOIDCUnverifiedEmail = errors.New("oidc email is not verified") )
View Source
var ( ErrEmailNotAllowed = errors.New("email is not allowed") ErrInvalidLink = errors.New("magic link is invalid or expired") ErrInvalidSession = errors.New("web session is invalid or expired") ErrMissingStore = errors.New("auth store is required") ErrMissingSender = errors.New("magic link sender is required") )
Functions ¶
This section is empty.
Types ¶
type Allowlist ¶ added in v0.48.0
type Allowlist struct {
// contains filtered or unexported fields
}
func NewAllowlist ¶ added in v0.48.0
type IdentityProvider ¶ added in v0.48.0
type IdentityProvider interface {
AuthorizationURL(state string, nonce string, verifier string) string
Exchange(context.Context, string, string, string) (Identity, error)
}
func NewIdentityProvider ¶ added in v0.48.0
func NewIdentityProvider(ctx context.Context, provider string, cfg OIDCConfig) (IdentityProvider, error)
type MagicLinkConsumption ¶
type MagicLinkStore ¶ added in v0.48.0
type OIDCConfig ¶ added in v0.48.0
type SMTPConfig ¶
type Sender ¶
func NewSMTPSender ¶
func NewSMTPSender(cfg SMTPConfig) (Sender, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewSessionService ¶ added in v0.48.0
func NewSessionService(cfg SessionConfig, store SessionStore, opts ...Option) (*Service, error)
func (*Service) Authenticate ¶
func (*Service) ConsumeLink ¶
func (*Service) CreateLink ¶
func (*Service) CreateSession ¶
func (*Service) RequestLink ¶
func (*Service) SecureCookie ¶
type SessionConfig ¶ added in v0.48.0
type SessionRecord ¶
type SessionStore ¶ added in v0.48.0
type Store ¶
type Store interface {
SessionStore
MagicLinkStore
}
Click to show internal directories.
Click to hide internal directories.