security

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotFound = errors.New("user identity must be provided when allowing authentication")

ErrUserNotFound error when authentication passed but no user found

Functions

func ForbiddenHTTPError

func ForbiddenHTTPError(description string) error

ForbiddenHTTPError returns HTTPError 403 with some description

func UnauthorizedHTTPError

func UnauthorizedHTTPError(description string) error

UnauthorizedHTTPError returns HTTPError 401 with some description

Types

type AESEncrypter added in v0.3.3

type AESEncrypter struct {
}

AESEncrypter is an encrypter that fetches the encryption key from a remote location

func (*AESEncrypter) Decrypt added in v0.3.3

func (e *AESEncrypter) Decrypt(_ context.Context, ciphertext []byte, key []byte) ([]byte, error)

Decrypt decrypts the cipher text with the provided key using AES

func (*AESEncrypter) Encrypt added in v0.3.3

func (e *AESEncrypter) Encrypt(_ context.Context, plaintext []byte, key []byte) ([]byte, error)

Encrypt encrypts the plaintext with the provided key using AES

type Encrypter

type Encrypter interface {
	Encrypt(ctx context.Context, plaintext, key []byte) ([]byte, error)
	Decrypt(ctx context.Context, ciphertext, key []byte) ([]byte, error)
}

Encrypter provides functionality to encrypt and decrypt data

type HashingIntegrityProcessor added in v0.11.0

type HashingIntegrityProcessor struct {
	HashingFunc func(data []byte) []byte
}

HashingIntegrityProcessor is an integrity processor that uses a hashing func to calculate the integrity

func (*HashingIntegrityProcessor) CalculateIntegrity added in v0.11.0

func (h *HashingIntegrityProcessor) CalculateIntegrity(integral IntegralObject) ([]byte, error)

CalculateIntegrity calculates the integrity of an integral object using a hashing func

func (*HashingIntegrityProcessor) ValidateIntegrity added in v0.11.0

func (h *HashingIntegrityProcessor) ValidateIntegrity(integral IntegralObject) bool

ValidateIntegrity validates the integrity of an integral object using a hashing func

type IntegralObject added in v0.11.0

type IntegralObject interface {
	IntegralData() []byte
	SetIntegrity([]byte)
	GetIntegrity() []byte
}

IntegralObject interface indicates that an objects needs to be processed with regards to its integrity

type IntegrityProcessor added in v0.11.0

type IntegrityProcessor interface {
	ValidateIntegrity(integral IntegralObject) bool
	CalculateIntegrity(integral IntegralObject) ([]byte, error)
}

IntegrityProcessor provides functionality to validate and calculate the integrity of an integral object

Directories

Path Synopsis
Package authenticators contains logic for setting up an Open ID Connect authenticator
Package authenticators contains logic for setting up an Open ID Connect authenticator
httpfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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