updates
Agent Release / build (push) Successful in 1m18s
Server Deploy / deploy (push) Successful in 1m33s

This commit is contained in:
domrichardson
2026-06-24 13:57:48 +01:00
parent 407a610cfb
commit e6ef9bc536
9 changed files with 181 additions and 6 deletions
+6
View File
@@ -39,6 +39,7 @@ type UploadKeyRequest struct {
AgentToken string `json:"agent_token"`
PublicKey string `json:"public_key"`
Label string `json:"label"`
PrivateKey string `json:"private_key,omitempty"`
}
type UploadKeyResponse struct {
@@ -50,6 +51,11 @@ type UploadKeyResponse struct {
type ServerCommand struct {
CommandId string `json:"command_id"`
GenerateKey *GenerateKeyCmd `json:"generate_key,omitempty"`
DeleteKey *DeleteKeyCmd `json:"delete_key,omitempty"`
}
type DeleteKeyCmd struct {
Label string `json:"label"`
}
type GenerateKeyCmd struct {
+1 -1
View File
@@ -54,7 +54,7 @@ func (s *keyManagerServer) UploadGeneratedKey(ctx context.Context, req *pb.Uploa
return nil, status.Errorf(codes.Unauthenticated, "invalid agent token")
}
key, err := services.CreateKey(req.Label, req.PublicKey, "generated", srv.ServerID, "")
key, err := services.CreateKey(req.Label, req.PublicKey, "generated", srv.ServerID, req.PrivateKey)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to store key: %v", err)
}