authn

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

func HasScope

func HasScope(scopes []string, required string) bool

func HasScopeOrDelegation

func HasScopeOrDelegation(ctx context.Context, db *pgxpool.Pool, agent *AgentIdentity, requiredScope string, dctx DelegationContext) (bool, bool, error)

func LogAuthEvent

func LogAuthEvent(ctx context.Context, db *pgxpool.Pool, service, endpoint, principalID, actorID, reason string, details map[string]any)

func LogAuthFailure

func LogAuthFailure(ctx context.Context, db *pgxpool.Pool, service, endpoint, principalID, actorID, reason string, details map[string]any)

Types

type AgentIdentity

type AgentIdentity struct {
	ActorID     string
	PrincipalID string
	Scopes      []string
}

func AuthenticateAgentBearer

func AuthenticateAgentBearer(ctx context.Context, db *pgxpool.Pool, authorization string) (*AgentIdentity, error)

type DelegationContext

type DelegationContext struct {
	Capability string
	TemplateID string
	RiskLevel  string
}

Jump to

Keyboard shortcuts

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