fix(certs): default to active certs when no search term #2

Merged
supportgsc merged 1 commits from fix/certs-list-default into main 2026-06-01 10:14:17 +00:00
Owner

GET /api/v1/certs with no ?search sent an empty criteria list to EJBCA's certificate/search, which rejects it (Invalid criteria value, cannot be empty) → ops-api returned 500. Default to a STATUS=CERT_ACTIVE criterion when no search term is given, so the list endpoint returns active certificates. Search-by-query is unchanged.

Verified on the live service (binary 1.1.1): GET /certs → 200 (50 active certs); GET /certs?search=ops-api-ra → 200 (1).

Part of enabling /certs: the EJBCA REST Certificate Management protocol was enabled on fihelvca01 and a scoped ops-api-ra admin cert/role provisioned (cert at /etc/gsc-ops-api/tls/ejbca-client.*).

🤖 Generated with Claude Code

`GET /api/v1/certs` with no `?search` sent an empty criteria list to EJBCA's `certificate/search`, which rejects it (`Invalid criteria value, cannot be empty`) → ops-api returned 500. Default to a `STATUS=CERT_ACTIVE` criterion when no search term is given, so the list endpoint returns active certificates. Search-by-query is unchanged. Verified on the live service (binary `1.1.1`): `GET /certs` → 200 (50 active certs); `GET /certs?search=ops-api-ra` → 200 (1). Part of enabling `/certs`: the EJBCA REST Certificate Management protocol was enabled on fihelvca01 and a scoped `ops-api-ra` admin cert/role provisioned (cert at `/etc/gsc-ops-api/tls/ejbca-client.*`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
supportgsc added 1 commit 2026-06-01 10:14:06 +00:00
EJBCA's certificate/search REST endpoint rejects an empty criteria list
("Invalid criteria value, cannot be empty"), so GET /certs with no ?search
returned a 500. Default to a STATUS=CERT_ACTIVE criterion in that case so the
list endpoint returns active certificates. Search-by-query is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
supportgsc merged commit f6a9d5e312 into main 2026-06-01 10:14:17 +00:00
supportgsc deleted branch fix/certs-list-default 2026-06-01 10:14:21 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GoSec_Cloud/gsc-ops-api#2