AB#1902 Ping Coordinator from initramfs for key (#53)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-04-12 14:24:36 +02:00 committed by GitHub
parent 7e990fb91a
commit 49a1a07049
20 changed files with 827 additions and 267 deletions

View file

@ -2,6 +2,7 @@ package pubapi
import (
"context"
"errors"
"fmt"
"net"
"time"
@ -161,6 +162,21 @@ func (a *API) ActivateAdditionalNodes(in *pubproto.ActivateAdditionalNodesReques
})
}
// RequestStateDiskKey triggers the Coordinator to return a key derived from the Constellation's master secret to the caller.
func (a *API) RequestStateDiskKey(ctx context.Context, in *pubproto.RequestStateDiskKeyRequest) (*pubproto.RequestStateDiskKeyResponse, error) {
// TODO: Add Coordinator call to restarting node and deliver the key
/*
if err := a.core.RequireState(state.IsNode, state.ActivatingNodes); err != nil {
return nil, err
}
_, err := a.core.GetDataKey(ctx, in.DiskUuid, 32)
if err != nil {
return nil, status.Errorf(codes.Internal, "")
}
*/
return &pubproto.RequestStateDiskKeyResponse{}, errors.New("unimplemented")
}
func (a *API) activateNodes(logToCLI logFunc, nodePublicEndpoints []string, coordPeer peer.Peer) error {
// Create initial peer data to be sent to the nodes. Currently, this is just this Coordinator.
initialPeers := peer.ToPubProto([]peer.Peer{coordPeer})