auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePublicKey

func ParsePublicKey(encodedKey string) (ed25519.PublicKey, error)

ParsePublicKey parses a ed25519 public key.

Types

type Signer

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

Signer signs HTTP requests.

func NewSigner

func NewSigner(signingKey ed25519.PrivateKey) *Signer

NewSigner creates a Signer that signs HTTP requests using the specified signing key, in the same way that Dispatch would sign requests.

func (*Signer) Client

func (s *Signer) Client(client connect.HTTPClient) *SigningClient

Client wraps an HTTP client to automatically sign requests.

func (*Signer) Sign

func (s *Signer) Sign(req *http.Request) error

Sign signs a request.

type SigningClient

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

SigningClient is an HTTP client that automatically signs requests.

func (*SigningClient) Do

func (c *SigningClient) Do(req *http.Request) (*http.Response, error)

Do signs and sends an HTTP request, and returns the HTTP response.

type Verifier

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

Verifier verifies that requests were signed by Dispatch.

func NewVerifier

func NewVerifier(verificationKey ed25519.PublicKey) *Verifier

NewVerifier creates a Verifier that verifies that requests were signed by Dispatch using the private key associated with this public verification key.

func (*Verifier) Middleware

func (v *Verifier) Middleware(next http.Handler) http.Handler

Middleware wraps an HTTP handler in order to validate request signatures.

func (*Verifier) Verify

func (v *Verifier) Verify(r *http.Request) error

Verify verifies that a request was signed by Dispatch.

Jump to

Keyboard shortcuts

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