89799969 opened a new pull request, #4350:
URL: https://github.com/apache/rocketmq-dashboard/pull/4350

   ## What
   
   Make `POST /api/k8s-certs/create` normalize `k8sId`, `cluster`, and `issuer` 
the same way `update` already does.
   
   ## Why
   
   `createCert` stored submitted identities verbatim while `updateCert` trims 
and rejects blank values. Consequences:
   
   - padded identities (`" new-tls-cert "`) are persisted and break exact-match 
lookups;
   - whitespace-only `issuer` is accepted on create but rejected on update;
   - a certificate row can exist in a state the update API cannot produce.
   
   `CreateCertDTO` `@NotBlank` does not close the gap because it allows 
surrounding whitespace, and `issuer` is unconstrained.
   
   ## How
   
   - Trim/reject blank `k8sId` and `cluster` via `normalizeOptionalIdentity`.
   - Normalize submitted `issuer` when no PEM overrides it.
   - PEM-parsed issuer/SAN still win when `certPem` is present.
   
   ## Tests
   
   `K8sCertServiceTest`:
   
   - `createCertShouldTrimIdentityFields`
   - `createCertShouldRejectBlankIssuerWithoutPem`
   
   Focused run: `mvn -Dtest=K8sCertServiceTest test` (JDK 21) — passed.
   
   Fixes #4299


-- 
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]

Reply via email to