accesscontrol

package
v0.0.0-...-52cadad Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	All = "*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	Namespace    string
	ResourceName string
}

func (Access) Grants

func (a Access) Grants(namespace, name string) bool

type AccessControl

type AccessControl struct {
	SchemaBasedAccess
}

func NewAccessControl

func NewAccessControl() *AccessControl

func (*AccessControl) CanDo

func (a *AccessControl) CanDo(apiOp *types2.APIRequest, resource, verb, namespace, name string) error

func (*AccessControl) CanWatch

func (a *AccessControl) CanWatch(apiOp *types2.APIRequest, schema *types2.APISchema) error

type AccessList

type AccessList []Access

func (AccessList) Grants

func (a AccessList) Grants(namespace, name string) bool

type AccessListByVerb

type AccessListByVerb map[string]AccessList

func GetAccessListMap

func GetAccessListMap(s *types.APISchema) AccessListByVerb

func (AccessListByVerb) All

func (a AccessListByVerb) All(verb string) bool

func (AccessListByVerb) AnyVerb

func (a AccessListByVerb) AnyVerb(verb ...string) bool

func (AccessListByVerb) Granted

func (a AccessListByVerb) Granted(verb string) (result map[string]Resources)

func (AccessListByVerb) Grants

func (a AccessListByVerb) Grants(verb, namespace, name string) bool

type AccessSet

type AccessSet struct {
	ID string
	// contains filtered or unexported fields
}

func (AccessSet) AccessListFor

func (a AccessSet) AccessListFor(verb string, gr schema.GroupResource) (result AccessList)

func (*AccessSet) Add

func (a *AccessSet) Add(verb string, gr schema.GroupResource, access Access)

func (AccessSet) Grants

func (a AccessSet) Grants(verb string, gr schema.GroupResource, namespace, name string) bool

func (*AccessSet) Merge

func (a *AccessSet) Merge(right *AccessSet)

func (*AccessSet) Namespaces

func (a *AccessSet) Namespaces() (result []string)

type AccessSetLookup

type AccessSetLookup interface {
	AccessFor(user user.Info) *AccessSet
}

type AccessStore

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

func NewAccessStore

func NewAccessStore(ctx context.Context, cacheResults bool, router *router.Router) (*AccessStore, error)

func (*AccessStore) AccessFor

func (l *AccessStore) AccessFor(user user.Info) *AccessSet

func (*AccessStore) CacheKey

func (l *AccessStore) CacheKey(user user.Info) string

type Resources

type Resources struct {
	All   bool
	Names sets.String
}

type SchemaBasedAccess

type SchemaBasedAccess struct {
}

func (*SchemaBasedAccess) CanAction

func (*SchemaBasedAccess) CanAction(apiOp *types2.APIRequest, schema *types2.APISchema, name string) error

func (*SchemaBasedAccess) CanCreate

func (*SchemaBasedAccess) CanCreate(apiOp *types2.APIRequest, schema *types2.APISchema) error

func (*SchemaBasedAccess) CanDelete

func (*SchemaBasedAccess) CanDelete(apiOp *types2.APIRequest, obj types2.APIObject, schema *types2.APISchema) error

func (*SchemaBasedAccess) CanDo

func (a *SchemaBasedAccess) CanDo(apiOp *types2.APIRequest, resource, verb, namespace, name string) error

func (*SchemaBasedAccess) CanGet

func (*SchemaBasedAccess) CanGet(apiOp *types2.APIRequest, schema *types2.APISchema) error

func (*SchemaBasedAccess) CanList

func (*SchemaBasedAccess) CanList(apiOp *types2.APIRequest, schema *types2.APISchema) error

func (*SchemaBasedAccess) CanUpdate

func (*SchemaBasedAccess) CanUpdate(apiOp *types2.APIRequest, obj types2.APIObject, schema *types2.APISchema) error

func (*SchemaBasedAccess) CanWatch

func (a *SchemaBasedAccess) CanWatch(apiOp *types2.APIRequest, schema *types2.APISchema) error

Jump to

Keyboard shortcuts

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