authz

package
v0.0.0-...-bea0022 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JWTKeyAuditContext string = "audit_context"
)

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(Middleware), "*"),
	wire.Struct(new(Adder), "*"),
)
View Source
var MiddlewareLogger = slogutil.NewLogger("admin-api-authz")

Functions

func GetAdminAuthzAudit

func GetAdminAuthzAudit(ctx context.Context) map[string]any

func WithAdminAuthzAudit

func WithAdminAuthzAudit(ctx context.Context, content map[string]any) context.Context

Types

type Adder

type Adder struct {
	Clock clock.Clock
}

func (*Adder) AddAuthz

func (a *Adder) AddAuthz(
	auth config.AdminAPIAuth,
	appID config.AppID,
	authKey *config.AdminAPIAuthKey,
	auditContext interface{},
	hdr http.Header) (err error)

type Middleware

type Middleware struct {
	Auth    config.AdminAPIAuth
	AppID   config.AppID
	AuthKey *config.AdminAPIAuthKey
	Clock   clock.Clock
}

func (*Middleware) Handle

func (m *Middleware) Handle(next http.Handler) http.Handler

type T

type T struct {
	AuditContext map[string]any
}

Jump to

Keyboard shortcuts

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