Documentation
¶
Overview ¶
Package permissions handles peer user detection and permissions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithUnixPeerCreds ¶
func WithUnixPeerCreds() grpc.ServerOption
WithUnixPeerCreds returns the credentials of the caller.
func Z_ForTests_DefaultCurrentUserAsRoot ¶ added in v0.4.1
func Z_ForTests_DefaultCurrentUserAsRoot()
Z_ForTests_DefaultCurrentUserAsRoot mocks the current user as root for the permission manager.
nolint:revive,nolintlint // We want to use underscores in the function name here.
func Z_ForTests_IdempotentPermissionError ¶ added in v0.4.1
Z_ForTests_IdempotentPermissionError strips the UID from the permission error message.
nolint:revive,nolintlint // We want to use underscores in the function name here.
func Z_ForTests_SetCurrentUserAsRoot ¶ added in v0.4.1
Z_ForTests_SetCurrentUserAsRoot mutates a default permission to the current user's UID if currentUserAsRoot is true.
nolint:revive,nolintlint // We want to use underscores in the function name here.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an abstraction of permission process.
type Option ¶
type Option func(*options)
Option represents an optional function to override Manager default values.
func Z_ForTests_WithCurrentUserAsRoot ¶ added in v0.4.1
func Z_ForTests_WithCurrentUserAsRoot() Option
Z_ForTests_WithCurrentUserAsRoot returns an Option that sets the rootUID to the current user's UID.
nolint:revive,nolintlint // We want to use underscores in the function name here.