Skip to content

Feat: hash plaintext email for SHA256_EMAIL identifier#16

Open
ZLeventer wants to merge 2 commits intolinkedin-developers:mainfrom
ZLeventer:feat/hash-email-sha256
Open

Feat: hash plaintext email for SHA256_EMAIL identifier#16
ZLeventer wants to merge 2 commits intolinkedin-developers:mainfrom
ZLeventer:feat/hash-email-sha256

Conversation

@ZLeventer
Copy link
Copy Markdown

Summary

  • Fixes if user_data.email_address exists, template should hash that value and use it for SHA256_EMAIL identifier #1 — plaintext user_data.email_address is now properly routed through hashData()/sha256Sync for the SHA256_EMAIL identifier
  • Refactored getUserEmail() to clearly separate three email source paths:
    1. UI override (userIdsOverride.email) — returned directly
    2. Pre-hashed (user_data.sha256_email_address) — returned directly
    3. Plaintext (eventModel.email, user_data.email_address, user_data.email) — returned for hashing by hashData() in getUserIds()
  • The old single OR chain mixed hashed and unhashed values, making the hashing flow opaque

Test plan

  • Provide a plaintext user_data.email_address and verify it gets SHA256-hashed in the CAPI payload
  • Provide a pre-hashed user_data.sha256_email_address and verify it passes through without double-hashing
  • Verify UI override still takes priority
  • Verify existing behavior is preserved when no email is provided

ZLeventer and others added 2 commits April 23, 2026 21:10
…pers#14)

Guard against undefined conversionValue before calling JSON.parse to
prevent the tag from throwing when no conversion value is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…in-developers#1)

Refactor getUserEmail() to explicitly separate the three email source
paths (UI override, pre-hashed sha256_email_address, and plaintext
email_address) so the hashing flow via hashData()/sha256Sync is clear
and plaintext emails from user_data.email_address are always SHA-256
hashed before being sent as the SHA256_EMAIL user identifier.

Closes linkedin-developers#1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

if user_data.email_address exists, template should hash that value and use it for SHA256_EMAIL identifier

1 participant