Documentation
¶
Overview ¶
tkatest has functions for creating a mock control server that responds to TKA endpoints.
Index ¶
- func HandleTKABootstrap(w http.ResponseWriter, r *http.Request, resp tailcfg.TKABootstrapResponse) (*tailcfg.TKABootstrapRequest, error)
- func HandleTKAInitBegin(w http.ResponseWriter, r *http.Request, nodes iter.Seq[*tailcfg.Node]) (*tka.AUM, error)
- func HandleTKAInitFinish(w http.ResponseWriter, r *http.Request) (map[tailcfg.NodeID]tkatype.MarshaledSignature, error)
- func HandleTKASign(w http.ResponseWriter, r *http.Request, authority *tka.Authority) (*tkatype.MarshaledSignature, *key.NodePublic, error)
- func HandleTKASyncOffer(w http.ResponseWriter, r *http.Request, authority *tka.Authority, ...) error
- func HandleTKASyncSend(w http.ResponseWriter, r *http.Request, authority *tka.Authority, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleTKABootstrap ¶
func HandleTKABootstrap(w http.ResponseWriter, r *http.Request, resp tailcfg.TKABootstrapResponse) (*tailcfg.TKABootstrapRequest, error)
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 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.