rbac

package
v2.2.12-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceID = "namespaceId"
	ProjectID   = "projectId"
	ClusterID   = "clusterId"
)

Variables

This section is empty.

Functions

func BuildSubjectFromRTB

func BuildSubjectFromRTB(object interface{}) (rbacv1.Subject, error)

BuildSubjectFromRTB This function will generate PRTB and CRTB to the subject with user, group or service account

func ObjFromContext

func ObjFromContext(apiContext *types.APIContext, resource *types.RawResource) map[string]interface{}

ObjFromContext returns object with available information to check against users permissions, used in combination with CanDo

Types

type AccessControl

type AccessControl struct {
	authorization.AllAccess
	// contains filtered or unexported fields
}

func NewAccessControl

func NewAccessControl(rbacClient v1.Interface) *AccessControl

func (*AccessControl) CanDo

func (a *AccessControl) CanDo(apiGroup, resource, verb string, apiContext *types.APIContext, obj map[string]interface{}, schema *types.Schema) error

func (*AccessControl) Filter

func (a *AccessControl) Filter(apiContext *types.APIContext, schema *types.Schema, obj map[string]interface{}, context map[string]string) map[string]interface{}

func (*AccessControl) FilterList

func (a *AccessControl) FilterList(apiContext *types.APIContext, schema *types.Schema, objs []map[string]interface{}, context map[string]string) []map[string]interface{}

type ListPermission

type ListPermission struct {
	Namespace string
	Name      string
}

type ListPermissionSet

type ListPermissionSet map[ListPermission]bool

func (ListPermissionSet) HasAccess

func (l ListPermissionSet) HasAccess(namespace, name string) bool

type ListPermissionStore

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

func NewListPermissionStore

func NewListPermissionStore(client v1.Interface) *ListPermissionStore

func (*ListPermissionStore) GroupPermissions

func (l *ListPermissionStore) GroupPermissions(subjectName, apiGroup, resource, verb string) ListPermissionSet

func (*ListPermissionStore) UserPermissions

func (l *ListPermissionStore) UserPermissions(subjectName, apiGroup, resource, verb string) ListPermissionSet

Jump to

Keyboard shortcuts

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