types

package
v0.0.0-...-d125d34 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIGroupAll    = "*"
	ResourceAll    = "*"
	VerbAll        = "*"
	ScopeAll       = "*"
	NonResourceAll = "*"
)

attention: rbac is refers to the kubernetes rbac copy core struct and logics from the kubernetes code and do same modify

Variables

This section is empty.

Functions

func APIGroupMatches

func APIGroupMatches(rule *PolicyRule, requestedAPIGroup string) bool

func NonResourceURLMatches

func NonResourceURLMatches(rule *PolicyRule, requestedURL string) bool

func ResourceMatches

func ResourceMatches(rule *PolicyRule, combinedRequestedResource, requestedSubresource string) bool

func RuleAllow

func RuleAllow(attribute auth.Attributes, rule *PolicyRule) bool

func ScopeMatches

func ScopeMatches(rule *PolicyRule, requestScope string) bool

func VerbMatches

func VerbMatches(rule *PolicyRule, requestedVerb string) bool

Types

type PolicyRule

type PolicyRule struct {
	Verbs           []string `yaml:"verbs" json:"verbs"`
	APIGroups       []string `yaml:"apiGroups" json:"apiGroups"`
	Resources       []string `yaml:"resources" json:"resources"`
	Scopes          []string `yaml:"scopes" json:"scopes"`
	NonResourceURLs []string `yaml:"nonResourceURLs" json:"nonResourceURLs"`
}

type Role

type Role struct {
	Name        string       `yaml:"name" json:"name"`
	Desc        string       `yaml:"desc" json:"desc"`
	PolicyRules []PolicyRule `yaml:"rules" json:"rules"`
}

Jump to

Keyboard shortcuts

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