flip_api.trusts_services.admin_get_trusts

Attributes

router

Functions

_as_utc_iso(→ str | None)

Serialise a naive UTC datetime as an ISO-8601 string with a Z marker.

admin_get_trusts(, token_id)

List every trust with admin-level fields.

Module Contents

flip_api.trusts_services.admin_get_trusts.router
flip_api.trusts_services.admin_get_trusts._as_utc_iso(value: datetime.datetime | None) str | None

Serialise a naive UTC datetime as an ISO-8601 string with a Z marker.

The Trust columns are timestamp without time zone but values are written via datetime.now(timezone.utc) — so they’re already UTC, the timezone is just stripped on persist. Tagging the wire format prevents the browser from treating the naive ISO as local time.

flip_api.trusts_services.admin_get_trusts.admin_get_trusts(db: sqlmodel.Session = Depends(get_session), token_id: uuid.UUID = Depends(verify_token)) list[flip_api.domain.interfaces.trust.IAdminTrust]

List every trust with admin-level fields.

Parameters:
  • db (Session) – Database session.

  • token_id (UUID) – Authenticated user ID, used for the admin permission check.

Returns:

Every trust with name, created_at, last_heartbeat, and project_count (count of rows in project_trust_intersect).

Return type:

list[IAdminTrust]

Raises:

HTTPException – 403 if the caller lacks CAN_ACCESS_ADMIN_PANEL; 500 on database error.