feat(attestations): add ListSigningCertificates

What does this MR do and why?

Adds AttestationsService.ListSigningCertificates, which wraps List all signing certificates (GET /projects/:id/attestations/signing_certificates, new in GitLab 19.6). It returns the unexpired certificate authority (CA) certificates of a project, active and inactive, as []*SigningCertificate, and takes ListSigningCertificatesOptions for page and per_page.

The GitLab CLI needs it to verify LOCAL_CA attestations: glab attestation verify will build its trusted root from these certificates. The docs say to trust all of them, including inactive ones, so the method returns both.

Is this a breaking change?

No. It adds one method and two types.

How to validate

  • make reviewable passes. make generate only regenerates testing/attestations_mock.go.
  • The new TestListSigningCertificates checks the path, the page and per_page query, and all five fields for an inactive and an active certificate.
  • On GitLab.com, ListSigningCertificates for project 72356192 returns an empty list.
  • On a local GitLab with the feature flag on, ListSigningCertificates (paged through with ScanAndCollect) returns the project CA. Its ExpiresAt matches the NotAfter of the parsed PEM certificate.
  • No integration test: the endpoint needs GitLab Ultimate and the slsa_provenance_statement feature flag, and a project only gets a signing certificate after a pipeline signs a LOCAL_CA attestation, which the gitlab_test instance cannot do.

References

Merge request reports

Loading
Loading