opa

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInProcessAuthorizer

func NewInProcessAuthorizer(query string, paths []string, opts ...Option) (rbac.Authorizer, error)

NewInProcessAuthorizer creates a new rbac.Authorizer that works in-process.

func NewRESTAuthorizer

func NewRESTAuthorizer(u *url.URL, opts ...Option) rbac.Authorizer

NewRESTAuthorizer creates a new rbac.Authorizer that works against an OPA endpoint.

Types

type Input

type Input struct {
	Groups     []string        `json:"groups"`
	Permission rbac.Permission `json:"permission"`
	Resource   string          `json:"resource"`
	Subject    string          `json:"subject"`
	Tenant     string          `json:"tenant"`
}

Input models the data that is used for OPA input documents.

type Option

type Option func(c *config)

Option modifies the configuration of an OPA authorizer.

func LoggerOption

func LoggerOption(logger log.Logger) Option

LoggerOption sets a custom logger for the authorizer.

func RegistererOption

func RegistererOption(r prometheus.Registerer) Option

RegistererOption sets a Prometheus registerer for the authorizer.

Jump to

Keyboard shortcuts

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