use existing MasterSecret type + fix autoformatting

This commit is contained in:
miampf 2025-01-09 11:52:54 +01:00
parent 53b84d8398
commit 52792e2cde
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C
3 changed files with 13 additions and 20 deletions

View File

@ -24,11 +24,6 @@ import (
"golang.org/x/crypto/ssh"
)
type secret struct {
Key []byte `json:"key,omitempty"`
Salt []byte `json:"salt,omitempty"`
}
var permissions = ssh.Permissions{
Extensions: map[string]string{
"permit-port-forwarding": "yes",
@ -58,7 +53,7 @@ func runSSH(cmd *cobra.Command, _ []string) error {
}
// NOTE(miampf): Since other KMS aren't fully implemented yet, this commands assumes that the cKMS is used and derives the key accordingly.
var mastersecret secret
var mastersecret uri.MasterSecret
if err = fh.ReadJSON(fmt.Sprintf("%s.json", constants.ConstellationMasterSecretStoreName), &mastersecret); err != nil {
return fmt.Errorf("Failed to read constellation master secret: %s", err)
}

View File

@ -9,17 +9,14 @@ option go_package = "github.com/edgelesssys/constellation/v2/joinservice/joinpro
service API {
// IssueJoinTicket issues a join ticket for a new node.
rpc IssueJoinTicket(IssueJoinTicketRequest) returns (IssueJoinTicketResponse);
// IssueRejoinTicket issues a join ticket for a node that has previously
// joined the cluster.
rpc IssueRejoinTicket(IssueRejoinTicketRequest)
returns (IssueRejoinTicketResponse);
// IssueRejoinTicket issues a join ticket for a node that has previously joined the cluster.
rpc IssueRejoinTicket(IssueRejoinTicketRequest) returns (IssueRejoinTicketResponse);
}
message IssueJoinTicketRequest {
// disk_uuid is the UUID of a node's state disk.
string disk_uuid = 1;
// certificate_request is a certificate request for the node's kubelet
// certificate.
// certificate_request is a certificate request for the node's kubelet certificate.
bytes certificate_request = 2;
// is_control_plane indicates whether the node is a control-plane node.
bool is_control_plane = 3;
@ -38,11 +35,9 @@ message IssueJoinTicketResponse {
bytes kubelet_cert = 4;
// api_server_endpoint is the endpoint of Constellation's API server.
string api_server_endpoint = 5;
// token is the Kubernetes Join Token to be used by the node to join the
// cluster.
// token is the Kubernetes Join Token to be used by the node to join the cluster.
string token = 6;
// discovery_token_ca_cert_hash is a hash of the root certificate authority
// presented by the Kubernetes control-plane.
// discovery_token_ca_cert_hash is a hash of the root certificate authority presented by the Kubernetes control-plane.
string discovery_token_ca_cert_hash = 7;
// control_plane_files is a list of control-plane certificates and keys.
repeated control_plane_cert_or_key control_plane_files = 8;
@ -50,8 +45,7 @@ message IssueJoinTicketResponse {
string kubernetes_version = 9;
// kubernetes_components is a list of components to install on the node.
repeated components.Component kubernetes_components = 10;
// emergency_ca_key is an ssh ca key that can be used to connect to a node in
// case of an emergency.
// emergency_ca_key is an ssh ca key that can be used to connect to a node in case of an emergency.
bytes emergency_ca_key = 11;
}

View File

@ -14,8 +14,12 @@ message GetDataKeyRequest {
uint32 length = 2;
}
message GetDataKeyResponse { bytes data_key = 1; }
message GetDataKeyResponse {
bytes data_key = 1;
}
message GetCAKeyRequest {}
message GetCAKeyResponse { bytes ca_key = 1; }
message GetCAKeyResponse {
bytes ca_key = 1;
}