core

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const ERocksDBMasterKeyVar = "EROCKSDB_MASTERKEY"

ERocksDBMasterKeyVar is the name of the environment variable holding the master key for eRocksDB. Needs to be kept in sync with 3rdparty/edgeless-rocksdb/file/encrypted_file.cc

View Source
const EnvAPIAddress = "EDG_EDB_API_ADDR"

EnvAPIAddress is the name of the optional environment variable holding the API address

View Source
const EnvCertificateDNSName = "EDG_EDB_CERT_DNS"

EnvCertificateDNSName is the name of the optional environment variable holding the DNS Name used for the certificate generated by edb

View Source
const EnvDataPath = "EDG_EDB_DATA_PATH"

EnvDataPath is the name of the optional environment variable holding the data path for edb

View Source
const EnvDatabaseAddress = "EDG_EDB_DATABASE_ADDR"

EnvDatabaseAddress is the name of the optional environment variable holding the database address

View Source
const EnvDebug = "EDG_EDB_DEBUG"

EnvDebug is a flag to enable debug logging for edb

View Source
const EnvLogDir = "EDG_EDB_LOG_DIR"

EnvLogDir is the name of the optional environment variable holding the path for storing the log files

View Source
const EnvManifestFile = "EDG_EDB_MANIFEST_FILE"

EnvManifestFile holds the path to the manifest file in case we want edb to automatically deploy one

View Source
const PersistenceDir = "edb-persistence"

PersistenceDir holds the directory name where we store the seal key on the host filesystem when running standalone

Variables

View Source
var ErrKeyIncorrectSize = errors.New("key is not 16 bytes long")

ErrKeyIncorrectSize is an error type returned when the key used by ERocksDB is not 16 bytes (= 128 bit) long

View Source
var ErrKeyNotAllowedToChangeMarblerun = errors.New("cannot change sealing key when running under marblerun")

ErrKeyNotAllowedToChangeMarblerun is an error type thrown when edb attempts to change the sealing key provided by Marblerun

View Source
var ErrKeyNotProvidedMarblerun = errors.New("marblerun did not set required key for edb")

ErrKeyNotProvidedMarblerun is an error type thrown when edb was run as a Marble, but Marblerun did not provide a key in the environment

Functions

This section is empty.

Types

type Config

type Config struct {
	DataPath           string `json:",omitempty"`
	DatabaseAddress    string `json:",omitempty"`
	APIAddress         string `json:",omitempty"`
	CertificateDNSName string `json:",omitempty"`
	Debug              bool   `json:",omitempty"`
	LogDir             string `json:",omitempty"`
	ManifestFilePath   string `json:",omitempty"`
}

Config is an EDB config.

func FillConfigFromEnvironment

func FillConfigFromEnvironment(config Config) Config

FillConfigFromEnvironment takes an existing config filled with defaults and replaces single values based on environment variables.

type Core

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

Core implements the core logic of EDB.

func NewCore

func NewCore(cfg Config, rt rt.Runtime, db db.Database, fs afero.Afero, isMarble bool) *Core

NewCore creates a new Core object.

func (*Core) GenerateReport added in v0.3.0

func (c *Core) GenerateReport() error

func (*Core) GetCertificateReport

func (c *Core) GetCertificateReport() (string, []byte, error)

GetCertificateReport gets the certificate and a report that includes the certificate's hash.

func (*Core) GetManifestSignature

func (c *Core) GetManifestSignature() []byte

GetManifestSignature returns the signature of the manifest that has been used to initialize the database.

func (*Core) GetTLSConfig

func (c *Core) GetTLSConfig() *tls.Config

GetTLSConfig creates a TLS configuration that includes the certificate.

func (*Core) Initialize

func (c *Core) Initialize(jsonManifest []byte) ([]byte, error)

Initialize sets up a database according to the jsonManifest.

func (*Core) IsRecovering

func (c *Core) IsRecovering() bool

IsRecovering returns if edb (in standalone mode) is in recovery mode, or if it's not.

func (*Core) Recover

func (c *Core) Recover(ctx context.Context, key []byte) error

Recover sets an encryption key (ideally decrypted from the recovery data) and tries to unseal and load a saved state again.

func (*Core) StartDatabase

func (c *Core) StartDatabase() error

StartDatabase starts the database.

Jump to

Keyboard shortcuts

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