authz

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/Axot017/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Package authz contains unit and benchmark tests for authz use-cases The public (non-test) APIs are meant to be used as helpers for other tests to build off of.

Index

Constants

View Source
const (
	ForbidIdentity = v1.ForbidIdentity
	ForbidPath     = v1.ForbidPath
	ForbidMethod   = v1.ForbidMethod
	Allow          = v1.Allow
)

InputMode types supported by GenerateInput

View Source
const AllowQuery = v1.AllowQuery

AllowQuery is the test query that goes with the Policy defined in this package

View Source
const Policy = v1.Policy

Policy is a test rego policy for a token based authz system

Variables

This section is empty.

Functions

func GenerateDataset

func GenerateDataset(profile DataSetProfile) map[string]any

GenerateDataset will generate a dataset for the given DatasetProfile

func GenerateInput

func GenerateInput(profile DataSetProfile, mode InputMode) (any, any)

GenerateInput will use a dataset profile and desired InputMode to generate inputs for testing

Types

type DataSetProfile

type DataSetProfile = v1.DataSetProfile

DataSetProfile defines how the test data should be generated

type InputMode

type InputMode = v1.InputMode

InputMode defines what type of inputs to generate for testings

Jump to

Keyboard shortcuts

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