Documentation ¶
Index ¶
- Constants
- func ExtractLogFields(ctx context.Context) logrus.Fields
- func IsRBACLog(entry *logrus.Entry) bool
- func IsRBACPermissionDenied(entry *logrus.Entry) bool
- func Log(fields logrus.Fields)
- func LogFromErr(fields logrus.Fields, err error)
- func SupplyEntityID(ctx context.Context, id interface{}) context.Context
- type LogKey
- type PermissionWithSubject
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 ¶
ExtractLogFields retrieves logrus Fields from a context, if it exists.
func IsRBACPermissionDenied ¶
IsRBACPermissionDenied determines whether the log entry is an RBAC log that indicates permission was denied.
func LogFromErr ¶
LogFromErr is a convenience function that interprets the error to determined whether permission was granted.
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
Click to show internal directories.
Click to hide internal directories.