Spaces: candidate dropdown/autocomplete for the member picker (needs user enumeration) #226

Closed
opened 2026-08-13 17:13:36 +00:00 by Cordy · 1 comment
Owner

Follow-up split from #217. The member-add field now validates (already-member/owner) and gives feedback (PR #225), but the candidate dropdown + type-ahead was deferred because it needs an enumerable list of users, which OIDC-without-an-admin-client (the openbao dogfood) doesn't provide.

To add later:

  • A small GET /api/v1/users (or /spaces/{name}/candidates) returning known usernames: local users from the local-users store, and/or users via the read-only IdP client (#215's read client) when configured. Empty when no source is enumerable.
  • Frontend: attach a <datalist> to membersdlg-user fed by that endpoint (native type-ahead), filtering out current members. Degrades to the validated free-text field when the list is empty.

Low priority — the validated text field already covers the core UX everywhere; this is autocomplete polish for instances that can enumerate users.

Follow-up split from #217. The member-add field now validates (already-member/owner) and gives feedback (PR #225), but the **candidate dropdown + type-ahead** was deferred because it needs an *enumerable* list of users, which OIDC-without-an-admin-client (the openbao dogfood) doesn't provide. **To add later:** - A small `GET /api/v1/users` (or `/spaces/{name}/candidates`) returning known usernames: local users from the local-users store, and/or users via the read-only IdP client (#215's read client) when configured. Empty when no source is enumerable. - Frontend: attach a `<datalist>` to `membersdlg-user` fed by that endpoint (native type-ahead), filtering out current members. Degrades to the validated free-text field when the list is empty. Low priority — the validated text field already covers the core UX everywhere; this is autocomplete polish for instances that can enumerate users.
Cordy closed this issue 2026-08-13 23:30:54 +00:00
Author
Owner

Shipped in v0.6.19 (PR #230, CI-green, squash-merged).

Backend: GET /api/v1/spaces/{name}/candidates (owner-or-admin gated) returns the usernames the instance can enumerate, minus the owner and current members (server-filtered), sorted + deduped. Source resolution: an injected SpacesAPI.Candidates enumerator if set; otherwise Manager.Users (realm users via GET /users?...view-users) on IdP-managed instances; otherwise empty. No main.go wiring needed for the IdP path.

Frontend: a <datalist> on the add-member input, populated on dialog open. Degrades to the validated free-text picker (#217) when the list is empty.

Tests (CI): spaces_candidates_test.go (owner/member exclusion + sort, non-owner 403, empty-when-no-source) and spaces.TestUsers (enumeration).

Deployed + boot-confirmed v0.6.19 on both dogfoods:

  • cairn-enc (IdP-managed): candidates enumerate the Keycloak realm → type-ahead lights up.
  • cairn-openbao (no IdP admin/read client): /candidates returns empty → field degrades to validated free-text, exactly as designed.

The redeploy logged out active sessions (in-memory), so the dropdown itself is best eyeballed on next login; the logic is CI-covered. Closing.

Shipped in **v0.6.19** (PR #230, CI-green, squash-merged). **Backend:** `GET /api/v1/spaces/{name}/candidates` (owner-or-admin gated) returns the usernames the instance can enumerate, minus the owner and current members (server-filtered), sorted + deduped. Source resolution: an injected `SpacesAPI.Candidates` enumerator if set; otherwise `Manager.Users` (realm users via `GET /users?...view-users`) on IdP-managed instances; otherwise empty. No `main.go` wiring needed for the IdP path. **Frontend:** a `<datalist>` on the add-member input, populated on dialog open. Degrades to the validated free-text picker (#217) when the list is empty. **Tests (CI):** `spaces_candidates_test.go` (owner/member exclusion + sort, non-owner 403, empty-when-no-source) and `spaces.TestUsers` (enumeration). **Deployed + boot-confirmed v0.6.19 on both dogfoods:** - **cairn-enc** (IdP-managed): candidates enumerate the Keycloak realm → type-ahead lights up. - **cairn-openbao** (no IdP admin/read client): `/candidates` returns empty → field degrades to validated free-text, exactly as designed. The redeploy logged out active sessions (in-memory), so the dropdown itself is best eyeballed on next login; the logic is CI-covered. Closing.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#226
No description provided.