Sigra.Admin.Users.Detail (Sigra v0.2.4)

Copy Markdown View Source

Scope-safe loader for the admin user detail surface.

Summary

Functions

list_identities(config, user, opts \\ [])

@spec list_identities(map(), struct(), keyword()) :: [struct()]

load!(config, admin_scope, user_id)

@spec load!(map(), Sigra.Admin.Scope.t(), binary()) :: map()

load_user!(config, admin_scope, user_id)

@spec load_user!(map(), Sigra.Admin.Scope.t(), binary()) :: struct()

recent_audit_preview(config, admin_scope, user_id)

@spec recent_audit_preview(map(), Sigra.Admin.Scope.t(), binary()) :: [map()]

Returns up to @audit_preview_limit most-recent audit events for user_id, already shaped by Sigra.Admin.Audit.Presenter.present/2.

Each returned row is a map with the guaranteed keys:

  • :id — audit event id (binary)
  • :inserted_atDateTime.t()
  • :action — raw action string (e.g. "admin.impersonation.start")
  • :action_label — human-readable label (e.g. "Impersonation started")
  • :action_badge"Impersonation" when the row represents impersonation activity, otherwise nil
  • :actor_label, :effective_user_label — individual user labels for the full explorer
  • :actor_summary — combined label preferred by compact previews
  • :outcomeevent.outcome || "success"

Preview renderers MUST NOT introduce fields outside this set (see D-07 in the Phase 33 context). If a new preview field is needed, add it to Sigra.Admin.Audit.Presenter first so the preview and the full explorer stay coherent.