authzmatrix

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package authzmatrix loads the authn/authz expectation matrix kept in docs/security/authz-matrix.json and applies a role's credentials to a test request. The services' conformance tests use it to check every route against the documented allow and deny outcome for anonymous, user, admin and ingest callers.

Index

Constants

View Source
const (
	RoleAnon      = "anon"
	RoleUserKey   = "user-key"
	RoleAdminKey  = "admin-key"
	RoleIngestKey = "ingest-key"
)

Variables

This section is empty.

Functions

func ApplyRole

func ApplyRole(req *http.Request, role string, keys map[string]string)

ApplyRole sets request credentials for a matrix role using test key aliases.

Types

type Row

type Row struct {
	Service             string `json:"service"`
	Path                string `json:"path"`
	Method              string `json:"method"`
	Role                string `json:"role"`
	Expect              int    `json:"expect,omitempty"`
	ExpectAuthenticated bool   `json:"expect_authenticated,omitempty"`
}

Row is one authn/authz expectation from docs/security/authz-matrix.json.

func Filter

func Filter(rows []Row, service string) []Row

Filter returns rows owned by service.

func Load

func Load(path string) ([]Row, error)

Load reads the machine-readable authz matrix from path.

Jump to

Keyboard shortcuts

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