verify

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package verify contains various implementations of the CAP10 verifier. A verifier allows a CAP10 client to verify that the provided auth information is valid and not being spoofed.

Index

Constants

View Source
const (
	ProviderHTTP  = "http"
	ProviderLocal = "local"
	ProviderNone  = "none"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileVerifier

type FileVerifier struct {
	client.BaseVerifier
	// contains filtered or unexported fields
}

FileVerifier uses a local file (e.g. mounted k8s secret) as the CAP10 public key

func NewFileVerifier

func NewFileVerifier(ctx context.Context, path string) (*FileVerifier, error)

NewFileVerifier creates a new FileVerifier and attempts to read and parse the file at the given path

func (*FileVerifier) IsValid

func (v *FileVerifier) IsValid(ctx context.Context, msg, sig, _ string) bool

type NoOpVerifier

type NoOpVerifier struct {
	client.BaseVerifier
}

NoOpVerifier skips the verification mechanism and assumes all requests are valid

func NewNoOpVerifier

func NewNoOpVerifier() *NoOpVerifier

NewNoOpVerifier creates a new instance of NoOpVerifier.

func (*NoOpVerifier) IsValid

func (*NoOpVerifier) IsValid(_ context.Context, _, _, _ string) bool

Jump to

Keyboard shortcuts

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