auth

package
v0.0.0-...-5e5371a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

This section is empty.

Types

type Enforcer

type Enforcer interface {
	RequireLogin(next echo.HandlerFunc) echo.HandlerFunc
	SignInHandler(c *echo.Context) error
	SignOutHandler(c *echo.Context) error
	UserInfoHandler(c *echo.Context) error
	CallbackHandler(c *echo.Context) error
}

type LocalEnforcer

type LocalEnforcer struct {
	UserInfo UserInfo
}

func NewLocalEnforcer

func NewLocalEnforcer() *LocalEnforcer

func (*LocalEnforcer) CallbackHandler

func (l *LocalEnforcer) CallbackHandler(c *echo.Context) error

func (*LocalEnforcer) RequireLogin

func (l *LocalEnforcer) RequireLogin(next echo.HandlerFunc) echo.HandlerFunc

func (*LocalEnforcer) SignInHandler

func (l *LocalEnforcer) SignInHandler(c *echo.Context) error

func (*LocalEnforcer) SignOutHandler

func (l *LocalEnforcer) SignOutHandler(c *echo.Context) error

func (*LocalEnforcer) UserInfoHandler

func (l *LocalEnforcer) UserInfoHandler(c *echo.Context) error

type OIDCClient

type OIDCClient struct {
	// contains filtered or unexported fields
}

func NewOIDC

func NewOIDC(ctx context.Context, issuer, clientID, clientSecret, redirectURI, key string) (*OIDCClient, error)

NewOIDC returns a new OIDCClient

func (*OIDCClient) CallbackHandler

func (o *OIDCClient) CallbackHandler(c *echo.Context) error

CallbackHandler handles the auth callback from route /oauth2/callback

func (*OIDCClient) RequireLogin

func (o *OIDCClient) RequireLogin(next echo.HandlerFunc) echo.HandlerFunc

Middleware: require valid ID token with JWKS signature verification.

func (*OIDCClient) SignInHandler

func (o *OIDCClient) SignInHandler(c *echo.Context) error

SignInHandler initiates the authentication /oauth2/sign_in

func (*OIDCClient) SignOutHandler

func (o *OIDCClient) SignOutHandler(c *echo.Context) error

SignOutHandler handles the signout /oauth2/sign_out

func (*OIDCClient) UserInfoHandler

func (o *OIDCClient) UserInfoHandler(c *echo.Context) error

UserInfoHandler retrieves user information from the ID token and returns it as JSON.

func (*OIDCClient) WithFirstUserBootstrap

func (o *OIDCClient) WithFirstUserBootstrap(bootstrap func(context.Context, string, identity.Actor) error)

func (*OIDCClient) WithUserRepository

func (o *OIDCClient) WithUserRepository(repo outbound.UserRepository)

WithUserRepository attaches a UserRepository so profiles are upserted on login.

type UserInfo

type UserInfo struct {
	User              string `json:"user"`
	Name              string `json:"name,omitempty"`
	Email             string `json:"email"`
	PreferredUsername string `json:"preferredUsername"`
	IDToken           string `json:"idToken"`
	AccessToken       string `json:"-"`
	RefreshToken      string `json:"-"`
	SessionID         string `json:"-"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL