2022-05-02 07:21:07 -04:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/edgelesssys/constellation/coordinator/atls"
|
|
|
|
)
|
|
|
|
|
|
|
|
type stubRecoveryClient struct {
|
|
|
|
conn bool
|
|
|
|
connectErr error
|
|
|
|
closeErr error
|
|
|
|
pushStateDiskKeyErr error
|
|
|
|
|
|
|
|
pushStateDiskKeyKey []byte
|
|
|
|
}
|
|
|
|
|
2022-05-06 07:56:02 -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
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *stubRecoveryClient) PushStateDiskKey(_ context.Context, stateDiskKey []byte) error {
|
|
|
|
c.pushStateDiskKeyKey = stateDiskKey
|
|
|
|
return c.pushStateDiskKeyErr
|
|
|
|
}
|