audit

package
v0.38.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const EntityIDKey = "entityID"

EntityIDKey is the key used to store and extract entity IDs from log fields.

Variables

This section is empty.

Functions

func ExtractLogFields

func ExtractLogFields(ctx context.Context) logrus.Fields

ExtractLogFields retrieves logrus Fields from a context, if it exists.

func IsRBACLog

func IsRBACLog(entry *logrus.Entry) bool

IsRBACLog determines whether the log entry is an RBAC log.

func IsRBACPermissionDenied

func IsRBACPermissionDenied(entry *logrus.Entry) bool

IsRBACPermissionDenied determines whether the log entry is an RBAC log that indicates permission was denied.

func Log

func Log(fields logrus.Fields)

Log is a convenience function for logging to logrus.

func LogFromErr

func LogFromErr(fields logrus.Fields, err error)

LogFromErr is a convenience function that interprets the error to determined whether permission was granted.

func SupplyEntityID

func SupplyEntityID(ctx context.Context, id interface{}) context.Context

SupplyEntityID augments a context's log fields with the entity ID.

Types

type LogKey

type LogKey struct{}

LogKey is the key used to store and extract logrus fields from context.

type PermissionWithSubject

type PermissionWithSubject struct {
	PermissionTypes []rbacv1.PermissionType
	SubjectType     string
	SubjectIDs      []string
}

PermissionWithSubject contains the permission and what subject requires it.

func (PermissionWithSubject) String

func (p PermissionWithSubject) String() string

Jump to

Keyboard shortcuts

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