Skip to content

feat: add support to filter certs by subject_key_id#326

Merged
jjrodrig merged 1 commit intomainfrom
feat/ski-filterable
Oct 7, 2025
Merged

feat: add support to filter certs by subject_key_id#326
jjrodrig merged 1 commit intomainfrom
feat/ski-filterable

Conversation

@jjrodrig
Copy link
Member

@jjrodrig jjrodrig commented Oct 7, 2025

This pull request adds support for filtering certificates by their Subject Key ID (subject_key_id). The changes include updates to the certificate filtering logic, test coverage for this new filter, and validation of query parsing in controllers.

Filtering enhancements

  • Added "subject_key_id" as a supported filter field in the CertificateFiltrableFields map in core/pkg/resources/fields.go, enabling API clients to filter certificates by their Subject Key ID.

Test coverage

  • Added a new test TestGetCertificatesFilterBySubjectKeyID to backend/pkg/assemblers/ca_certificates_test.go that creates two certificates with different Subject Key IDs and verifies that filtering by subject_key_id returns the correct certificate.
  • Imported the resources package in backend/pkg/assemblers/ca_certificates_test.go to support new filter logic in tests.
  • Added a test TestFilterQuery_SubjectKeyID in backend/pkg/controllers/utils_test.go to verify that HTTP query parsing correctly recognizes and applies the subject_key_id filter.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 7, 2025

@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.62%. Comparing base (61ef82e) to head (3e7a6ab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #326   +/-   ##
=======================================
  Coverage   46.62%   46.62%           
=======================================
  Files         137      137           
  Lines        9908     9908           
=======================================
  Hits         4620     4620           
  Misses       4884     4884           
  Partials      404      404           
Flag Coverage Δ
backend 58.30% <ø> (ø)
connector-awsiot 4.88% <ø> (ø)
core 63.22% <ø> (ø)
monolithic 0.00% <ø> (ø)
sdk 0.00% <ø> (ø)
shared-http 7.07% <ø> (ø)
storage-postgres 54.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jjrodrig jjrodrig merged commit 15304f7 into main Oct 7, 2025
37 checks passed
@jjrodrig jjrodrig deleted the feat/ski-filterable branch October 7, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants