session

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStateMismatch = errors.New("oauth state mismatch")

Functions

This section is empty.

Types

type Config

type Config struct {
	KeyPrefix       string `json:"key_prefix" yaml:"key_prefix"`
	StateTTL        string `json:"state_ttl" yaml:"state_ttl"`
	BlacklistPrefix string `json:"blacklist_prefix" yaml:"blacklist_prefix"`
}

type Manager

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

func NewManager

func NewManager(rdb redis.UniversalClient, cfg Config, opts ...Option) *Manager

func (*Manager) IsRevoked

func (m *Manager) IsRevoked(ctx context.Context, tokenOrID string) (bool, error)

func (*Manager) NewState

func (m *Manager) NewState(ctx context.Context, subject string) (string, error)

func (*Manager) RevokeToken

func (m *Manager) RevokeToken(ctx context.Context, tokenOrID string, ttl time.Duration) error

func (*Manager) VerifyState

func (m *Manager) VerifyState(ctx context.Context, state string) (string, error)

type Option

type Option func(*Manager)

func WithLogger

func WithLogger(l *slog.Logger) Option

Jump to

Keyboard shortcuts

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