mapping

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoleAuthMapping

func RoleAuthMapping(roleAuths *RoleAuthBody, cmData map[string]string) *rbacv1.ClusterRole

RoleAuthMapping mapping RoleAuthBody as ClusterRole by configmap data.

Types

type AuthItem

type AuthItem struct {
	Verb      VerbRepresent            `json:"verb"`
	Resources map[string]VerbRepresent `json:"resources,omitempty"`
}

type ClusterRoleSplit

type ClusterRoleSplit map[string]VerbRepresent

ClusterRoleSplit holds the result of ClusterRole.

func SplitClusterRole

func SplitClusterRole(clusterRole *rbacv1.ClusterRole) ClusterRoleSplit

SplitClusterRole split ClusterRole as into format: deployments: All services: Read clusters: Write

type RoleAuthBody

type RoleAuthBody struct {
	ClusterRoleName string              `json:"clusterRoleName,omitempty"`
	Scope           string              `json:"scope"`
	AuthItems       map[string]AuthItem `json:"authItems"`
}

RoleAuthBody the another transformed form of ClusterRole.

func ClusterRoleMapping

func ClusterRoleMapping(clusterRole *rbacv1.ClusterRole, cmData map[string]string, verbose bool) *RoleAuthBody

ClusterRoleMapping mappings ClusterRole as RoleAuthBody by configmap data. cmData format as: deployments: "deployments;pods;replicasets;pods/status;deployments/status" services: "services;endpoints;pods"

type VerbRepresent

type VerbRepresent string
const (
	Null  VerbRepresent = "null"
	Read  VerbRepresent = "read"
	Write VerbRepresent = "write"
	All   VerbRepresent = "all"
)

Jump to

Keyboard shortcuts

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