feat(gs): add email to userDataId lookup to debug tooling#3841
Open
TaprootFreak wants to merge 4 commits into
Open
feat(gs): add email to userDataId lookup to debug tooling#3841TaprootFreak wants to merge 4 commits into
TaprootFreak wants to merge 4 commits into
Conversation
The /gs/debug SQL endpoint blocks the user_data.mail column (PII), so an email address cannot be resolved to a userDataId via SQL. Add a dedicated POST /gs/debug/user endpoint (DEBUG role) that returns only non-PII identifiers, plus a -u/--user flag in scripts/db-debug.sh.
Mirror the compliance search result shape ({ type, userDataIds }) and
return solely non-PII userDataIds (deduplicated, sorted) — never name,
mail or other personal data.
Make the no-PII guarantee explicit: feed records carrying firstname/surname and assert the serialized response contains only userDataIds.
Use absolute import paths per the contribution guide and skip loading unused relations (only the id is read) in the mail resolution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
POST /gs/debugSQL endpoint blocks theuser_data.mailcolumn (PII) viaDebugBlockedCols, so an email address cannot be resolved to auserDataIdthrough SQL. This adds a sanctioned, narrow reverse lookup that mirrors the existing compliance search.POST /gs/debug/userendpoint (DEBUG role), body{ mail }.{ type, userDataIds }— neverfirstname,surname,mail, or any other PII. A mail can map to several accounts (test aliases / merges), souserDataIdsis a deduplicated, sorted list.UserDataService.getUsersByMail(mail, false)the compliance search uses for a mail (statusunfiltered, incl. merged). The email is never logged.-u/--user <email>flag inscripts/db-debug.sh.Test plan
npm run lintnpm run format:checknpm run buildnpm run test(gs.service spec: 33 passing, incl. cases proving the result contains onlyuserDataIdseven when the resolved records carry names, plus dedup/sort and empty-result)./scripts/db-debug.sh --user <email>against an environment returns the matchinguserDataId(s)