haproxyprobe

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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

Overview

Package haproxyprobe is the probe the operator sends through HAProxy to tell whether a route runs the engine's SPOE filter (0002 §6.4): a GET with Header carrying a random nonce and a MAC of the nonce, the host and the path under the bundle's probe key. The path is one the route serves: PathSuffix under a Prefix path, so the probe reaches no real page of the app when the filter isn't there. The SPOE adapter checks the MAC and answers with another MAC under the key, which the route's HAProxy rules return with Status: only an engine that has the key, behind a route that runs the filter, can answer.

Index

Constants

View Source
const (
	// PathSuffix is the probe's path under a Prefix path, before the
	// nonce: /.well-known/inkwall-probe/<nonce> for the prefix "/".
	PathSuffix = ".well-known/inkwall-probe/"
	// Header carries the request's nonce and MAC ("<nonce>.<mac>"), and the
	// answer's MAC.
	Header = "X-Inkwall-Probe"
	// Status is HAProxy's answer to a probe the engine answered.
	Status = 299
	// KeySize is the size of a probe key.
	KeySize = 32
)

Variables

This section is empty.

Functions

func Check

func Check(key []byte, uri, host, header string) (answer string, ok bool)

Check is the engine's side: for a request to uri (path and query) with the Host host and the given Header value, it returns the answer to send back, and whether the request is a probe made with key.

func NewNonce

func NewNonce() (string, error)

NewNonce returns a random nonce: 32 base64url characters.

func PrefixPath

func PrefixPath(prefix, nonce string) string

PrefixPath is the probe's path under the Prefix path prefix.

func Request

func Request(key []byte, nonce, host, uri string) string

Request returns the Header of a probe with nonce to host and uri (path and query).

func Verify

func Verify(key []byte, nonce, host, uri, answer string) bool

Verify is the operator's side: whether answer is the engine's answer to the probe with nonce to host and uri.

Types

This section is empty.

Jump to

Keyboard shortcuts

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