tkatest
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
tkatest has functions for creating a mock control server that respondsto 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¶
funcHandleTKABootstrap¶
func HandleTKABootstrap(whttp.ResponseWriter, r *http.Request, resptailcfg.TKABootstrapResponse) (*tailcfg.TKABootstrapRequest,error)
HandleTKABootstrap handles a request to /tka/bootstrap.
If the request is valid, it sends a response to the client, and returnsthe parsed request to the caller.
funcHandleTKAInitBegin¶
func HandleTKAInitBegin(whttp.ResponseWriter, r *http.Request, nodesiter.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 theclient, and returns the AUM to the caller.
funcHandleTKAInitFinish¶
func HandleTKAInitFinish(whttp.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 nodesignatures to apply.
This method assumes that the node signatures are valid, and does notverify them with the supplied public key.
funcHandleTKASign¶
func HandleTKASign(whttp.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, andgives the caller the signature and public key of the node being signed.
funcHandleTKASyncSend¶
func HandleTKASyncSend(whttp.ResponseWriter, r *http.Request, authority *tka.Authority, chonktka.Chonk)error
HandleTKASyncSend handles a request to /machine/tka/send.
If the request is valid, it adds the new AUMs to the authority, and sendsa response to the client with the new head.
Types¶
This section is empty.