Skip to content

feat(people): register people before login and expose role assignment dates - #75

Merged
toto04 merged 2 commits into
feat/people-role-apifrom
feat/people-role-since
Oct 27, 2026
Merged

toto04 merged 2 commits into
feat/people-role-apifrom
feat/people-role-since

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

People can register a person in Auth before their first login, using only first and last name, optional contacts, and initial bound admin/team roles. Auth remains the authority for identity details and role assignments. This extends #73 and supports PoliNetworkOrg/backend#99 and PoliNetworkOrg/admin#136.

  • Migration 0024_people_registration.sql stores declared contacts separately from verified provider evidence. The preliminary Auth subject has no credentials, provider accounts or sessions, and is excluded from the login-account/signing picker.
  • The existing backend-only endpoint accepts idempotent create-person, update-person and link-person commands. Creation/contact editing require admin:access and people:write; every role assignment still passes the original delegation checks. Reused IDs with changed input are refused.
  • Verified app email or Telegram identity produces a review proposal. Homonyms are name-only hints; conflicting identifiers require review. No contact or name automatically links accounts or grants access.
  • A Master Admin approves the identity link. Auth atomically transfers the preliminary person's current bound roles to the existing login account, keeping that account's other roles and provider accounts. A stable registration ID lets People retain its record and history, including after a backend restart or a lost response.
  • Directory responses also expose users[].since, the earliest assignment date conferring each held bound role, including inheritance.

Validation: check, typecheck, all tests and production build/bundle validation passed. 352 tests passed and 117 were skipped, with the People role PostgreSQL suite enabled on a disposable migrated database. New coverage checks contact matching, ambiguity, no pre-login provider account, idempotent creation, rejected non-Master linking, Master approval and canonical directory identity.

Merge into #73 first. Deploy Auth and apply migration 0024 before the matching backend/dashboard feature. Keep the People role bindings and backend idp:people:roles scope configured. Other integration suites requiring their own external configuration remain skipped; no production mutation or real-provider sign-in was performed.

People reads who holds its bound roles from GET /api/internal/people-roles on every operation instead of keeping a copy, so it needs this IdP to say when each role started: since maps every held bound role to the date (YYYY-MM-DD, UTC) of the earliest assignment that confers it, directly or through a parent role.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e241727d-6788-4d0d-b859-a68e48b267c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Keep preliminary identities and declared contacts in Auth without credentials or provider accounts. Offer verified identity and name-only review proposals; require Master Admin approval to transfer current bound roles to a real login account while preserving provider accounts and existing roles.

Add the preliminary-person migration and idempotent creation, contact editing and linking commands, with PostgreSQL and matching coverage.
@BIA3IA BIA3IA changed the title feat(rbac): say since when each People role is held feat(people): register people before login and expose role assignment dates Oct 27, 2026
@toto04
toto04 merged commit b57a858 into feat/people-role-api Oct 27, 2026
1 check passed
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.

2 participants