Implement users model and CRUD API #3

Open
opened 2025-09-23 14:18:43 +00:00 by boris · 0 comments
Owner

As an administrator, I want to create and view users so that I can manage who can log in and own SSH keys.

Acceptance Criteria (G/W/T)

  • Given an admin token, when I POST /api/v1/users with email, password, role, then a user row is created with hashed password and returned (sans hash).
  • Given multiple users exist, when I GET /api/v1/users as admin, then I see a paginated list (email, role, is_active).
  • Given a user id, when I GET /api/v1/users/{id} as admin, then I see user details (no password).
  • Given invalid email or short password, when I create a user, then I receive 422 with validation errors.
  • Given a non-admin token, when I hit admin-only routes, then I get 403 Forbidden.

Notes / Non-functional

  • Passwords hashed with Argon2.
  • Unique index on email.
  • Seed script for an initial admin.
As an administrator, I want to create and view users so that I can manage who can log in and own SSH keys. Acceptance Criteria (G/W/T) - [ ] Given an admin token, when I POST /api/v1/users with email, password, role, then a user row is created with hashed password and returned (sans hash). - [ ] Given multiple users exist, when I GET /api/v1/users as admin, then I see a paginated list (email, role, is_active). - [ ] Given a user id, when I GET /api/v1/users/{id} as admin, then I see user details (no password). - [ ] Given invalid email or short password, when I create a user, then I receive 422 with validation errors. - [ ] Given a non-admin token, when I hit admin-only routes, then I get 403 Forbidden. Notes / Non-functional - [ ] Passwords hashed with Argon2. - [ ] Unique index on email. - [ ] Seed script for an initial admin.
boris added this to the Minimum Viable Product milestone 2025-09-23 14:18:43 +00:00
boris added the
Kind/Feature
Priority
Critical
1
labels 2025-09-23 14:18:43 +00:00
boris self-assigned this 2025-09-23 14:18:43 +00:00
boris added this to the Keywarden project 2025-09-23 14:18:43 +00:00
boris moved this to To Do in Keywarden on 2025-09-23 14:18:46 +00:00
Sign in to join this conversation.
No description provided.