Documentation ¶
Index ¶
- func IsPermissionDenied(err error) bool
- func ObfuscateAgent(agent *agentv1.Agent) error
- func ObfuscateContainer(container *containerv1.Container) error
- func ObfuscateDevice(device *devicev1.Device) error
- func ObfuscateJob(job *jobv1.Job) jobv1.LimitedJob
- func ObfuscateSlot(slot *agentv1.Slot) error
- func SubIfUnauthorized(err error, sub error) error
- type AuthZProviderType
- type PermissionDeniedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPermissionDenied ¶
IsPermissionDenied checks if err is of type PermissionDeniedError.
func ObfuscateAgent ¶
ObfuscateAgent obfuscates sensitive information in given Agent.
func ObfuscateContainer ¶
func ObfuscateContainer(container *containerv1.Container) error
ObfuscateContainer obfuscates sensitive information in given Container.
func ObfuscateDevice ¶
ObfuscateDevice obfuscates sensitive information in given Device.
func ObfuscateJob ¶
func ObfuscateJob(job *jobv1.Job) jobv1.LimitedJob
ObfuscateJob obfuscates sensitive information in given Job.
func ObfuscateSlot ¶
ObfuscateSlot obfuscates sensitive information in given Slot.
func SubIfUnauthorized ¶
SubIfUnauthorized substitutes an error if it is of type PermissionDeniedError.
Types ¶
type AuthZProviderType ¶
type AuthZProviderType[T any] struct { // contains filtered or unexported fields }
AuthZProviderType is a per-module registry for authz implementations.
func (*AuthZProviderType[T]) Get ¶
func (p *AuthZProviderType[T]) Get() T
Get returns the selected implementation.
func (*AuthZProviderType[T]) Register ¶
func (p *AuthZProviderType[T]) Register(authZType string, impl T)
Register adds new implementation.
type PermissionDeniedError ¶
type PermissionDeniedError struct { RequiredPermissions []rbacv1.PermissionType OneOf bool // optional prefix error message Prefix string }
PermissionDeniedError represents an error that arises when a user does not have sufficient access privileges. RequiredPermissions can be empty for non-rbac errors.
func (PermissionDeniedError) Error ¶
func (p PermissionDeniedError) Error() string
Error returns an error string.
func (PermissionDeniedError) WithPrefix ¶
func (p PermissionDeniedError) WithPrefix(prefix string) PermissionDeniedError
WithPrefix adds a custom prefix to error string.