justification

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultAudience is the default audience used in justification tokens. It
	// can be overridden with the audiences in the justification request.
	DefaultAudience = "dev.abcxyz.jvs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JVSAgent

type JVSAgent struct {
	jvspb.JVSServiceServer

	Processor *Processor
}

JVSAgent is the implementation of the justification verification server.

func NewJVSAgent

func NewJVSAgent(p *Processor) *JVSAgent

NewJVSAgent creates a new JVSAgent.

type Processor

type Processor struct {
	jvspb.UnimplementedJVSServiceServer
	// contains filtered or unexported fields
}

Processor performs the necessary logic to validate a justification, then mints a token.

func NewProcessor

func NewProcessor(kms *kms.KeyManagementClient, config *config.JustificationConfig) *Processor

NewProcessor creates a processor with the signer cache initialized.

func (*Processor) CreateToken

func (p *Processor) CreateToken(ctx context.Context, requestor string, req *jvspb.CreateJustificationRequest) ([]byte, error)

CreateToken implements the create token API which creates and signs a JWT token if the provided justifications are valid.

func (*Processor) Validators added in v0.1.1

func (p *Processor) Validators() map[string]jvspb.Validator

Validators returns all the validators allowed by this processor.

func (*Processor) WithValidators added in v0.1.1

func (p *Processor) WithValidators(v map[string]jvspb.Validator) *Processor

WithValidators adds validators to the processor.

Jump to

Keyboard shortcuts

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