mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-30 10:38:46 -04:00
Add SSH users on subsequent coordinators & nodes
This commit is contained in:
parent
084ed0c4ef
commit
ed071d389c
5 changed files with 307 additions and 233 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/edgelesssys/constellation/coordinator/role"
|
||||
"github.com/edgelesssys/constellation/coordinator/state"
|
||||
"github.com/edgelesssys/constellation/coordinator/vpnapi/vpnproto"
|
||||
"github.com/edgelesssys/constellation/internal/deploy/ssh"
|
||||
"go.uber.org/zap"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
@ -91,6 +92,14 @@ func (a *API) ActivateAsNode(stream pubproto.API_ActivateAsNodeServer) (reterr e
|
|||
return status.Errorf(codes.Internal, "advance node state: %v", err)
|
||||
}
|
||||
|
||||
// Setup SSH users for the node, if defined
|
||||
if len(in.SshUserKeys) != 0 {
|
||||
sshUserKeys := ssh.FromProtoSlice(in.SshUserKeys)
|
||||
if err := a.core.CreateSSHUsers(sshUserKeys); err != nil {
|
||||
return status.Errorf(codes.Internal, "creating SSH users on node: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
vpnPubKey, err := a.core.GetVPNPubKey()
|
||||
if err != nil {
|
||||
return status.Errorf(codes.Internal, "get vpn publicKey: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue