candid

package
v0.0.0-...-288c4de Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentityClientWrapper

type IdentityClientWrapper struct {
	ValidDomains []string
	// contains filtered or unexported fields
}

IdentityClientWrapper is a wrapper around an IdentityClient.

func (*IdentityClientWrapper) DeclaredIdentity

func (m *IdentityClientWrapper) DeclaredIdentity(ctx context.Context, declared map[string]string) (identchecker.Identity, error)

DeclaredIdentity performs a check of the Candid domain before returning the declared identity.

func (*IdentityClientWrapper) IdentityFromContext

func (m *IdentityClientWrapper) IdentityFromContext(ctx context.Context) (identchecker.Identity, []checkers.Caveat, error)

IdentityFromContext returns the identity from the preovided context.

type Verifier

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

Verifier contains everything needed to verify a request.

func NewVerifier

func NewVerifier(authEndpoint string, authPubkey string, expiry int64, domains string) (*Verifier, error)

NewVerifier returns a new Candid verifier.

func (*Verifier) Auth

func (v *Verifier) Auth(r *http.Request) (*identchecker.AuthInfo, error)

Auth performs the candid authentication of the request.

func (*Verifier) IsRequest

func (v *Verifier) IsRequest(r *http.Request) bool

IsRequest checks if the request is using Candid authentication.

func (*Verifier) WriteRequest

func (v *Verifier) WriteRequest(r *http.Request, w http.ResponseWriter, derr *bakery.DischargeRequiredError)

WriteRequest writes the required response to trigger Candid authentication.

Jump to

Keyboard shortcuts

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