keymanager

package
v0.2102.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package keymanager implements the key manager worker.

Index

Constants

View Source
const (
	// CfgEnabled enables the key manager worker.
	CfgEnabled = "worker.keymanager.enabled"

	// CfgRuntimeID configures the runtime ID.
	CfgRuntimeID = "worker.keymanager.runtime.id"
	// CfgMayGenerate allows the enclave to generate a master secret.
	CfgMayGenerate = "worker.keymanager.may_generate"
)

Variables

Flags has the configuration flags.

Functions

func Enabled

func Enabled() bool

Enabled reads our enabled flag from viper.

Types

type Worker

type Worker struct {
	sync.RWMutex
	*runtimeRegistry.RuntimeHostNode
	// contains filtered or unexported fields
}

The key manager worker.

It behaves differently from other workers as the key manager has its own runtime. It needs to keep track of executor committees for other runtimes in order to update the access control lists.

func New

func New(
	dataDir string,
	commonWorker *workerCommon.Worker,
	ias ias.Endpoint,
	r *registration.Worker,
	backend api.Backend,
) (*Worker, error)

New constructs a new key manager worker.

func (*Worker) AuthFunc

func (w *Worker) AuthFunc(ctx context.Context, fullMethodName string, req interface{}) error

AuthFunc is the gRPC service authentication function.

func (*Worker) CallEnclave

func (w *Worker) CallEnclave(ctx context.Context, request *api.CallEnclaveRequest) ([]byte, error)

CallEnclave sends the request bytes to the target enclave.

func (*Worker) Cleanup

func (w *Worker) Cleanup()

func (*Worker) Enabled

func (w *Worker) Enabled() bool

Enabled returns if worker is enabled.

func (*Worker) GetRuntime

func (w *Worker) GetRuntime() runtimeRegistry.Runtime

Implements workerCommon.RuntimeHostHandlerFactory.

func (*Worker) Initialized

func (w *Worker) Initialized() <-chan struct{}

Initialized returns a channel that will be closed when the worker is initialized, ready to service requests and registered with the consensus layer.

func (*Worker) Name

func (w *Worker) Name() string

func (*Worker) NewNotifier

func (w *Worker) NewNotifier(ctx context.Context, host host.Runtime) protocol.Notifier

Implements workerCommon.RuntimeHostHandlerFactory.

func (*Worker) NewRuntimeHostHandler

func (w *Worker) NewRuntimeHostHandler() protocol.Handler

Implements workerCommon.RuntimeHostHandlerFactory.

func (*Worker) Quit

func (w *Worker) Quit() <-chan struct{}

func (*Worker) Start

func (w *Worker) Start() error

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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