fix(gdpr): send export email in POST body, not GET query string#1235
Open
euniceamoni wants to merge 2 commits into
Open
fix(gdpr): send export email in POST body, not GET query string#1235euniceamoni wants to merge 2 commits into
euniceamoni wants to merge 2 commits into
Conversation
PII (email address) was being sent as a URL query parameter on
GET /api/v1/newsletter/gdpr/export, exposing it to server access
logs, browser history, and proxy logs.
Changes:
- frontend: newsletterGdprExport now uses POST with body: { email }
instead of GET with params: { email } (client.ts)
- backend: added NewsletterExportBody struct, changed handler extractor
from Query to Json, updated utoipa path attribute to post,
updated route registration from get() to post() (handlers.rs, main.rs)
- tests: updated it.each entry to expect POST; added new test in
'GDPR export (solutions-plug#1156)' describe block asserting email is in the
request body and absent from the URL
Fixes solutions-plug#1156
|
@euniceamoni Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Update openapi.yaml /api/v1/newsletter/gdpr/export from GET with query parameter to POST with requestBody (EmailRequest schema), matching the handler change in handlers.rs. Update SPEC_ROUTES in openapi_contract_test.rs from GET to POST to keep the contract test in sync with the spec and runtime router.
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
Fixes #1156
The GDPR data export endpoint was sending the user's email address as a URL query parameter (
GET /api/v1/newsletter/gdpr/export?email=...), exposing PII to server access logs, browser history, and intermediary proxy logs.Changes
Frontend (
client.ts)newsletterGdprExportchanged fromGET+params: { email }toPOST+body: { email }Backend (
handlers.rs,main.rs)NewsletterExportBodystruct for JSON body deserializationQuery<NewsletterExportQuery>toJson<NewsletterExportBody>#[utoipa::path]updated fromgettopostwithrequest_bodyget()topost()Tests (
client.test.ts)it.eachentry fornewsletterGdprExportto expectPOSTdescribe('GDPR export (#1156)')with a test asserting:Testing
All 50 tests pass, including the new GDPR export test.
Build
next buildcompiles successfully with zero warnings. closes #1156