permissions

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

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.

Types

type Manager

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

Manager is an abstraction of permission process.

func New

func New(args ...Option) Manager

New returns a new Manager.

func (Manager) IsRequestFromRoot

func (m Manager) IsRequestFromRoot(ctx context.Context) (err error)

IsRequestFromRoot returns nil if the request was performed by a root user. The pid and uid are extracted from peerCredsInfo in the gRPC context.

type Option

type Option func(*options)

Option represents an optional function to override Manager default values.

Directories

Path Synopsis
Package permissionstestutils are exported functions to be run in 3rd party package or integration tests.
Package permissionstestutils are exported functions to be run in 3rd party package or integration tests.

Jump to

Keyboard shortcuts

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