Documentation
¶
Overview ¶
Package authenticationtest provides a test-double authenticator that skips real IAM: it decodes the actor from the bearer token and resolves the user through a caller-supplied lookup, so the double carries no persistence dependency.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator[U any] struct { // contains filtered or unexported fields }
Authenticator decodes the bearer token as a base64-encoded JSON Actor and resolves the user via lookup. The lookup owns persistence concerns (querying, not-found mapping), keeping this double free of any storage dependency.
func (*Authenticator[U]) Authenticate ¶
func (a *Authenticator[U]) Authenticate(ctx context.Context, token string) (*authorization.Actor, *U, error)
func (*Authenticator[U]) EnsureRoles ¶
func (a *Authenticator[U]) EnsureRoles( _ context.Context, _ string, actor *authorization.Actor, ) (*authorization.Actor, error)
EnsureRoles is a no-op: the token already encodes the full actor, including its permissions and admin flag.
Click to show internal directories.
Click to hide internal directories.