2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-05-02 07:21:07 -04:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-06-01 09:08:42 -04:00
|
|
|
"github.com/edgelesssys/constellation/internal/atls"
|
2022-05-02 07:21:07 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
type stubRecoveryClient struct {
|
|
|
|
conn bool
|
|
|
|
connectErr error
|
|
|
|
closeErr error
|
|
|
|
pushStateDiskKeyErr error
|
|
|
|
|
|
|
|
pushStateDiskKeyKey []byte
|
|
|
|
}
|
|
|
|
|
2022-08-09 08:04:40 -04:00
|
|
|
func (c *stubRecoveryClient) Connect(_ string, _ atls.Validator) error {
|
2022-05-02 07:21:07 -04:00
|
|
|
c.conn = true
|
|
|
|
return c.connectErr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *stubRecoveryClient) Close() error {
|
|
|
|
c.conn = false
|
|
|
|
return c.closeErr
|
|
|
|
}
|
|
|
|
|
2022-07-26 04:58:39 -04:00
|
|
|
func (c *stubRecoveryClient) PushStateDiskKey(_ context.Context, stateDiskKey, _ []byte) error {
|
2022-05-02 07:21:07 -04:00
|
|
|
c.pushStateDiskKeyKey = stateDiskKey
|
|
|
|
return c.pushStateDiskKeyErr
|
|
|
|
}
|