aimee-RH opened a new pull request, #577:
URL: https://github.com/apache/airavata-custos/pull/577
## Summary
Add PostgreSQL-backed portal sign-in activity capture and read APIs for the
User Activity dashboard. This PR contains backend code, migrations, tests, and
the OpenAPI contract. No `web/` files or Compute Usage changes are included.
This is the backend counterpart to #573. The backend should merge before the
frontend PR.
## Behavior
- `POST /me/login-events` records the authenticated user's sign-in using
verified OIDC claims. Repeating the same sign-in is idempotent.
- `GET /users/activity` returns one row per user with an OIDC-linked
identity, with window, status, search, sort, and pagination filters.
- `GET /users/activity/analytics` and `GET /users/{id}/activity/analytics`
provide population and per-user sign-in analytics.
- The three read endpoints require the new `core:users:activity:read`
privilege.
- `active`, `dormant`, `never`, and all login counts describe **portal
sign-ins**, not compute or general activity. Trend distinct users and sign-ins
are separate measures.
Migration `000007_user_activity` adds the event log, daily rollups, and user
summary fields. Its down migration also removes the activity-read privilege
backfill.
Calendar-day calculations use a stored IANA user timezone when available and
fall back to UTC when it is missing or invalid. This PR does not add a
production timezone preference endpoint, so users without a populated timezone
currently use UTC.
## Verification
- Go formatting, build, vet, unit tests, and PostgreSQL integration tests
passed.
- Migration up/down and OpenAPI generation were checked.
- [[Core Verify CI on the
fork](https://github.com/aimee-RH/airavata-custos/actions/runs/36141666841)](https://github.com/aimee-RH/airavata-custos/actions/runs/36141666841)
passed for this backend commit.
- A local browser test ran the portal with Keycloak 26 and PostgreSQL 17:
OIDC sign-in created a login event, and the User Activity page and analytics
endpoints returned the recorded activity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]