[ 
https://issues.apache.org/jira/browse/KNOX-3396?focusedWorklogId=1032002&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1032002
 ]

ASF GitHub Bot logged work on KNOX-3396:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jul/26 09:02
            Start Date: 24/Jul/26 09:02
    Worklog Time Spent: 10m 
      Work Description: smolnar82 opened a new pull request, #1328:
URL: https://github.com/apache/knox/pull/1328

   [KNOX-3396](https://issues.apache.org/jira/browse/KNOX-3396) - Fix 
trusted-OIDC-issuer register API returning 500 for client-actionable errors
   
   ## What changes were proposed in this pull request?
   
   Follow-up to KNOX-3368 (#1327), hardening the `POST` register endpoint of 
the trusted-OIDC-issuer admin API so that client-actionable conditions return 
the correct `4xx` status instead of a misleading `500`:
   
   1. **Typed request bean.** `registerIssuer` now deserializes the body into a 
new `RegisterIssuerRequest` DTO instead of a generic `Map<String, Object>` with 
blind casts.
   2. **Differentiated exception handling.** The service throws 
`IllegalStateException` when the configured `MAX_TRUSTED_ISSUERS` limit is 
reached: an operator-facing capacity condition. This is now caught separately 
and mapped to `409 issuer_limit_reached`, so it is distinguishable from a 
genuine storage failure (still `500 storage_error`).
   
   Parsing remains inside the `try` block, so the audit-on-every-path behavior 
and the malformed-JSON handling are unchanged. Validation ordering, the 
SSRF/HTTPS gate, the error-response contract, and the other endpoints 
`GET`/`DELETE`/`refresh-jwks`) are untouched.
   
   ## How was this patch tested?
   
   Automated unit tests in `TrustedOidcIssuersResourceTest` (module 
`gateway-service-knoxidf`). Two cases were added:
   - `testRegisterWrongTypeFieldReturnsBadRequest`: an array-valued 
`clusterName` now returns `400 invalid_request` (was `500` before the fix).
   - `testRegisterIssuerLimitReached`: the service throwing 
`IllegalStateException` now returns `409 issuer_limit_reached`.
   
   ## Integration Tests
   N/A
   
   ## UI changes
   N/A




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1032002)
    Remaining Estimate: 0h
            Time Spent: 10m

> Address comments in PR 1327
> ---------------------------
>
>                 Key: KNOX-3396
>                 URL: https://issues.apache.org/jira/browse/KNOX-3396
>             Project: Apache Knox
>          Issue Type: Sub-task
>          Components: Server
>    Affects Versions: 3.1.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 3.1.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to