Skip to content

Users endpoints with a temporary password #11

Open

Description

@MendesMat

Goal

Expose user management through the API, including sending the activation e-mail when a user is created or access is resent.

Scope

Operations of docs/product/features/users.md#operations, with their minimum levels:

  • listUsers: server-side paging, search in display name, full name, login and CPF digits, status filter current (default), pending, inactive, all; each item has profileNames (API-07, CNV-08, USR-20).
  • getUser, with createdByName, updatedByName, deactivatedByName (API-03).
  • suggestLogin, full name in the body (USR-14, USR-15, API-04).
  • createUser: validation USR-01 to USR-13 with the verbatim messages; duplicates as 400 (API-13); the user is saved as pending before the activation e-mail is sent in the same request, and the response says emailSent (AUTH-02, AUTH-05, AUTH-06, ADR-0031).
  • updateUser with If-Match (API-06).
  • resendAccess: new link, previous one invalidated (AUTH-04); not_pending, email_missing errors.
  • deactivateUser / reactivateUser (USR-16 to USR-19): deactivation invalidates pending links and revokes refresh tokens (AUTH-21); reactivating a pending user sends a new link.
  • IEmailSender in Application, implemented with MailKit over SMTP to the Aspire resource mailpit; messages in Portuguese from templates, with only the link (ADR-0030, ADR-0031). Activation links are single-use and valid for 72 hours, stored hashed (AUTH-03, AUTH-19, AUTH-20).

Out of scope

The public link endpoints (checkLink, activateAccount) and password reset (#12). Signature (USR-25) waits for ADR-0018.

Done when

  • Integration tests for every operation, including: e-mail delivered to Mailpit (Testcontainers) with the right link; emailSent = false with the SMTP server unreachable and the user still saved as pending; self-deactivation refused; Admin protected.
  • Only fictitious personal data in tests; no personal data or links in logs.
  • Build with zero warnings, all tests pass.

References

docs/product/features/users.md, docs/product/features/authentication.md, docs/api/conventions.md, ADR-0016, ADR-0017, ADR-0030, ADR-0031.

Activity

  1. changed the title [-]Users endpoints and activation e-mails[/-] [+]Users endpoints with a temporary password[/+] on Oct 6, 2026
  2. MendesMat commented on Oct 6, 2026

    @MendesMat
    OwnerAuthor

    Escopo alterado em 2026-10-05. O acesso por e-mail foi adiado: quem cadastra um usuário define uma senha temporária, e a pessoa é obrigada a trocá-la no primeiro acesso (decisão 21 de docs/decisoes-de-arquitetura.md).

    O corpo desta issue ainda descreve o plano antigo (e-mail de ativação, IEmailSender, MailKit, Mailpit, resendAccess, emailSent). Ele será reescrito com /levantar-issue, depois que as regras AUTH e USR forem reescritas em docs/product/. Não executar a issue pelo corpo atual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions