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

   ### SUMMARY
   
   Surface field-level validation messages returned by the user API for HTTP 
400 responses. Flask-AppBuilder uses 400 for Marshmallow validation errors such 
as password-complexity failures, while duplicate username/email database errors 
remain 422 and retain their existing friendly messages.
   
   This keeps the API's established status-code contract intact rather than 
changing a shared Flask-AppBuilder endpoint. Client-side password-complexity 
checks are intentionally not duplicated because minimum length and blocklists 
are operator-configurable server policy.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before:** Submitting a password shorter than the configured minimum showed 
the generic red toast: “There was an error creating the user. Please, try 
again.”
   
   **After:** The same submission shows the server-provided reason in the red 
toast: “Password must be at least 8 characters long.” (The number follows the 
server's configured policy.)
   
   ### TESTING INSTRUCTIONS
   
   1. Open **Settings → List Users → + User** as an administrator.
   2. Complete the required fields and submit matching passwords shorter than 
the configured minimum.
   3. Confirm the toast displays the specific minimum-length validation message 
and the user is not created.
   4. Try creating a user with an existing username and confirm the existing 
friendly duplicate-username toast remains unchanged.
   
   Automated test:
   
   ```bash
   cd superset-frontend
   npm run test -- src/features/users/UserListModal.test.tsx --runInBand
   ```
   
   The focused Jest suite passes (2 tests). Pre-commit formatting, linting, 
custom rules, and style checks pass. The targeted type-check hook cannot 
complete in this fresh worktree because generated `packages/*/lib` declarations 
have not been built; its reported errors are in unrelated existing files.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] 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