bundle

package
v1.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MethodGet    = http.MethodGet
	MethodPost   = http.MethodPost
	MethodPut    = http.MethodPut
	MethodPatch  = http.MethodPatch
	MethodDelete = http.MethodDelete
)
View Source
const UpdateKey = "opa_bundle"

Variables

Functions

func GenerateOPABundle

func GenerateOPABundle() error

func GetRevision

func GetRevision() string

func NewBundleController

func NewBundleController() *controller

func RefreshOPABundle

func RefreshOPABundle()

Types

type Attribute added in v1.7.1

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Attributes added in v1.7.1

type Attributes []*Attribute

func NewFrom added in v1.10.0

func NewFrom(attrs []models.MatchAttribute) Attributes

func (Attributes) LessOrEqual added in v1.7.1

func (a Attributes) LessOrEqual(other Attributes) bool

type Config added in v1.7.1

type Config struct {
	Bundles   []*ResourceBundleService `json:"bundles"`
	Namespace string                   `json:"namespace"`
}

type ExemptionURLs added in v1.12.0

type ExemptionURLs struct {
	Public     Rules `json:"public"`     // public urls are not controlled by AuthN and AuthZ
	Privileged Rules `json:"privileged"` // privileged urls can only be visited by system admins
	Registered Rules `json:"registered"` // registered urls are the entire list of urls which are controlled by AuthZ, which means that if an url is not in this list, it is not controlled by AuthZ
}

type ResourceBundle added in v1.7.1

type ResourceBundle map[string]resources

func AppendOPAResources added in v1.7.1

func AppendOPAResources(res ResourceBundle, resourceType string, objs []*ResourceSpec) ResourceBundle

func (ResourceBundle) MarshalJSON added in v1.7.1

func (r ResourceBundle) MarshalJSON() ([]byte, error)

type ResourceBundleService added in v1.7.1

type ResourceBundleService struct {
	Endpoint     string `json:"endpoint"`
	ResourceType string `json:"resourceType"`
}

type ResourceSpec added in v1.7.1

type ResourceSpec struct {
	ResourceID  string   `json:"resourceID"`
	ProjectName string   `json:"projectName"`
	Spec        []string `json:"spec"`
}

type Rule added in v1.12.0

type Rule struct {
	Method           string       `json:"method"`
	Endpoint         string       `json:"endpoint"`
	ResourceType     string       `json:"resourceType,omitempty"`
	IDRegex          string       `json:"idRegex,omitempty"`
	MatchAttributes  Attributes   `json:"matchAttributes,omitempty"`
	MatchExpressions []expression `json:"matchExpressions,omitempty"`
}

type Rules added in v1.12.0

type Rules []*Rule

func (Rules) Len added in v1.12.0

func (o Rules) Len() int

func (Rules) Less added in v1.12.0

func (o Rules) Less(i, j int) bool

func (Rules) Swap added in v1.12.0

func (o Rules) Swap(i, j int)

Jump to

Keyboard shortcuts

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