Harden log export CSV and fix profile loader boundary

Load SCIM profile emails via Identities in the export
layer, drop the cross-table join, sanitize formula-leading
cells, and fall back to validated userName when profile email
is missing. Drop redundant gid array casts in LoadByIDs.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-29 22:04:35 +00:00
parent 45a7a428bf
commit c5b1f210d5
5 changed files with 83 additions and 11 deletions

View File

@@ -507,7 +507,7 @@ SELECT
p.id,
p.identity_id,
p.organization_id,
i.email_address,
''::citext AS email_address,
p.source,
p.state,
p.full_name,
@@ -540,8 +540,6 @@ SELECT
p.updated_at
FROM
iam_membership_profiles p
INNER JOIN identities i
ON i.id = p.identity_id
WHERE
p.%s
AND p.organization_id = @organization_id