lasdf1234 opened a new pull request, #11493: URL: https://github.com/apache/gravitino/pull/11493
### What changes were proposed in this pull request? - Add 128-character length validation for IDP usernames and group names in `IdpCredentialValidator` before persistence. - Route group name validation through `AddGroupRequest.validate()` via `validateGroupName()`. - Add unit and integration tests for over-length username/group name requests (HTTP 400, `ILLEGAL_ARGUMENTS_CODE`). - Align IDP OpenAPI examples and responses with actual REST behavior (403, per-operation examples, descriptions). ### Why are the changes needed? When creating an IDP user or group with a name longer than 128 characters, the server previously hit the database constraint and returned HTTP 500 with internal DB error details exposed. Validation at the API layer returns HTTP 400 with a clear message instead. Fix: #11434 ### Does this PR introduce _any_ user-facing change? 1. `POST /api/idp/users` and `POST /api/idp/groups` now return HTTP 400 with `code: 1001` when the name exceeds 128 characters, instead of HTTP 500. 2. IDP OpenAPI documentation updated for error/success examples and 403 responses. ### How was this patch tested? - `./gradlew spotlessApply` - `./gradlew :plugins:idp-basic:test -PskipITs -PskipDockerTests=true` - `./gradlew :docs:lintIdpOpenAPI` Made with [Cursor](https://cursor.com) -- 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]
