package authz
import "github.com/open-policy-agent/opa/v1/test/authz"
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 ¶
InputMode types supported by GenerateInput
const AllowQuery = "data.policy.restauthz.allow"
AllowQuery is the test query that goes with the Policy defined in this package
const Policy = "" /* 243 byte string literal not displayed */
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 ¶
DataSetProfile defines how the test data should be generated
type InputMode ¶
type InputMode int
InputMode defines what type of inputs to generate for testings
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 3 weeks ago –
Tools for package owners.