You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Studio][Bug] Creating a K8s certificate accepts blank or padded identities that the update API rejects #4299
POST /api/k8s-certs/create accepts certificate identities that POST /api/k8s-certs/update refuses,
and stores them verbatim:
a whitespace-only issuer (" ") or k8sId/cluster is accepted and persisted without trimming,
while the same value sent to the update API is rejected with 400 Certificate issuer cannot be blank;
the stored value keeps its padding, so k8sId / cluster / issuer read back as " new-tls-cert ".
The bundled web dialog happens to send values.k8sId.trim() and values.cluster.trim()
(web/src/pages/cluster/certs.tsx:104-105), so the inconsistency only shows for any other API client -
and the server is the component that owns the contract.
createCert passes the submitted identities straight through, while updateCert routes the same three
fields through normalizeOptionalIdentity (:120-122, :175-184), which trims and rejects a blank
value. CreateCertDTO's @NotBlank constraints accept surrounding whitespace, so they do not close the
gap either.
3. Impact
A certificate row can be created in a state the update API cannot produce, so the two write paths
disagree about what a valid identity is.
Padded identities are stored and returned padded, which breaks later exact-match lookups and makes the
inventory look like it contains duplicates ("prod" and " prod").
Fixing it afterwards requires an update call that a client written against the create contract may not
expect to fail.
4. Reproduction
POST /api/k8s-certs/create with {"k8sId": " new-tls-cert ", "cluster": " test-cluster ", "type": "TLS", "issuer": " vault "}.
Response: 200 with k8sId" new-tls-cert " and issuer" vault ".
POST /api/k8s-certs/update with {"id": <id>, "issuer": " "}: 400 Certificate issuer cannot be blank.
5. Expected behaviour
createCert normalises k8sId, cluster and issuer exactly like updateCert: trimmed, blank
rejected with 400 Certificate <field> cannot be blank.
A value derived from a supplied certPem is unaffected: when a certificate is uploaded, its parsed
issuer/SAN still win over the submitted ones.
Thank you for reporting this. It has been classified as a potential bug and is queued for code-level verification against the current codebase.
If confirmed, an automated fix proposal may be generated. You can reply with /approve to proceed, or provide additional context to help with verification.
This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.
Activity
RockteMQ-AI commentedon Sep 15, 2026
Issue Evaluation
Category:
bug| Status: Under ReviewThank you for reporting this. It has been classified as a potential bug and is queued for code-level verification against the current codebase.
If confirmed, an automated fix proposal may be generated. You can reply with
/approveto proceed, or provide additional context to help with verification.Automated evaluation by RockteMQ-AI
github-actions commentedon Sep 23, 2026
This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.