challenges

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Deprecated: only used in challenge v1
	ChallengeKey = "X-Challenge"

	ChallengeVersionMetadataKey  = "x-challenge-version"
	ClientIdAssertionMetadataKey = "x-client-id-assertion"
	ClientRandomMetadataKey      = "x-client-random"

	ChallengeV2 = "v2"
)

Variables

This section is empty.

Functions

func ClientIdAssertionFromMetadata

func ClientIdAssertionFromMetadata(md metadata.MD) (string, bool)

func ClientRandomFromMetadata

func ClientRandomFromMetadata(md metadata.MD) ([]byte, bool)

func If

func If(condition ConditionFunc) conditionalThen

func Solve

Types

type ChallengeHandler

type ChallengeHandler interface {
	DoChallenge(stream streams.Stream) (context.Context, error)
	InterceptContext(ctx context.Context) context.Context
}

func Chained

func Chained(challenges ...ChallengeHandler) ChallengeHandler

type ClientMetadata

type ClientMetadata struct {
	IdAssertion string
	Random      []byte
}

func ClientMetadataFromIncomingContext

func ClientMetadataFromIncomingContext(ctx context.Context) (ClientMetadata, error)

func ClientMetadataFromOutgoingContext

func ClientMetadataFromOutgoingContext(ctx context.Context) (ClientMetadata, error)

type ConditionFunc

type ConditionFunc = func(streamContext context.Context) (bool, error)

type HandlerFunc

type HandlerFunc func(streams.Stream) (context.Context, error)

type KeyringVerifier

type KeyringVerifier interface {
	Prepare(ctx context.Context, args ClientMetadata, req *corev1.ChallengeRequest) (PreCachedVerifier, error)
}

func NewKeyringVerifier

func NewKeyringVerifier(ksb storage.KeyringStoreBroker, domain string, lg *slog.Logger) KeyringVerifier

type PreCachedVerifier

type PreCachedVerifier interface {
	Verify(response *corev1.ChallengeResponse) *keyring.SharedKeys
}

Jump to

Keyboard shortcuts

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