Skip to content

Notify use-case admins of pending access requests#17

Merged
Daniel-VM merged 2 commits into
BIPLAT-CIBERINFEC:developfrom
Daniel-VM:feature/keycloak-admin-access-request-notifications
Jun 29, 2026
Merged

Notify use-case admins of pending access requests#17
Daniel-VM merged 2 commits into
BIPLAT-CIBERINFEC:developfrom
Daniel-VM:feature/keycloak-admin-access-request-notifications

Conversation

@Daniel-VM

@Daniel-VM Daniel-VM commented Jun 29, 2026

Copy link
Copy Markdown
Member

Access request notification workflow:

  1. A public user submits a new AccessRequest.

  2. pathocore-api stores the request with status=pending.

  3. Instead of notifying only a static email list, pathocore-api queries Keycloak.

  4. The API resolves enabled users with email addresses from the matching use-case admin group:

    /use-cases/<use_case>/admin

    Example for MEPRAM:

    /use-cases/mepram/admin

  5. Those use-case admins receive the “new pending access request” email.

  6. PATHOCORE_ACCESS_REQUEST_ADMIN_EMAILS remains available as fallback/general-copy recipients.

Summary

  • Notify enabled Keycloak users in the matching use-case admin group when a new access request is created.
  • Keep PATHOCORE_ACCESS_REQUEST_ADMIN_EMAILS as fallback/general-copy recipients if Keycloak lookup fails or extra admins should be notified.
  • Add tests for Keycloak-derived recipients and fallback behavior.

Notes

Admin notification recipients are resolved from groups such as /use-cases/mepram/admin. Duplicate emails are removed before sending.

Validation

  • python3 -m compileall -q core conf
  • git diff --check
  • python manage.py test core.tests.AccessRequestWorkflowTests

@Daniel-VM
Daniel-VM marked this pull request as ready for review June 29, 2026 14:14
@Daniel-VM
Daniel-VM merged commit 0b0319f into BIPLAT-CIBERINFEC:develop Jun 29, 2026
2 checks 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.

1 participant