tkatest

package
v0.0.0-...-1b709f2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

tkatest has functions for creating a mock control server that responds to TKA endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleTKABootstrap

HandleTKABootstrap handles a request to /tka/bootstrap.

If the request is valid, it sends a response to the client, and returns the parsed request to the caller.

func HandleTKAInitBegin

func HandleTKAInitBegin(w http.ResponseWriter, r *http.Request, nodes iter.Seq[*tailcfg.Node]) (*tka.AUM, error)

HandleTKAInitBegin handles a request to /machine/tka/init/begin.

If the request contains a valid genesis AUM, it sends a response to the client, and returns the AUM to the caller.

func HandleTKAInitFinish

func HandleTKAInitFinish(w http.ResponseWriter, r *http.Request) (map[tailcfg.NodeID]tkatype.MarshaledSignature, error)

HandleTKAInitFinish handles a request to /machine/tka/init/finish.

It sends a response to the client, and gives the caller a list of node signatures to apply.

This method assumes that the node signatures are valid, and does not verify them with the supplied public key.

func HandleTKASign

func HandleTKASign(w http.ResponseWriter, r *http.Request, authority *tka.Authority) (*tkatype.MarshaledSignature, *key.NodePublic, error)

HandleTKASign handles a request to /machine/tka/sign.

If the signature request is valid, it sends a response to the client, and gives the caller the signature and public key of the node being signed.

func HandleTKASyncOffer

func HandleTKASyncOffer(w http.ResponseWriter, r *http.Request, authority *tka.Authority, chonk tka.Chonk) error

func HandleTKASyncSend

func HandleTKASyncSend(w http.ResponseWriter, r *http.Request, authority *tka.Authority, chonk tka.Chonk) error

HandleTKASyncSend handles a request to /machine/tka/send.

If the request is valid, it adds the new AUMs to the authority, and sends a response to the client with the new head.

Types

This section is empty.

Jump to

Keyboard shortcuts

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