vault/builtin
Vault Automation 9cfcfec78a
Count duration adjusted certificate counts for billing (#12286) (#12310)
* Change PkiCertificateCountManager.GetCounts() to return a CertCount.

* Add PkiDurationAdjustedCerts field to CertCount.

Add a new field to CertCount to keep track of "duration adjusted" issued
certificates.

Add an x509.Certificate argument to CertCountIncrementer.AddIssuedCertificate.
In the implementation, use the certificate's NotBefore and NotAfter fields to
calculate the validity duration for the certificate, and use that to compute the
duration adjusted units.

* Add the issued certificate to calls to AddIssuedCertificate.

* Add PkiDurationAdjustedCerts when forwarding counts.

Add pki_duration_adjusted_certificate_count to IncrementPkiCount proto.

Update replicationServiceHandler.IncrementPkiCertCountRequest to take into
account the new field.

* Run make proto.

* Update testingPkiCertificateCounter to make assertions on time adjusted counts.

* PR review: Don't use NotAfter.Sub(NotBefore), since time.Duration is max 290 years.

* PR review: Move DurationAdjustedCertificateCount to logical.pki/test_helpers.

Add Bob generated unit tests for logical.durationAdjustedCertificateCount.

* Run make fmt.

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-02-13 09:41:37 -05:00
..
credential Backport rotationMgr: enable RM to send rotation information to plugins on registration/rotation operations into ce/main (#12308) 2026-02-12 18:25:47 -06:00
logical Count duration adjusted certificate counts for billing (#12286) (#12310) 2026-02-13 09:41:37 -05:00
plugin license: update headers to IBM Corp. (#10229) (#10233) 2025-10-21 15:20:20 -06:00