justification

package
v0.0.0-...-05145c8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package justification provides utils to validate justification tokens produced by JVS and populate audit logs with justification.

Index

Constants

View Source
const (
	TokenHeaderKey = "justification-token"
	LogMetadataKey = "justification"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

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

Processor populates an audit log request with justification.

func NewProcessor

func NewProcessor(v Validator) *Processor

NewProcessor creates a new justification processor.

func (*Processor) Process

func (p *Processor) Process(ctx context.Context, logReq *api.AuditLogRequest) error

Process populates the given audit log request with the justification info from the given token. If the token is empty, this function does nothing.

type Validator

type Validator interface {
	// ValidateJWT validates justification token generated by JVS.
	ValidateJWT(jvsToken string) (jwt.Token, error)
}

Validator validates justification token generated by JVS.

Jump to

Keyboard shortcuts

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