Skip to content

lakebox: add ssh-key list/delete, default register --name, fix list null body#5290

Merged
akshaysingla-db merged 1 commit into
databricks:demo-lakeboxfrom
akshaysingla-db:akshay/lakebox-ssh-key-list
May 20, 2026
Merged

lakebox: add ssh-key list/delete, default register --name, fix list null body#5290
akshaysingla-db merged 1 commit into
databricks:demo-lakeboxfrom
akshaysingla-db:akshay/lakebox-ssh-key-list

Conversation

@akshaysingla-db
Copy link
Copy Markdown
Collaborator

@akshaysingla-db akshaysingla-db commented May 20, 2026

Three related ssh-key UX changes plus a wire-format bug in list:

  1. ssh-key list (new subcommand): GET /api/2.0/lakebox/ssh-keys. Renders the user's registered keys with a * gutter marker on the key matching this machine (using the existing keyHash helper from bd72f85). --json for scripting.

  2. ssh-key delete <key-hash> (new subcommand): DELETE /api/2.0/lakebox/ssh-keys/{key_hash}.

  3. register --name (new flag): defaults to this machine's hostname when not provided so ssh-key list is meaningful across multiple machines. Previously every locally-registered key landed with an empty name and surfaced as (unset).

  4. Fix lakebox list against any workspace that actually has lakebox deployed. Pieter's SDK ApiClient rewrite (08a56be) wrote the pagination call as Do(..., headers, query, nil, &resp) — but the SDK's makeRequestBody treats slot 6 (request) as the GET query string and slot 5 (queryParams) as ignored on GET. Routing the query through slot 5 with a nil body in slot 6 makes the SDK serialize nil as the literal JSON null, sent as the request body on a GET, which the lakebox manager rejects with INVALID_PARAMETER_VALUE: Request body must be a JSON object. Swap the args.

Co-authored-by: Isaac

Changes

Why

Tests

Tested against dbsql-dev-testing-default (workspace with lakebox deployed but no sandboxes):

  • lakebox list returns 200 OK with no body, prints "No lakeboxes found." (previously 400'd)
  • lakebox ssh-key list renders both keys with correct column alignment; * gutter marks the local key
  • lakebox ssh-key list --json round-trips through jq
  • lakebox ssh-key delete <hash> — not yet exercised end-to-end
  • lakebox register --name laptop against a clean workspace — confirm name lands

@github-actions
Copy link
Copy Markdown
Contributor

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in cmd/lakebox/
  • @shuochen0311 -- recent work in cmd/lakebox/

Eligible reviewers: @andrewnester, @anton-107, @denik, @renaudhartert-db, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

…ull body

Three related ssh-key UX changes plus a wire-format bug in `list`:

1. `ssh-key list` (new subcommand): GET /api/2.0/lakebox/ssh-keys.
   Renders the user's registered keys with a `*` gutter marker on the
   key matching this machine (using the existing keyHash helper from
   bd72f85). `--json` for scripting.

2. `ssh-key delete <key-hash>` (new subcommand): DELETE
   /api/2.0/lakebox/ssh-keys/{key_hash}.

3. `register --name` (new flag): defaults to this machine's hostname
   when not provided so `ssh-key list` is meaningful across multiple
   machines. Previously every locally-registered key landed with an
   empty name and surfaced as `(unset)`.

4. Fix `lakebox list` against any workspace that actually has lakebox
   deployed. Pieter's SDK ApiClient rewrite (08a56be) wrote the
   pagination call as `Do(..., headers, query, nil, &resp)` — but the
   SDK's makeRequestBody treats slot 6 (`request`) as the GET query
   string and slot 5 (`queryParams`) as ignored on GET. Routing the
   query through slot 5 with a nil body in slot 6 makes the SDK
   serialize nil as the literal JSON `null`, sent as the request body
   on a GET, which the lakebox manager rejects with
   `INVALID_PARAMETER_VALUE: Request body must be a JSON object`.
   Swap the args.

Co-authored-by: Isaac
@akshaysingla-db akshaysingla-db force-pushed the akshay/lakebox-ssh-key-list branch from ef0be84 to e474b84 Compare May 20, 2026 19:51
@akshaysingla-db akshaysingla-db merged commit 9439c8a into databricks:demo-lakebox May 20, 2026
13 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant