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

httpsecurity

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func New

func New(verifier auth.Verifier, tenants TenantResolver) (*Middleware, error)

func (*Middleware) Protect

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

Protect authenticates the bearer token, resolves one tenant scope and only then calls the protected handler with both principal and tenancy context set.

type TenantResolver

type TenantResolver interface {
	ResolveTenant(context.Context, *identity.Principal) (*tenancy.Context, error)
}

TenantResolver converts one verified principal into exactly one tenant scope. Implementations must fail closed on missing or ambiguous memberships.

Jump to

Keyboard shortcuts

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