internaloauthsessions

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSessionNotFound = errors.New("session not found")

Functions

This section is empty.

Types

type Payload

type Payload struct {
	Nonce        string            `json:"nonce"`
	PKCEVerifier string            `json:"pkce_verifier"`
	Origin       string            `json:"origin"`
	Params       map[string]string `json:"params"`
}

type Repository

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

func NewRepository

func NewRepository(db storage.Database) *Repository

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, session Session) (*Session, error)

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, key string) error

func (*Repository) FindUnexpired

func (r *Repository) FindUnexpired(ctx context.Context, key string) (*Session, bool, error)

type Session

type Session struct {
	Key       string // Key is the oAuth state parameter passed in
	Payload   Payload
	CreatedAt time.Time
	ExpiresAt time.Time
}

func NewSession

func NewSession(key string, payload Payload) *Session

type SessionRepository

type SessionRepository interface {
	Create(ctx context.Context, session Session) (*Session, error)
	FindUnexpired(ctx context.Context, key string) (*Session, bool, error)
	Delete(ctx context.Context, key string) error
}

SessionRepository is the interface the Handler depends on, allowing a mock to be injected in tests.

Jump to

Keyboard shortcuts

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