cmd

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdWhoCan

func NewCmdWhoCan(streams clioptions.IOStreams) (*cobra.Command, error)

func NewWhoCanOptions

func NewWhoCanOptions(configFlags *clioptions.ConfigFlags,
	clientConfig clientcmd.ClientConfig,
	clientNamespace clientcore.NamespaceInterface,
	clientRBAC clientrbac.RbacV1Interface,
	namespaceValidator NamespaceValidator,
	resourceResolver ResourceResolver,
	accessChecker AccessChecker,
	streams clioptions.IOStreams) *whoCan

Types

type AccessChecker

type AccessChecker interface {
	IsAllowedTo(verb, resource, namespace string) (bool, error)
}

AccessChecker wraps the IsAllowedTo method.

IsAllowedTo checks whether the current user is allowed to perform the given action in the specified namespace. Specifying "" as namespace performs check in all namespaces.

type NamespaceValidator

type NamespaceValidator interface {
	Validate(name string) error
}

func NewNamespaceValidator

func NewNamespaceValidator(client clientcore.NamespaceInterface) NamespaceValidator

type ResourceResolver

type ResourceResolver interface {
	Resolve(verb, resource, subResource string) (string, error)
}

ResourceResolver wraps the Resolve method.

Resolve attempts to resolve an APIResource's Name by `resource` and `subResource`. It then validates that the specified `verb` is supported. The returned APIResource's Name may represent a resource (e.g. `pods`) or a sub-resource (e.g. `pods/log`).

func NewResourceResolver

func NewResourceResolver(client discovery.DiscoveryInterface, mapper meta.RESTMapper) ResourceResolver

Jump to

Keyboard shortcuts

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