requestauth

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Scheme = "GoNZBNet"

Variables

This section is empty.

Functions

func HeaderFromRequest

func HeaderFromRequest(r *http.Request) string

func ParseAuthorization

func ParseAuthorization(header string) (map[string]string, error)

func Sign

func Sign(ctx context.Context, signer Signer, method, path, rawQuery string, body []byte, now time.Time) (string, error)

Types

type Signer

type Signer interface {
	NodeID(context.Context) (string, error)
	Sign(context.Context, []byte) ([]byte, error)
}

type VerificationResult

type VerificationResult struct {
	NodeID string
	Nonce  string
}

func Verify

func Verify(ctx context.Context, store VerifierStore, authorization, method, path, rawQuery string, body []byte, now time.Time, tolerance, nonceTTL time.Duration) (VerificationResult, error)

type VerifierStore

type VerifierStore interface {
	GetFederationNodePublicKey(ctx context.Context, nodeID string) (ed25519.PublicKey, error)
	StoreFederationNonce(ctx context.Context, nodeID, nonce string, expiresAt time.Time) (bool, error)
}

Jump to

Keyboard shortcuts

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