Version: v0.9.2 Latest Latest

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 0



Package rbac implements Envoy XDS RBAC policies.



This section is empty.


This section is empty.


func GetAuthenticatedPrincipal added in v0.7.0

func GetAuthenticatedPrincipal(principalName string) *xds_rbac.Principal

GetAuthenticatedPrincipal returns an authenticated RBAC principal object for the given principal

func GetDestinationPortPermission added in v0.7.0

func GetDestinationPortPermission(port uint32) *xds_rbac.Permission

GetDestinationPortPermission returns an RBAC permission for the given destination port


type Policy

type Policy struct {
	Permissions []RulesList
	Principals  []RulesList

Policy is a type used to represent an RBAC policy with rules corresponding to Principals and their associated Permissions

func (*Policy) Generate

func (p *Policy) Generate() (*xds_rbac.Policy, error)

Generate constructs an RBAC policy for the policy object on which this method is called

type Rule

type Rule struct {
	Attribute RuleAttribute
	Value     string

Rule is a type that can represent a policy's Permission and Principal rules

type RuleAttribute

type RuleAttribute string

RuleAttribute is the key used for the name of an attribute in a policy Rule

const (
	// DestinationPort is the key used for the destination port as a permission in a policy Rule
	DestinationPort RuleAttribute = "destinationPort"

Supported attributes for an RBAC permission

const (
	// DownstreamAuthPrincipal is the key used for the name of the downstream principal in a policy Rule
	DownstreamAuthPrincipal RuleAttribute = "downstreamAuthPrincipal"

Supported attributes for an RBAC principal

type RulesList

type RulesList struct {
	AndRules []Rule
	OrRules  []Rule

RulesList is a list of Rule types represented using AND or OR semantics

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL