-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: add recover command #634
Conversation
e1f6ea4
to
20fd0ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the expertise to review the actual recovery logic itself, so I only took a look at the Go code
@msanft please take some time to familiarize yourself with the recovery logic. |
cli/cmd/generate.go
Outdated
var publicKey []byte | ||
switch block.Type { | ||
case "PUBLIC KEY": | ||
publicKey = block.Bytes | ||
case "RSA PRIVATE KEY": | ||
privateKey, err := x509.ParsePKCS1PrivateKey(block.Bytes) | ||
if err != nil { | ||
return fmt.Errorf("parsing RSA private key: %w", err) | ||
} | ||
publicKey = x509.MarshalPKCS1PublicKey(&privateKey.PublicKey) | ||
default: | ||
return fmt.Errorf("unsupported PEM block type: %s", block.Type) | ||
} | ||
manifst.SeedshareOwnerPubKeys = append(manifst.SeedshareOwnerPubKeys, manifest.NewHexString(publicKey)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good if we could use manifest.MarshalSeedShareOwnerKey
so that we have a single place where algorithms are chosen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should follow up and also move the workload owner key stuff into the manifest package.
fd25872
to
d6b2606
Compare
fb3a70c
to
1805b98
Compare
I think we don't need this anymore: recoveryapi.Port. |
1805b98
to
40ea106
Compare
40ea106
to
2624dac
Compare
Signed-off-by: Paul Meyer <[email protected]>
Signed-off-by: Paul Meyer <[email protected]>
2624dac
to
05df4dc
Compare
This introduces a new command
recover
that let's you recover the Coordinator state after a restart.https://docs.edgeless.systems/contrast/architecture/secrets