session

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionManager

type SessionManager interface {
	Create(ctx context.Context, identity auth.Identity) (auth.Session, error)
	Validate(ctx context.Context, token string) (auth.Session, error)
	Revoke(ctx context.Context, token string) error
}

SessionManager manages session lifecycle after authentication. Implementations decide how tokens are generated and where state is stored.

Strategy examples:

  • Server-side session: crypto-random token stored in Redis.
  • JWT: signed token with claims; Validate decodes without server state.
  • Access+refresh: dual tokens with separate lifetimes.

func NewServerSessionManager

func NewServerSessionManager(
	tracer observability.Tracer,
	meter observability.Meter,
	sessionRepo repokvstore.SessionRepository,
	ttl time.Duration,
) SessionManager

NewServerSessionManager creates a server-side session manager.

Jump to

Keyboard shortcuts

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