Skip to content

Fix SSH Key PUT API to require username and privateKey for remote command execution#2315

Merged
cb-github-robot merged 2 commits intocloud-barista:mainfrom
leehyeoklee:enable-remote-command
Feb 13, 2026
Merged

Fix SSH Key PUT API to require username and privateKey for remote command execution#2315
cb-github-robot merged 2 commits intocloud-barista:mainfrom
leehyeoklee:enable-remote-command

Conversation

@leehyeoklee
Copy link
Copy Markdown
Contributor

@leehyeoklee leehyeoklee commented Feb 13, 2026

Enable Remote Command Execution for Registered SSH Keys

Problem

When SSH Keys are registered from CSP resources, they lack critical authentication information (username and privateKey), preventing remote command execution on associated VMs. Users cannot execute commands via MapUI or API calls on registered VMs.

image

Root Cause

  1. Registered SSH Keys missing required fields: SSH Keys registered from CSP console don't include username or privateKey in CB-Tumblebug database
  2. PUT API had a bug: The PUT API did not function as originally intended; instead of updating existing fields, it mistakenly created a new object.

Solution

1. Added dedicated complement API

Created a new endpoint specifically for enabling remote command execution:

PUT /ns/{nsId}/resources/sshKey/{sshKeyId}/complement

This API only requires the essential fields needed for SSH authentication:

type SshKeyComplementReq struct {
    Username   string `json:"username"`    // Required: SSH username
    PrivateKey string `json:"privateKey"`  // Required: SSH private key
}

2. Maintained general update API

The existing PUT API continues to support SSH Key updates:

PUT /ns/{nsId}/resources/sshKey/{sshKeyId}

type SshKeyUpdateReq struct {
    Description      string `json:"description"`
    Fingerprint      string `json:"fingerprint"`
    Username         string `json:"username"`
    VerifiedUsername string `json:"verifiedUsername"`
    PublicKey        string `json:"publicKey"`
    PrivateKey       string `json:"privateKey"`
}

Benefits

  1. Enables remote command execution: Registered VMs can now execute commands after Complementing a SSH Key info
  2. Clear API semantics: Dedicated /complement endpoint makes the intent explicit
  3. Minimal required fields: Only username and privateKey needed for activation
image

@leehyeoklee leehyeoklee force-pushed the enable-remote-command branch from ddf2782 to e5b571f Compare February 13, 2026 10:45
Copy link
Copy Markdown
Member

@seokho-son seokho-son left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@seokho-son
Copy link
Copy Markdown
Member

Nice work! Thanks @leehyeoklee

@seokho-son
Copy link
Copy Markdown
Member

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Feb 13, 2026
@cb-github-robot cb-github-robot merged commit efd31c0 into cloud-barista:main Feb 13, 2026
4 checks passed
@leehyeoklee leehyeoklee deleted the enable-remote-command branch February 23, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants