package rbac

import "google.golang.org/grpc/internal/xds/rbac"

Package rbac provides service-level and method-level access control for a service. See https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/rbac/v3/rbac.proto#role-based-access-control-rbac for documentation.

Index

Types

type ChainEngine

type ChainEngine struct {
	// contains filtered or unexported fields
}

ChainEngine represents a chain of RBAC Engines, used to make authorization decisions on incoming RPCs.

func NewChainEngine

func NewChainEngine(policies []*v3rbacpb.RBAC, policyName string) (*ChainEngine, error)

NewChainEngine returns a chain of RBAC engines, used to make authorization decisions on incoming RPCs. Returns a non-nil error for invalid policies.

func (*ChainEngine) IsAuthorized

func (cre *ChainEngine) IsAuthorized(ctx context.Context) error

IsAuthorized determines if an incoming RPC is authorized based on the chain of RBAC engines and their associated actions.

Errors returned by this function are compatible with the status package.

Source Files

converter.go matchers.go rbac_engine.go

Version
v1.70.0 (latest)
Published
Jan 23, 2025
Platform
linux/amd64
Imports
31 packages
Last checked
20 hours ago

Tools for package owners.