auth

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 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 Auth

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

Auth provides implementation to check if caller/self/kyverno has access to perofrm operations

func NewAuth

func NewAuth(client dclient.Interface, user string, log logr.Logger) *Auth

NewAuth returns a new instance of Auth for operations

func (*Auth) CanI added in v1.13.0

func (a *Auth) CanI(ctx context.Context, verbs []string, gvk, namespace, name, subresource string) (bool, string, error)

func (*Auth) CanICreate

func (a *Auth) CanICreate(ctx context.Context, gvk, namespace, name, subresource string) (bool, error)

CanICreate returns 'true' if self can 'create' resource

func (*Auth) User added in v1.13.0

func (a *Auth) User() string

type AuthChecks added in v1.13.0

type AuthChecks interface {
	// User returns the subject
	User() string
	// CanI returns 'true' if user has permissions for all specified verbs.
	// When the result is 'false' a message with details on missing verbs is returned.
	CanI(ctx context.Context, verbs []string, gvk, namespace, name, subresource string) (bool, string, error)
}

AuthChecks provides methods to performing operations on resource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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