1 Commits

Author SHA1 Message Date
Vault Automation
c0e8de6ed9
VAULT-41572: hookup billing overview endpoint (#12328) (#12451)
* hookup the new path to the system backend

* add API client method for the new endpoint

* add test for the api method structure

* adjust the path implementation to capture all so-far added metrics

* add tests

* add go docs to the tests

* add more tests

* feedback: add go doc to test

* feedback: use require in tests

* fix the api: use parse secret method to properly parse response, add mapstructure definitions to api structs

* feedback: fix api method test by using mock api response

* Update vault/logical_system_use_case_billing.go



* Update vault/logical_system_use_case_billing.go



* feedback: refactor build month data method into methods that collect data separately

* feedback: make update_counts parameter a new user set field for the endpoint

* feedback: remove basic comments

* update logic around determining updated at field

* fix tests: add actual data and fix some assertions

* separate out ent only features from the neutral test file

* add a new test file to test ent only features

* call one update method to update all metrics

* add external tests for the endpoint

* add a changelog

* feedback: rename update_counts parameter to refresh_data

* feedback: fix determination of updated_at field

* feedback: convert created methods into core methods from system backend methods

* Update changelog/12328.txt



* feedback: create a new atomic tracker of last updated time for the metrics update and use that in the endpoint

* add unit tests to test updated_at

* always build metrics, even when the values are 0

* add test coverage to verify metrics still exist in the response with zero values even when there are no billing resources

* feedback: remove manual check of root namespace - rely on system backend to enforce root namespace restriction

* remove namespace test from oss test file

* properly accomodate new totp metric

* add pki cert and totp to endpoint response, add test coverage

* rename changelog file

* linters

* change changelog type to improvement, make the file CE and ENT

* test ent changelog

* fix some tests after the addition of totp and pki

* add test coverage for the new metrics in external and api tests

* make changelog CE file

---------

Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
2026-02-20 08:17:23 -05:00