authz

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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 = iota
	ForbidPath     = iota
	ForbidMethod   = iota
	Allow          = iota
)

InputMode types supported by GenerateInput

View Source
const AllowQuery = "data.restauthz.allow"

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

View Source
const Policy = `` /* 213-byte string literal not displayed */

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]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 struct {
	NumTokens int
	NumPaths  int
}

DataSetProfile defines how the test data should be generated

type InputMode

type InputMode int

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