authorization

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authzed added in v0.12.0

type Authzed struct {
	Endpoint     string
	Insecure     bool
	SharedSecret string

	Subject      json.JSONValue
	SubjectKind  json.JSONValue
	Resource     json.JSONValue
	ResourceKind json.JSONValue
	Permission   json.JSONValue
}

func (*Authzed) Call added in v0.12.0

func (a *Authzed) Call(pipeline auth.AuthPipeline, ctx gocontext.Context) (interface{}, error)

type JSONPatternMatching

type JSONPatternMatching struct {
	Rules jsonexp.Expression
}

func (*JSONPatternMatching) Call

func (j *JSONPatternMatching) Call(pipeline auth.AuthPipeline, ctx context.Context) (interface{}, error)

type KubernetesAuthz

type KubernetesAuthz struct {
	User               json.JSONValue
	Groups             []string
	ResourceAttributes *KubernetesAuthzResourceAttributes
	// contains filtered or unexported fields
}

func NewKubernetesAuthz

func NewKubernetesAuthz(user json.JSONValue, groups []string, resourceAttributes *KubernetesAuthzResourceAttributes) (*KubernetesAuthz, error)

func (*KubernetesAuthz) Call

func (k *KubernetesAuthz) Call(pipeline auth.AuthPipeline, ctx gocontext.Context) (interface{}, error)

type KubernetesAuthzResourceAttributes

type KubernetesAuthzResourceAttributes struct {
	Namespace   json.JSONValue
	Group       json.JSONValue
	Resource    json.JSONValue
	Name        json.JSONValue
	SubResource json.JSONValue
	Verb        json.JSONValue
}

type OPA

type OPA struct {
	Rego           string `yaml:"rego"`
	ExternalSource *OPAExternalSource
	AllValues      bool
	// contains filtered or unexported fields
}

func NewOPAAuthorization

func NewOPAAuthorization(policyName string, rego string, externalSource *OPAExternalSource, allValues bool, nonce int, ctx context.Context) (*OPA, error)

func (*OPA) Call

func (opa *OPA) Call(pipeline auth.AuthPipeline, ctx context.Context) (interface{}, error)

func (*OPA) Clean

func (opa *OPA) Clean(_ context.Context) error

Clean ensures the goroutine started by ExternalSource.setupRefresher is cleaned up

type OPAExternalSource

type OPAExternalSource struct {
	Endpoint     string
	SharedSecret string
	auth.AuthCredentials
	TTL int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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