package authz
import "github.com/open-policy-agent/opa/test/authz"
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/open-policy-agent/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
- func GenerateDataset(profile DataSetProfile) map[string]interface{}
- func GenerateInput(profile DataSetProfile, mode InputMode) (interface{}, interface{})
- type DataSetProfile
- type InputMode
Constants ¶
const ( ForbidIdentity = v1.ForbidIdentity ForbidPath = v1.ForbidPath ForbidMethod = v1.ForbidMethod Allow = v1.Allow )
InputMode types supported by GenerateInput
const AllowQuery = v1.AllowQuery
AllowQuery is the test query that goes with the Policy defined in this package
Policy is a test rego policy for a token based authz system
Functions ¶
func GenerateDataset ¶
func GenerateDataset(profile DataSetProfile) map[string]interface{}
GenerateDataset will generate a dataset for the given DatasetProfile
func GenerateInput ¶
func GenerateInput(profile DataSetProfile, mode InputMode) (interface{}, interface{})
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 ¶
InputMode defines what type of inputs to generate for testings
Source Files ¶
- Version
- v1.1.0
- Published
- Jan 27, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 5 seconds ago –
Tools for package owners.