local

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package local implements the development authenticator described in the Local Simulator Contract. It never contacts Google, never uses fetch, and has no environment variables or implicit dev-mode switches.

Index

Constants

View Source
const PathSelect = "/local/select"

PathSelect is the POST route that consumes the selected scenario identifier.

View Source
const PathStart = "/local"

PathStart is the GET route that serves the scenario selector.

View Source
const ProviderName = "local"

ProviderName is the stable name exposed to logs and security events.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

Authenticator is a development Authenticator that presents a selector of preconfigured scenarios and issues a normal session for the chosen one.

func New

func New(scenarios []Scenario, store auth.SubjectStore, issuer auth.SessionIssuer, opts ...Option) *Authenticator

New creates a local authenticator. scenarios is copied, the slice must not be mutated after construction. store and issuer are required.

func (*Authenticator) Mount

func (a *Authenticator) Mount(r router.Router)

Mount implements auth.Authenticator.

func (*Authenticator) Name

func (a *Authenticator) Name() string

Name implements auth.Authenticator.

type Option

type Option func(*Authenticator)

Option configures the authenticator.

func WithAfterLogin

func WithAfterLogin(path string) Option

WithAfterLogin sets the redirect target after a successful selection.

type Scenario

type Scenario struct {
	ID     user.SubjectID
	Name   string
	Email  string
	Avatar string
	Roles  []string
}

Scenario is an immutable development identity. RoleLabels are only a transparent description of the already-seeded authorization state; this package never assigns roles.

Jump to

Keyboard shortcuts

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