"constellation recover" CLI command

Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
Malte Poll 2022-05-02 13:21:07 +02:00 committed by Malte Poll
parent 9d31c9637b
commit e13ec3f914
7 changed files with 632 additions and 0 deletions

View file

@ -0,0 +1,31 @@
package cmd
import (
"context"
"github.com/edgelesssys/constellation/coordinator/atls"
)
type stubRecoveryClient struct {
conn bool
connectErr error
closeErr error
pushStateDiskKeyErr error
pushStateDiskKeyKey []byte
}
func (c *stubRecoveryClient) Connect(_, _ string, _ []atls.Validator) error {
c.conn = true
return c.connectErr
}
func (c *stubRecoveryClient) Close() error {
c.conn = false
return c.closeErr
}
func (c *stubRecoveryClient) PushStateDiskKey(_ context.Context, stateDiskKey []byte) error {
c.pushStateDiskKeyKey = stateDiskKey
return c.pushStateDiskKeyErr
}