server

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 25 Imported by: 2

Documentation

Overview

Package server contains the ClientAPI HTTP-REST and MarbleAPI gRPC server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateServeMux

func CreateServeMux(api clientAPI, promFactory *promauto.Factory) serveMux

CreateServeMux creates a mux that serves the client API.

func RunClientServer

func RunClientServer(mux http.Handler, address string, tlsConfig *tls.Config, zapLogger *zap.Logger)

RunClientServer runs a HTTP server serving mux.

func RunMarbleServer

func RunMarbleServer(core *core.Core, addr string, addrChan chan string, errChan chan error, zapLogger *zap.Logger, promRegistry *prometheus.Registry)

RunMarbleServer starts a gRPC with the given Coordinator core. `address` is the desired TCP address like "localhost:0". The effective TCP address is returned via `addrChan`.

func RunPrometheusServer added in v0.1.1

func RunPrometheusServer(address string, zapLogger *zap.Logger, reg *prometheus.Registry, eventlog *events.Log)

RunPrometheusServer runs a HTTP server handling the prometheus metrics endpoint.

Types

type CertQuoteResp added in v0.5.0

type CertQuoteResp struct {
	// A PEM-encoded certificate chain containing the Coordinator's Root CA and Intermediate CA,
	// which can be used for trust establishment between a client and the Coordinator.
	Cert string
	// Base64-encoded quote which can be used for Remote Attestation.
	Quote []byte
}

CertQuoteResp wraps the certificate chain and quote for the client to use for remote attestation.

type GeneralResponse added in v0.3.1

type GeneralResponse struct {
	Status  string      `json:"status"`
	Data    interface{} `json:"data"`
	Message string      `json:"message,omitempty"` // only used when status = "error"
}

GeneralResponse is a wrapper for all our REST API responses to follow the JSend style: https://github.com/omniti-labs/jsend swagger:model

type ManifestSignatureResp added in v0.5.0

type ManifestSignatureResp struct {
	// The manifest signature - signed by the root ECDSA key.
	// example: MEYCIQCmkqOP0Jf1v5ZR0vUYNnMxmy8j9aYR3Zdemuz8EXNQ4gIhAMk6MCg00Rowilui/66tHrkETMmkPmOktMKXQqv6NmnN
	// swagger:strfmt byte
	ManifestSignatureRootECDSA []byte
	// A SHA-256 of the currently set manifest. Does not change when an update has been applied.
	// example: 3fff78e99dd9bd801e0a3a22b7f7a24a492302c4d00546d18c7f7ed6e26e95c3
	ManifestSignature string
	// The currently set manifest in base64 encoding. Does not change when an update has been applied.
	Manifest []byte
}

ManifestSignatureResp contains the manifest signature, a sha256 hash of the manifest, and the manifest itself.

type RecoveryDataResp added in v0.5.0

type RecoveryDataResp struct {
	// An array containing key-value mappings for encrypted secrets to be used for recovering the Coordinator in case of disaster recovery.
	// The key matches each supplied key from RecoveryKeys in the manifest.
	RecoverySecrets map[string]string
}

RecoveryDataResp contains RSA-encrypted AES state sealing key with public key specified by user in manifest.

type RecoveryStatusResp added in v0.5.0

type RecoveryStatusResp struct {
	StatusMessage string
}

RecoveryStatusResp contains the status of the recovery process.

type StatusResp added in v0.5.0

type StatusResp struct {
	// 	A status code that matches the internal code of the Coordinator's current state.
	// example: 2
	StatusCode int
	// A descriptive status message of what the Coordinator expects the user to do in its current state.
	// example: Coordinator is ready to accept a manifest.
	StatusMessage string
}

StatusResp is a response.

Jump to

Keyboard shortcuts

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