Skip to content

feat: add UserClient.Create to API client#273

Merged
The127 merged 1 commit intomainfrom
feat/user-client-create
Apr 21, 2026
Merged

feat: add UserClient.Create to API client#273
The127 merged 1 commit intomainfrom
feat/user-client-create

Conversation

@The127
Copy link
Copy Markdown
Owner

@The127 The127 commented Apr 21, 2026

Summary

  • Adds Create(ctx, api.CreateUserRequestDto) (api.CreateUserResponseDto, error) to the UserClient interface. Wraps POST /api/virtual-servers/{vs}/users following the existing Application.Create pattern.
  • Adds a httptest unit test covering method, path, request body, and response decoding.
  • Adds an e2e spec (tests/e2e/userclient_test.go, //go:build e2e) that exercises create + get against the real server with service-user auth, plus a duplicate-username error path.

Motivated by the portal backend's upcoming access-request approval flow, which needs to provision regular users via the Go client.

Test plan

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

@The127 The127 force-pushed the feat/user-client-create branch from 620cff9 to d6f97d8 Compare April 21, 2026 21:44
Wrap POST /api/virtual-servers/{vs}/users so callers (e.g. the portal
backend's approval flow) can create regular users via the Go client.
Mirrors the existing Application.Create pattern.

Adds a httptest unit test and an e2e spec that exercises Create + Get
against the real server with service-user auth, including a duplicate
username error path.

Signed-off-by: karo <karolin.kostial@gmail.com>
@The127 The127 force-pushed the feat/user-client-create branch from d6f97d8 to 23d5cd1 Compare April 21, 2026 21:48
@The127 The127 merged commit 607a0f3 into main Apr 21, 2026
8 checks passed
@The127 The127 deleted the feat/user-client-create branch April 21, 2026 21:51
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