sha174n opened a new pull request, #38847:
URL: https://github.com/apache/superset/pull/38847

   ### SUMMARY
   
   Resolves the long-standing `# TODO if email check validity` comment in 
`ReportRecipientConfigJSONSchema` by adding a `validates_schema` hook on 
`ReportRecipientSchema`.
   
   The hook rejects malformed email addresses for `target`, `ccTarget`, and 
`bccTarget` fields when the recipient type is `Email`. Slack and Webhook 
recipients are unaffected.
   
   **Before:** the schema accepted any string as an email address, deferring 
validation (if any) to the mail transport layer.
   
   **After:** marshmallow returns a 400 with a descriptive error at the API 
boundary if an invalid address is supplied.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — API-only change.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest tests/unit_tests/reports/schemas_test.py
   ```
   
   Manual: POST/PUT to `/api/v1/report/` with an `Email` recipient containing a 
malformed address (e.g. `"not-an-email"`) — expect HTTP 400 with a 
`recipient_config_json` validation error. Valid addresses and non-Email 
recipient types should be unaffected.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to