Commit graph

2 commits

Author SHA1 Message Date
Vault Automation
be244e8702
VAULT-42829: Create a new billing/config endpoint to set retention months (#14785) (#14945)
* spike

* seperate overview and config into 2 paths, enable overview in admin too, restrict config to root

* warn on error, do not log msg

* rename default const

* change storage approach to string-based pattern

* rename method

* fmt

* linters

* add all response types for the path

* use get from sdk

* add api client methods and tests

* update unit test

* add cleanup and deletion tests

* fix comments, add custom retention test wwith start and end months

* add namespace tests

* consolidate validation into one check

* fix comments

* add changelog

* fix test

* fix subpath for config

* add and use a new lock for get and update methods

* add a warning for when retention is increased

* Update vault/consumption_billing_test.go



* remove redundant TestSystemBackend_BillingConfig_Persistence test

* integrate warnings testing into another test and remove redundant test

---------

Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com>
2026-05-21 19:14:50 +00:00
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