dummy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package dummy provides an Authenticator that decodes the bearer token as a base64-encoded JSON Actor. Useful in tests where no real IAM server is available.

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. For user actors it fetches the full user record via the service-supplied findUser function so callers receive a populated user entity (matching the behavior of the IAM authenticator).

func New

func New[U any](findUser func(ctx context.Context, id uuid.UUID) (*U, error)) *Authenticator[U]

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 dummy token already encodes the full actor, including its permissions and admin flag.

Jump to

Keyboard shortcuts

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