auth

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionCookieName = "gocron_session"
)

Variables

View Source
var (
	ErrUnauthenticated     = errors.New("not authenticated")
	ErrProviderUnavailable = errors.New("identity provider is not reachable")
)

Functions

This section is empty.

Types

type Auth

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

func New

func New(sessions SessionStore) *Auth

func (*Auth) Authenticate

func (a *Auth) Authenticate(c *echo.Context) (*User, error)

func (*Auth) ClearSessionCookie

func (a *Auth) ClearSessionCookie() *http.Cookie

func (*Auth) ConsumeLoginState

func (a *Auth) ConsumeLoginState(c *echo.Context) (string, string, error)

func (*Auth) Enabled

func (a *Auth) Enabled() bool

func (*Auth) Exchange

func (a *Auth) Exchange(c *echo.Context, code, verifier string) (string, error)

func (*Auth) Logout

func (a *Auth) Logout(c *echo.Context) error

func (*Auth) LogoutURL added in v0.13.1

func (a *Auth) LogoutURL() string

func (*Auth) Middleware

func (a *Auth) Middleware() echo.MiddlewareFunc

func (*Auth) SessionCookie

func (a *Auth) SessionCookie(value string, expiresAt time.Time) *http.Cookie

func (*Auth) SessionTTL

func (a *Auth) SessionTTL() time.Duration

func (*Auth) Shutdown

func (a *Auth) Shutdown()

func (*Auth) StartLogin

func (a *Auth) StartLogin(c *echo.Context) error

func (*Auth) StartSession

func (a *Auth) StartSession(c *echo.Context, subject string, expiresAt time.Time) error

type SessionStore

type SessionStore interface {
	CreateSession(ctx context.Context, arg jobs.CreateSessionParams) error
	GetActiveSession(ctx context.Context, arg jobs.GetActiveSessionParams) (jobs.Session, error)
	DeleteSession(ctx context.Context, jti string) error
	DeleteExpiredSessions(ctx context.Context, expiresAt int64) error
}

type User

type User struct {
	Subject string `json:"subject"`
}

Jump to

Keyboard shortcuts

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