session

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package session is relay's cookie session layer: the auth module's session manager over a kv.Store, so every pod sharing the store shares the sessions.

kv ops: a request carrying the cookie does one Get; one that changes its session adds a Set. Login adds a Set for the per-user index entry; DestroyUser does one Range plus two Dels per session.

Out of scope: verifying credentials (internal/identity) and deciding access (app/authz).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager = authsession.Manager

Manager is the session layer: Middleware loads the session, Login/Logout/DestroyUser change it, and Authenticate reads the caller from it.

func New

func New(store kv.Store, secure bool, keyPrefix string) *Manager

New returns a Manager keeping sessions in store under keyPrefix (e.g. "sess:", so they don't collide with other kv consumers). secure marks the cookie HTTPS-only, which every deployment but local dev wants. Its callers' subjects carry no local groups; NewWithGroups adds them.

func NewWithGroups added in v0.10.8

func NewWithGroups(store kv.Store, secure bool, keyPrefix string, groupsOf func(userID string) []string) *Manager

NewWithGroups is New with groupsOf naming each user's local groups, which their subjects then include.

Jump to

Keyboard shortcuts

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