Documentation
¶
Overview ¶
Package session implements RUNE-201 refresh-token rotation with a grace window. It is transport-neutral: both the browser-facing HTTP cookie endpoint (pkg/api/server) and the CLI-facing gRPC AuthService.Refresh RPC (pkg/api/service) drive the same Manager instance, so the in-memory grace cache is shared across both surfaces. Living in its own package avoids a service↔server import cycle.
Index ¶
Constants ¶
View Source
const ( DefaultAccessTTL = 15 * time.Minute DefaultRefreshTTL = 30 * 24 * time.Hour // sliding idle window DefaultGraceWindow = 30 * time.Second // tolerate concurrent-refresh races )
RUNE-201 session parameters. Defaults; promoted to config later if needed.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
AccessTTL time.Duration
RefreshTTL time.Duration
GraceWindow time.Duration
// contains filtered or unexported fields
}
Manager implements refresh-token rotation with a grace window. Rotations are serialized by mu to keep the cache and the store consistent (single-server MVP; refresh volume is low).
Click to show internal directories.
Click to hide internal directories.