Skip to content

feat: expose service-user key management over HTTP#274

Merged
The127 merged 1 commit intomainfrom
feat/service-user-key-endpoints
Apr 21, 2026
Merged

feat: expose service-user key management over HTTP#274
The127 merged 1 commit intomainfrom
feat/service-user-key-endpoints

Conversation

@The127
Copy link
Copy Markdown
Owner

@The127 The127 commented Apr 21, 2026

Summary

  • POST /users/service-users/{id}/keys now honors an optional `kid` in the request body; the Associate command already supported it, the HTTP layer was dropping it.
  • New route: `DELETE /users/service-users/{id}/keys/{kid}`, backed by the existing `RemoveServiceUserPublicKey` command (refactored to key by kid instead of public-key PEM, since that matches the URL shape and existing `DetailKid` filter).
  • `UserClient` gains DTO-in/DTO-out `AssociateServiceUserPublicKey` and a new `RemoveServiceUserPublicKey` method, matching the shape of `Create`/`Patch` etc.

Unblocks the keyline-operator's upcoming BYO-public-key CRD.

Breaking change

The client's `AssociateServiceUserPublicKey` signature now takes a request DTO instead of `(serviceUserID, publicKeyPEM)`. One known downstream caller (keyline-operator) will need a matching bump.

Test plan

  • `go test ./client/...` passes
  • `go build ./...` clean
  • `go vet -tags=e2e ./tests/e2e/...` clean
  • Full e2e + integration run (needs Postgres/Vault)

- POST /users/service-users/{id}/keys now honors an optional `kid` in
  the request body, passing it through to the Associate command so
  callers can pin a key id they control.
- Wire DELETE /users/service-users/{id}/keys/{kid}, backed by the
  existing RemoveServiceUserPublicKey command (now keyed by kid
  instead of public-key PEM).
- UserClient gains DTO-in/DTO-out Associate and a RemoveServiceUserPublicKey
  method, matching the shape of the other client methods.
- Unit tests for both client methods; e2e spec covering caller-supplied
  kid, server-generated kid, and remove.

Signed-off-by: karo <karolin.kostial@gmail.com>
@The127 The127 enabled auto-merge April 21, 2026 22:12
@The127 The127 merged commit 8beed88 into main Apr 21, 2026
8 checks passed
@The127 The127 deleted the feat/service-user-key-endpoints branch April 21, 2026 22:14
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