mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-18 11:37:55 -04:00
use existing MasterSecret
type + fix autoformatting
This commit is contained in:
parent
53b84d8398
commit
52792e2cde
3 changed files with 13 additions and 20 deletions
|
@ -24,11 +24,6 @@ import (
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
|
|
||||||
type secret struct {
|
|
||||||
Key []byte `json:"key,omitempty"`
|
|
||||||
Salt []byte `json:"salt,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
var permissions = ssh.Permissions{
|
var permissions = ssh.Permissions{
|
||||||
Extensions: map[string]string{
|
Extensions: map[string]string{
|
||||||
"permit-port-forwarding": "yes",
|
"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.
|
// 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 {
|
if err = fh.ReadJSON(fmt.Sprintf("%s.json", constants.ConstellationMasterSecretStoreName), &mastersecret); err != nil {
|
||||||
return fmt.Errorf("Failed to read constellation master secret: %s", err)
|
return fmt.Errorf("Failed to read constellation master secret: %s", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,17 +9,14 @@ option go_package = "github.com/edgelesssys/constellation/v2/joinservice/joinpro
|
||||||
service API {
|
service API {
|
||||||
// IssueJoinTicket issues a join ticket for a new node.
|
// IssueJoinTicket issues a join ticket for a new node.
|
||||||
rpc IssueJoinTicket(IssueJoinTicketRequest) returns (IssueJoinTicketResponse);
|
rpc IssueJoinTicket(IssueJoinTicketRequest) returns (IssueJoinTicketResponse);
|
||||||
// IssueRejoinTicket issues a join ticket for a node that has previously
|
// IssueRejoinTicket issues a join ticket for a node that has previously joined the cluster.
|
||||||
// joined the cluster.
|
rpc IssueRejoinTicket(IssueRejoinTicketRequest) returns (IssueRejoinTicketResponse);
|
||||||
rpc IssueRejoinTicket(IssueRejoinTicketRequest)
|
|
||||||
returns (IssueRejoinTicketResponse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message IssueJoinTicketRequest {
|
message IssueJoinTicketRequest {
|
||||||
// disk_uuid is the UUID of a node's state disk.
|
// disk_uuid is the UUID of a node's state disk.
|
||||||
string disk_uuid = 1;
|
string disk_uuid = 1;
|
||||||
// certificate_request is a certificate request for the node's kubelet
|
// certificate_request is a certificate request for the node's kubelet certificate.
|
||||||
// certificate.
|
|
||||||
bytes certificate_request = 2;
|
bytes certificate_request = 2;
|
||||||
// is_control_plane indicates whether the node is a control-plane node.
|
// is_control_plane indicates whether the node is a control-plane node.
|
||||||
bool is_control_plane = 3;
|
bool is_control_plane = 3;
|
||||||
|
@ -38,11 +35,9 @@ message IssueJoinTicketResponse {
|
||||||
bytes kubelet_cert = 4;
|
bytes kubelet_cert = 4;
|
||||||
// api_server_endpoint is the endpoint of Constellation's API server.
|
// api_server_endpoint is the endpoint of Constellation's API server.
|
||||||
string api_server_endpoint = 5;
|
string api_server_endpoint = 5;
|
||||||
// token is the Kubernetes Join Token to be used by the node to join the
|
// token is the Kubernetes Join Token to be used by the node to join the cluster.
|
||||||
// cluster.
|
|
||||||
string token = 6;
|
string token = 6;
|
||||||
// discovery_token_ca_cert_hash is a hash of the root certificate authority
|
// discovery_token_ca_cert_hash is a hash of the root certificate authority presented by the Kubernetes control-plane.
|
||||||
// presented by the Kubernetes control-plane.
|
|
||||||
string discovery_token_ca_cert_hash = 7;
|
string discovery_token_ca_cert_hash = 7;
|
||||||
// control_plane_files is a list of control-plane certificates and keys.
|
// control_plane_files is a list of control-plane certificates and keys.
|
||||||
repeated control_plane_cert_or_key control_plane_files = 8;
|
repeated control_plane_cert_or_key control_plane_files = 8;
|
||||||
|
@ -50,8 +45,7 @@ message IssueJoinTicketResponse {
|
||||||
string kubernetes_version = 9;
|
string kubernetes_version = 9;
|
||||||
// kubernetes_components is a list of components to install on the node.
|
// kubernetes_components is a list of components to install on the node.
|
||||||
repeated components.Component kubernetes_components = 10;
|
repeated components.Component kubernetes_components = 10;
|
||||||
// emergency_ca_key is an ssh ca key that can be used to connect to a node in
|
// emergency_ca_key is an ssh ca key that can be used to connect to a node in case of an emergency.
|
||||||
// case of an emergency.
|
|
||||||
bytes emergency_ca_key = 11;
|
bytes emergency_ca_key = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,12 @@ message GetDataKeyRequest {
|
||||||
uint32 length = 2;
|
uint32 length = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetDataKeyResponse { bytes data_key = 1; }
|
message GetDataKeyResponse {
|
||||||
|
bytes data_key = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message GetCAKeyRequest {}
|
message GetCAKeyRequest {}
|
||||||
|
|
||||||
message GetCAKeyResponse { bytes ca_key = 1; }
|
message GetCAKeyResponse {
|
||||||
|
bytes ca_key = 1;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue