api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Router

func Router(appCtx *actx.Context) chi.Router

Router returns the API router.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is the API endpoint handler.

func (*Handler) RemoteJoin

func (h *Handler) RemoteJoin(w http.ResponseWriter, r *http.Request)

RemoteJoin authenticates a remote Disco node. The request is expected to contain an Authorization header with a random token encoded as a base 58 string, and its signature. If the token matches an existing and valid invitation record, the request body is read, which is expected to contain the client's X25519 public key. If successful, ECDH key exchange is performed to generate the shared secret key, which is used to verify the token signature, and encrypt the generated TLS client certificate that is sent in the response.

func (*Handler) StoreGet

func (h *Handler) StoreGet(w http.ResponseWriter, r *http.Request)

StoreGet returns the value associated to the received key.

func (*Handler) StoreKeys

func (h *Handler) StoreKeys(w http.ResponseWriter, r *http.Request)

StoreKeys returns the keys in the data store.

func (*Handler) StoreSet

func (h *Handler) StoreSet(w http.ResponseWriter, r *http.Request)

StoreSet stores the provided value associated to the provided key.

Jump to

Keyboard shortcuts

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