policy

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionRule

type ActionRule struct {
	Method          string       `json:"method"`
	Endpoint        string       `json:"endpoint"`
	ResourceType    string       `json:"resourceType,omitempty"`
	IDRegex         string       `json:"idRegex,omitempty"`
	MatchAttributes []*Attribute `json:"matchAttributes,omitempty"`
}

type Attribute added in v1.7.1

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Client

type Client struct {
	*httpclient.Client
	// contains filtered or unexported fields
}

func NewDefault

func NewDefault() *Client

func NewWithRetry added in v1.8.0

func NewWithRetry() *Client

func (*Client) CreateOrUpdatePolicyRegistration added in v1.10.0

func (c *Client) CreateOrUpdatePolicyRegistration(p *PolicyMeta) error

func (*Client) CreateOrUpdateRoleBinding

func (c *Client) CreateOrUpdateRoleBinding(projectName string, roleBinding *RoleBinding) error

func (*Client) CreateOrUpdateSystemRoleBinding

func (c *Client) CreateOrUpdateSystemRoleBinding(roleBinding *RoleBinding) error

func (*Client) CreatePolicies added in v1.10.0

func (c *Client) CreatePolicies(ns string, request CreatePoliciesArgs) error

func (*Client) CreatePolicyBinding added in v1.10.0

func (c *Client) CreatePolicyBinding(projectName string, policyBindings []*PolicyBinding) error

func (*Client) CreatePresetRole added in v1.10.0

func (c *Client) CreatePresetRole(name string, role *Role) error

func (*Client) CreateSystemRole

func (c *Client) CreateSystemRole(name string, role *Role) error

func (*Client) DeletePolicies added in v1.10.0

func (c *Client) DeletePolicies(ns string, request DeletePoliciesArgs) error

func (*Client) DeletePolicyBindings added in v1.10.0

func (c *Client) DeletePolicyBindings(names []string, projectName string) error

func (*Client) DeleteRoleBinding

func (c *Client) DeleteRoleBinding(name string, projectName string) error

func (*Client) DeleteRoleBindings

func (c *Client) DeleteRoleBindings(names []string, projectName string) error

func (*Client) DeleteRoles

func (c *Client) DeleteRoles(names []string, projectName string) error

func (*Client) GetPolicies added in v1.10.0

func (c *Client) GetPolicies(names string) ([]*Policy, error)

func (*Client) GetResourcePermission added in v1.10.0

func (c *Client) GetResourcePermission(req *ResourcePermissionReq) (map[string][]string, error)

func (*Client) Healthz added in v1.7.1

func (c *Client) Healthz() error

func (*Client) ListRoleBindings

func (c *Client) ListRoleBindings(projectName string) ([]*RoleBinding, error)

func (*Client) UpdatePolicy added in v1.10.0

func (c *Client) UpdatePolicy(ns string, policy *Policy) error

type CreatePoliciesArgs added in v1.10.0

type CreatePoliciesArgs struct {
	Policies []*Policy `json:"policies"`
}

type DeletePoliciesArgs added in v1.10.0

type DeletePoliciesArgs struct {
	Names []string `json:"names"`
}

type MatchAttribute added in v1.10.0

type MatchAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type NameArgs

type NameArgs struct {
	Names []string `json:"names"`
}

type Policy

type Policy struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	UpdateTime  int64   `json:"update_time"`
	Rules       []*Rule `json:"rules"`
}

type PolicyBinding added in v1.10.0

type PolicyBinding struct {
	Name   string               `json:"name"`
	UID    string               `json:"uid"`
	Policy string               `json:"policy"`
	Preset bool                 `json:"preset"`
	Type   setting.ResourceType `json:"type"`
}

type PolicyMeta added in v1.10.0

type PolicyMeta struct {
	Resource    string      `json:"resource"`
	Alias       string      `json:"alias"`
	Description string      `json:"description"`
	Rules       []*RuleMeta `json:"rules"`
}

type ResourcePermissionReq added in v1.10.0

type ResourcePermissionReq struct {
	ProjectName  string   `json:"project_name"      form:"project_name"`
	Uid          string   `json:"uid"               form:"uid"`
	Resources    []string `json:"resources"         form:"resources"`
	ResourceType string   `json:"resource_type"     form:"resource_type"`
}

type Role

type Role struct {
	Name  string               `json:"name"`
	Type  setting.ResourceType `json:"type"`
	Rules []*struct {
		Verbs           []string         `json:"verbs"`
		Resources       []string         `json:"resources"`
		Kind            string           `json:"kind"`
		MatchAttributes []MatchAttribute `json:"match_attributes,omitempty"`
	} `json:"rules"`
}

type RoleBinding

type RoleBinding struct {
	Name   string               `json:"name"`
	UID    string               `json:"uid"`
	Role   string               `json:"role"`
	Preset bool                 `json:"preset"`
	Type   setting.ResourceType `json:"type"`
}

type Rule

type Rule struct {
	Verbs           []string         `json:"verbs"`
	Resources       []string         `json:"resources"`
	Kind            string           `json:"kind"`
	MatchAttributes []MatchAttribute `json:"match_attributes"`
}

type RuleMeta added in v1.10.0

type RuleMeta struct {
	Action      string        `json:"action"`
	Alias       string        `json:"alias"`
	Description string        `json:"description"`
	Rules       []*ActionRule `json:"rules"`
}

Jump to

Keyboard shortcuts

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