Help us shape the future of Go! Take the 2026 Go Developer Survey

auth

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package auth provides test-owned production authentication scopes. It never installs an authenticated model directly or bypasses a verifier or policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Require

func Require[M any](t testing.TB, scope *foundryauth.Scope, guard foundryauth.Guard[M]) M

Require asserts a successfully authenticated concrete model through the real guard. Policy checks remain explicit; this helper does not authorize resources. For rejection assertions call guard.Require(scope.Context()) directly instead.

func Scope

func Scope(t testing.TB, registry *foundryauth.Registry, inputs ...foundryauth.Credential) *foundryauth.Scope

Scope freezes ordinary credential inputs and registers cleanup with the test. Use real session/token credentials for integration tests, or an explicitly declared test strategy for a focused provider/policy test. The production registry still owns verification, eligibility, limits and declaration identity. Empty inputs create an anonymous scope, useful for rejection/optional tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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