208 Commits

Author SHA1 Message Date
Vault Automation
ccbca205c9
VAULT-42443 Update alias API for external JWT entity binding (#13053) (#13384)
* wip

* crud and internal lookups working

* worked with bob on tests

* add and fix some tests

* update logical identity protobuf

* pass in empty issuer via scim and add test

* tidy tests and address linter

* VAULT-42443 Update alias API for external JWT entity binding

* test cleanup

* changes

* changelog

* update fix

* address feedback

* whoopsie

* fix stubs

* namespace guarding, more test

* further fix

* Fixes

* I'm dumb

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
2026-03-25 12:21:59 -04:00
Vault Automation
b8c81b84c8
External lazy materialization (#12909) (#13383)
* vault: lazily materialize external tokens

Implement stub-first auth flow to avoid token-store writes on read-only requests, materialize only on lease registration, cache materialized token IDs by fingerprint, and add coverage for standby/leader materialization behavior.



* vault: align lazy JWT materialization with main

Adjust standby materialization behavior to main branch APIs, keep lease-time forwarding conversion, and update enterprise tests to match current standby error paths.



* vault: align jwt lazy materialization follow-ups

Apply naming and test-practice follow-ups, document cache-size rationale, simplify stub-use gating, and add external JWT e2e/benchmark coverage that measures raft writes for passthrough vs leased flows.



* vault: sanitize jwt lazy materialization logs



* vault: move jwt stub audit labels to ent



* vault: keep ent token type in audit logs

Remove audit token_type override and jwt_stub audit labeling so enterprise JWT tokens are consistently reported as ent while preserving existing request handling behavior.



* vault: rename unpersisted JWT token state

Rename IsStub/JwtStub to IsUnpersisted/JwtUnpersisted and switch serialized key to jwt_unpersisted for clearer storage semantics.



* vault: use storage-backed JWT token naming

Rename JWT token persistence marker to IsStorageBacked/JwtStorageBacked and clarify docs that passthrough JWT requests may never write token state to storage.



* vault: address jwt token materialization regressions

Fix storage-backed checks for non-ent tokens, materialize JWTs for lookup endpoints, and add lookup-self regression coverage.



* vault: thread perf standby state into jwt materialization

Pass perf standby state through materializeEnterpriseTokenForLease call sites to avoid unsynchronized state reads in request handling paths.



* test: harden flaky enterprise timing checks

Increase timing tolerance in flaky CI tests without changing runtime behavior.



* test: document CI timing tolerance in flaky tests

Add comments clarifying widened waits are for CI scheduling jitter and asynchronous convergence, not behavior changes.



* vault: remove sensitive token logging

Drop clear-text token value from SSC token MAC mismatch debug logging and keep census test unchanged per request.



* vault: tighten request logging for security scan

Remove remaining error-derived logging fields in request handling token/JWT revoke paths to satisfy clear-text sensitive logging findings.



* vault: use typed no-rpc-client errors

Replace string-based no-rpc-client error matching with a dedicated error type and update perf-standby callsites to return it.



* test: harden perf-standby billing race assertions

Allow early active-node counts up to the number of standby operations before the eventual RPC delivery assertion, to avoid race-only CI flakes without changing behavior.



* revert: undo billing test race assertion changes

Revert the prior billing test hardening commit per user request to keep billing tests unchanged in PR #12909.



* vault: restore fetchCeilingPolicies after rebase

Re-add the enterprise fetchCeilingPolicies method from main that was dropped during rebase conflict resolution, fixing build failure in request_handling.go.



* vault: materialize JWT tokens for cubbyhole requests

Ensure enterprise JWT tokens are materialized for cubbyhole paths in addition to token lookup endpoints, preserving expected persisted token-entry behavior for cubbyhole-backed request flows and token-entry JWT tests.



* vault: restore JWT token headers on perf-standby forward



* tests: fix jwt passthrough profile setup



* vault: clarify forwarding helper docs



* vault: cover jwt standby token endpoint behavior



* vault: remove enterprise JWT wording in comments



* vault: preserve materialized token request identity



* vault: stabilize external JWT readonly raft assertion



* vault: address PR 12909 review feedback



* tests: remove redundant NewTestCluster lifecycle calls



* vault: sanitize request handling token error logs



* vault: remove sensitive error fields in ent token cleanup logs



* vault: restore IsJWT wording



* vault: migrate jwt materialization tests to NewTestCluster



* tests: skip external jwt benchmark in CI



* Run make fmt



* Address PR review feedback



* Remove benchmark CI skip



* Move JWT materialization tests to external suite



---------

Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 14:44:06 +00:00
Vault Automation
1b30f42e06
VAULT-42859: surface authorization_details from inbound JWT into logical.Auth (#12750) (#12919)
Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 13:18:34 +05:30
Vault Automation
99fec82771
Backport Add an authenticated mode to rekey endpoints into ce/main (#12925) 2026-03-11 15:28:36 -04:00
Vault Automation
2ef4c50221
Add audit log entries for new token type (#12747) (#12908)
* Add audit log entries for enterprise JWT token fields



* Reduce enterprise token field comment detail

- simplify enterprise token comments in sdk/logical/request.go
- remove verbose wording about issuer/audience/authorization semantics



* Fix TestAudit_JWT_DelegationToken permission denied error

The test was failing with 'permission denied' when using a delegation token
(JWT with act claim) to access cubbyhole. The root causes were:

1. RAR (Rich Authorization Request) check: The JWT contained
   'authorization_details' constraints that only allowed access to
   'secret/data/users/alice' and 'secret/data/config/general', but the
   test was attempting to access 'cubbyhole/test'. The RAR check in
   PerformRARCheck() was correctly denying this mismatch.

2. Missing entity policies for actor ACL: For delegation tokens, the
   actor's ACL is built solely from entity identity policies (not token
   policies like 'default'). Without explicit policies on the actor
   entity, the delegation ACL intersection check would fail.

Fixes:
- Removed 'authorization_details' from the test JWT since the test is
  about verifying audit log entries for delegation tokens, not RAR
  constraints
- Added 'default' policy to both subject and actor entities to ensure
  both ACLs allow cubbyhole access for the delegation token intersection
- Updated test assertions to match the simplified JWT (removed
  authorization_details verification)



* Use require.NoError instead of t.Fatalf for error check



* Add explicit checks for auth field presence before type assertion

Adds separate checks to verify the 'auth' and 'metadata' fields exist in
the map before attempting type assertion, preventing potential panics
and improving test clarity.



* test: tighten request metadata merge assertions



* test: simplify enterprise metadata assertions



* test: split enterprise metadata merge coverage



* style: apply gofumpt to entry formatter tests



* test: add godoc for enterprise token metadata test



---------

Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 19:21:10 +01:00
Vault Automation
2ce86cb367
Set default minimum for pki certs (#12905) (#12921)
Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
2026-03-11 17:16:13 +00:00
Vault Automation
6674b4358a
Backport Add census counting for ssh into ce/main (#12918)
* no-op commit

* Add census counting for ssh (#12396)

* add cert counting for ssh

* add system view and fix errors

* add otp counting and change units for certs

* add storage tests

* fix census errors

* run make fmt

* use incrementer and change storage to match rfc

* run make fmt

* fix interface and remove parameter

* fix errors

* Update builtin/logical/ssh/path_creds_create.go

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>

* remove error check

* add ssh counts to billing endpoint

* fix error

* add test case

* add ssh metric to test

* add get functions and tests

* fix format

* create function for ssh metrics

* refactoring and add test cases

* replace test check

* add census counting for ssh

* fix read calls

* fix test

* add otp test

* move ssh functions

* address feedback

* fix hash

* fix hash

* change otp count

* fix tests

* change version and hash

---------

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
# Conflicts:
#	sdk/logical/certificate_counter.go
#	vault/census_manager_schema_ent.go
#	vault/census_manager_schema_ent_test.go
#	vault/consumption_billing_license_utilization_ent.go
#	vault/consumption_billing_util.go
#	vault/consumption_billing_util_test.go
#	vault/external_tests/billing/consumption_billing_license_utilization_census_ent_test.go
#	vault/logical_system_use_case_billing_test.go

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-03-11 09:14:28 -07:00
Vault Automation
d34cb72e68
Add counting for SSH certs and OTPs (#12368) (#12755)
* add cert counting for ssh

* add system view and fix errors

* add otp counting and change units for certs

* add storage tests

* fix census errors

* run make fmt

* use incrementer and change storage to match rfc

* run make fmt

* fix interface and remove parameter

* fix errors

* Update builtin/logical/ssh/path_creds_create.go



* remove error check

* add ssh counts to billing endpoint

* fix error

* add test case

* add ssh metric to test

* add get functions and tests

* fix format

* create function for ssh metrics

* refactoring and add test cases

* replace test check

* add ssh to billing overview test

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-03-11 10:30:48 -04:00
Vault Automation
f9c0ea544c
Enable mac and generate_random key usages for managed keys (#12769) (#12788)
* Enable mac and generate_random key usages for managed keys.

Change response of reading manage key configuration to return the string
representation of key usages rather than the numerical values.

* Add changelog entry.

* Update changelog/_12769.txt



---------

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-03-06 17:33:55 +00:00
Vault Automation
f5dbe55f55
VAULT-42657: Merge feature branch for OAuth and Agent Registry into main (#12587) (#12754)
* feat(identity): accept oauth tokens

type: draft

* feat(identity): make basic token lookup op work

type: draft

* fix(identity): failing tests

type: draft

* feat(identity): add new tests + handle renew & revoke

type: draft

* feat(identity): clean up and tests

type: draft

* feat(identity)(Accept OAuth JWT tokens): Add more tests

* feat(identity)(Accept OAuth JWT tokens): Test updates

* feat(identity)(Accept OAuth JWT tokens): Revert go version changes

* feat(identity)(Accept OAuth JWT tokens): add missing godoc for tests

* feat(identity)(Accept OAuth JWT tokens): fix tests

* feat(identity)(Accept OAuth JWT tokens): fix more CI issues

* [POC] Accept and Validate External OAuth Token for Agent Identity (#10991)

* feat(identity): accept oauth tokens

type: draft

* feat(identity): make basic token lookup op work

type: draft

* fix(identity): failing tests

type: draft

* feat(identity): add new tests + handle renew & revoke

type: draft

* feat(identity): clean up and tests

type: draft

* feat(identity)(Accept OAuth JWT tokens): Add more tests

* feat(identity)(Accept OAuth JWT tokens): Test updates

* feat(identity)(Accept OAuth JWT tokens): Revert go version changes

* feat(identity)(Accept OAuth JWT tokens): add missing godoc for tests

* feat(identity)(Accept OAuth JWT tokens): fix tests

* feat(identity)(Accept OAuth JWT tokens): fix more CI issues

* Add JWT token tidy cleanup functionality

* Refactor JWT tidy tests to use retryUntil instead of time.Sleep

* feat(identity)(Accept OAuth JWT tokens): fix leaky lease



* feat(identity)(Accept OAuth JWT tokens): fix leaky lease II and add claims to TE



* Add TestLogicalWithJwtAndSCIM e2e test

* feat(identity)(Accept OAuth JWT tokens): add more tests



* feat(identity)(Accept OAuth JWT tokens): change email



* feat(identity)(Accept OAuth JWT tokens): e2e test for scim



* Accept and validate RAR (#11005)



* fix(identity)(Accept OAuth JWT tokens): add missing headers



---------




* wip

* wip

* wip

* feat(identity): auth with delegation jwts



* feat(identity): optimize jwks fetching



* wip

* add lookup by entity-id

* feat(identity): optimize jwks fetching



* feat(identity): optimize jwks fetching and refactoring



* feat(identity): fix breaking tests



* feat(identity): accept oauth tokens

type: draft

* feat(identity): make basic token lookup op work

type: draft

* fix(identity): failing tests

type: draft

* feat(identity): add new tests + handle renew & revoke

type: draft

* feat(identity): clean up and tests

type: draft

* feat(identity)(Accept OAuth JWT tokens): Add more tests

* feat(identity)(Accept OAuth JWT tokens): Test updates

* feat(identity)(Accept OAuth JWT tokens): Revert go version changes

* feat(identity)(Accept OAuth JWT tokens): add missing godoc for tests

* feat(identity)(Accept OAuth JWT tokens): fix tests

* feat(identity)(Accept OAuth JWT tokens): fix more CI issues

* [POC] Accept and Validate External OAuth Token for Agent Identity (#10991)

* feat(identity): accept oauth tokens

type: draft

* feat(identity): make basic token lookup op work

type: draft

* fix(identity): failing tests

type: draft

* feat(identity): add new tests + handle renew & revoke

type: draft

* feat(identity): clean up and tests

type: draft

* feat(identity)(Accept OAuth JWT tokens): Add more tests

* feat(identity)(Accept OAuth JWT tokens): Test updates

* feat(identity)(Accept OAuth JWT tokens): Revert go version changes

* feat(identity)(Accept OAuth JWT tokens): add missing godoc for tests

* feat(identity)(Accept OAuth JWT tokens): fix tests

* feat(identity)(Accept OAuth JWT tokens): fix more CI issues

* Add JWT token tidy cleanup functionality

* Refactor JWT tidy tests to use retryUntil instead of time.Sleep

* feat(identity)(Accept OAuth JWT tokens): fix leaky lease



* feat(identity)(Accept OAuth JWT tokens): fix leaky lease II and add claims to TE



* Add TestLogicalWithJwtAndSCIM e2e test

* feat(identity)(Accept OAuth JWT tokens): add more tests



* feat(identity)(Accept OAuth JWT tokens): change email



* feat(identity)(Accept OAuth JWT tokens): e2e test for scim



* Accept and validate RAR (#11005)



* fix(identity)(Accept OAuth JWT tokens): add missing headers



---------




* feat(identity): auth with delegation jwts



* feat(identity): optimize jwks fetching



* wip

* wip

* wip

* wip

* add lookup by entity-id

* feat(identity): optimize jwks fetching



* feat(identity): optimize jwks fetching and refactoring



* feat(identity): fix breaking tests



* VAULT-42642 Fix feature branch tests, some CE -> Ent moving (#12417)

* VAULT-42642 Fix feathre branch tests, some CE -> Ent moving

* VAULT-42642 fix last test?

* skip test

* proto

* more test fixes

* buf format

* Fix createVaultEntityForUser signature (#12439)

* VAULT-42533 Agent Registry: enforce entity invariants, miscellaneous improvements (#12399)

* VAULT-42533 enforce entity invariants, miscellaneous improvements

* typos

* Improve path handling for rar + add tests (#11934)

* Moving stuff around for CE

* fmt

* backend

* more CE changes

* more fixes

* further fixes

* rework clone

* VAULT-42621 Move JWT tests (and some standalone functionality) to enterprise files (#12460)

* VAULT-42621 Move JWT tests (and some standalone functionality) to enterprise files

* logical

* skip failing tests

* more skips

* missed tests

* one more

* VAULT-42619 Refactor token_ent and surrounding files to move logic into enterprise (#12473)

* VAULT-42619 Refactor token_ent and surrounding files to move logic into enterprise

* test fixes

* feedback

* VAULT-42631 Rename ISJWT to IsEnterpriseToken, some refactoring (#12509)

* VAULT-42631 Rename ISJWT to IsEnterpriseToken, some refactoring

* godocs

* VAULT-42779 refactor JWT parts of acl.go to enterprise files (#12512)

* VAULT-42630 move token tidy for JWT to ent files (#12534)

* VAULT-42818 rename jwtjti in request struct (#12539)

* VAULT-42633 CE-ify request handling and flow around validateJwtAndFetchEntity (#12541)

* VAULT-42633 CE-ify request handling

* Copyright headers

* VAULT-42633 Move IsJWT back to CE code, add explanations (#12576)

* VAULT-42633 CE-ify request handling

* Copyright headers

* VAULT-42633 Move IsJWT back to CE code, add explanations

* VAULT-42870 Move jwtAuthManager to enterprise (#12586)

* VAULT-42796 Move config to enterprise files (#12604)

* VAULT-42796 Move config to enterprise files

* more build failures

* fix test util

* two more compilatin things

* VAULT42796 - fix missing return (#12617)

* VAULT-42796 Move config to enterprise files

* more build failures

* fix test util

* two more compilatin things

* VAUlt-42796 fix test

* Fix linting for rar_ent (#12618)

* VAULT-42796 Move config to enterprise files

* more build failures

* fix test util

* two more compilatin things

* VAUlt-42796 fix test

* Fix linter for rar code

* fix authresults

* typo

* return error

* fix method signature

---------

Signed-off-by: Arnab Chatterjee <arnab.chatterjee@hashicorp.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: Arnab Chatterjee <arnab.chatterjee@hashicorp.com>
Co-authored-by: Arnab Chatterjee <arnabkaycee@gmail.com>
Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
Co-authored-by: Bianca Moreira <bianca.moreira@hashicorp.com>
2026-03-05 10:25:59 -05:00
Vault Automation
65597dd37c
Backport Renaming to generalize pki certificate counts into ce/main (#12327)
* no-op commit

* Renaming to generalize pki certificate counts (#12304)

* renaming to generalize pki certificate counts

# Conflicts:
#	vault/replication_rpc_ent.go
#	vault/testing_util.go

* Update vault/testing_util.go

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>

* Remove "PKI" from a few more names related to certificate count code.

---------

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
# Conflicts:
#	builtin/logical/pki/backend_cmpv2_ent_test.go
#	vault/activity_log_product_usage_util_ent.go
#	vault/activity_log_util_ent.go
#	vault/cert_count/cert_count_manager.go
#	vault/cert_count/cert_count_manager_test.go
#	vault/external_tests/activity_testonly/activity_testonly_ent_test.go
#	vault/logical_system_helpers_ent.go
#	vault/logical_system_pki_certificate_count_ent.go
#	vault/logical_system_pki_certificate_count_ent_test.go
#	vault/replication_paths_ent.go
#	vault/replication_rpc_ent.go
#	vault/testing_util.go

* add ce changes

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
Co-authored-by: rculpepper <rculpepper@hashicorp.com>
2026-02-13 11:00:48 -05:00
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
Vault Automation
9839d40b10
Backport rotationMgr: enable RM to send rotation information to plugins on registration/rotation operations into ce/main (#12308)
* rotation-manager: enable RM to send rotation information to plugins on registration/rotation operations (#11810)

* initial commit for sending NVR to plugins

* add changelog

* add NVR to plugin fields, add RotationInfo to GRPC request handler

* fix tests

* ensure consistent formats on times and ttls

* add translation to allow grpc data transfer

* fix tests and rename fields

* fix missed field renames in tests

* make all methods net-new for backwards compatibility

* update mock plugin and add oss stub back

* remove method with no usages

* Address wrapper comments

* Rebuild proto

* Nil check around SetRotationInfo, return n/a for no last_vault_rotation

* Fix error to match other instances

* Update fields.go

* Return nil if unset for next/last vault rotation times

---------

Co-authored-by: robmonte <17119716+robmonte@users.noreply.github.com>

* Fix return type in stub method

---------

Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
Co-authored-by: robmonte <17119716+robmonte@users.noreply.github.com>
2026-02-12 18:25:47 -06:00
Vault Automation
7b433e64ba
Refactor CertificateCounter.IncrementeCount to use a param object. (#12172) (#12271)
* Refactor CertificateCounter.IncrementeCount to use a param object.

In preparation to start collecting more information, refactor the
CertificateCounter to take a parameter object which can be later gain more
fields.

* Rework CertificateCounter to use a fluent interface.

Rename method IncrementCount to AddCount.

Remove method AddIssuedCertificate.

Add method Incrementer, which returns an implementation of the new
CertCountIncrementer.

* Add method CertCountIncrement.Add.

* Refactor PkiCertificateCountConsumer to take a CertCountIncrement.

* Fix TestPkiCertificateCountManager_IncrementAndConsume.

* Rename type CertCountIncrement to CertCount.

* Refactor ReadStoredCounts to return a CertCount value.

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-02-10 11:55:10 -05:00
Vault Automation
c6170d36a8
Add the ability for a plugin to specify extra fields for auditing purposes (#11018) (#12167)
* Add the ability to specify extra audit only fields from a plugin

* Add extra auditing fields within the PKI OCSP handler

* Add missing copywrite headers

* Format OCSP dates when non-zero, otherwise specify not set to be clear

* Feedback 2: Only set time fields if not zero instead of non-parsable string

* Serialize JSON fields in SDK response struct

* Perform renames based on RFC feedback

* Resolve OpenAPI test failure

* add cl

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-02-04 15:41:54 +00:00
Vault Automation
caf642b7d2
Backport Vault 42177 Add Backend Field into ce/main (#12152)
* Vault 42177 Add Backend Field (#12092)

* add a new struct for the total number of successful requests for transit and transform

* implement tracking for encrypt path

* implement tracking in encrypt path

* add tracking in rewrap

* add tracking to datakey path

* add tracking to  hmac path

* add tracking to sign  path

* add tracking to verify path

* unit tests for verify path

* add tracking to cmac path

* reset the global counter in each unit test

* add tracking to hmac verify

* add methods to retrieve and flush transit count

* modify the methods that store and update data protection call counts

* update the methods

* add a helper method to combine replicated and local data call counts

* add tracking to the endpoint

* fix some formatting errors

* add unit tests to path encrypt for tracking

* add unit tests to decrypt path

* fix linter error

* add unit tests to test update and store methods for data protection calls

* stub fix: do not create separate files

* fix the tracking by coordinating replicated and local data, add unit tests

* update all reference to the new data struct

* revert to previous design with just one global counter for all calls for each cluster

* complete external test

* no need to check if current count is greater than 0, remove it

* feedback: remove unnacassary comments about atomic addition, standardize comments

* leave jira id on todo comment, remove unused method

* rename mathods by removing HWM and max in names, update jira id in todo comment, update response field key name

* feedback: remove explicit counter in cmac tests, instead put in the expected number

* feedback: remove explicit tracking in the rest of the tests

* feedback: separate transit testing into its own external test

* Update vault/consumption_billing_util_test.go

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* update comment after test name change

* fix comments

* fix comments in test

* another comment fix

* feedback: remove incorrect comment

* fix a CE test

* fix the update method: instead of storing max, increment by the current count value

* update the unit test, remove local prefix as argument to the methods since we store only to non-replicated paths

* update the external test

* Adds a field to backend to track billing data

removed file

* Changed implementation to use a map instead

* Some more comments

* Add more implementation

* Edited grpc server backend

* Refactored a bit

* Fix one more test

* Modified map:

* Revert "Modified map:"

This reverts commit 1730fe1f358b210e6abae43fbdca09e585aaaaa8.

* Removed some other things

* Edited consumption billing files a bit

* Testing function

* Fix transit stuff and make sure tests pass

* Changes

* More changes

* More changes

* Edited external test

* Edited some more tests

* Edited and fixed tests

* One more fix

* Fix some more tests

* Moved some testing structures around and added error checking

* Fixed some nits

* Update builtin/logical/transit/path_sign_verify.go

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* Edited some errors

* Fixed error logs

* Edited one more thing

* Decorate the error

* Update vault/consumption_billing.go

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

---------

Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* Edited stub function

---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
Co-authored-by: divyaac <divyaac@berkeley.edu>
2026-02-03 22:48:12 +00:00
Vault Automation
744024c83e
VAULT-41729 Refactor PKI Cert Counting Code (#11657) (#11881)
* Basic refactoring to reuse PKI certs for SSH

* Refactored so that files are moved to CE

* Modified comment

* Renamed CertCountSystemView

* Moved forwarding function and redefined consume function

* Renamed cert view file

* Moved forwarding function and redefined consume function

Small edit

Renamed cert view file

* Fix issues with commit

* Fix consume job

* Removed error

* Update vault/logical_system_helpers.go



---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2026-01-26 08:28:41 -05:00
Vault Automation
6c52175b8d
events: send events from primary to secondary clusters (#8214) (#11451)
Collect event subscriber filters on the active node of a cluster as
"cluster wide" filters, and send them from the secondary active to the
primary active node (`SendSecondaryFilters rpc`). The primary active
node forwards events downstream to the secondary active node if the
events match the secondary cluster's subscriber filters
(`RecvPrimaryEvents rpc`). Then the events are further distributed
around the secondary cluster via the existing `RecvActiveNodeEvents`
and `SendStandbyFilters` rpc's.

Events are forwarded downstream to the secondary cluster if the mount
exists on the secondary cluster, i.e. events from mounts with
`local=true` aren't forwarded, and events from mounts that are not
replicated via paths-filter aren't forwarded.

(This is the CE portion of the above^^)

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2025-12-18 10:56:55 -08:00
Vault Automation
0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00
Vault Automation
a24046a0b4
Increment certificate counts in all PKI backends (#9693) (#9721)
Increment certificate counts in all PKI backends.

Ensure that the PkiCertificateCounter is invoked every time we store and
issue a certificate by any of the PKI backends.

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-09-29 15:33:00 -04:00
Vault Automation
44ced707f9
Add PkiCertificateCountSystemView to the PKI backend's SystemView (#9573) (#9617)
Add PkiCertificateCountSystemView to the PKI backend's SystemView.

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2025-09-24 18:23:22 +00:00
Vault Automation
64fd8225bc
Move PluginLicenseUtil to CE so it can be used via vault/sdk module (#9371) (#9381) 2025-09-16 20:22:17 +00:00
Vault Automation
ae0e5e160f
[VAULT-38601] Modify response to MFA enforced requests to enable TOTP self-enrollment (#8723) (#8746)
Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2025-08-20 20:22:00 +00:00
miagilepner
bcd584af20
VAULT-37630: CE changes for recover as a copy policy handling (#31472)
* CE changes for recover as a copy policy

* make proto
2025-08-12 10:29:22 +02:00
kpcraig
8f522a2bca
add ce side code and stubs for rotation manager
* add ce side code and stubs

* add changelog

* style refactor

* try to use APIPath as mount point instead of request field

* fix linter

* return a response struct instead of a pure timestamp

* add issue time to response

* add ttl to GetRotationInformation response

* rename field for clarity

* update ttl to just seconds

* rename next and last rotation time field; describe what they are

* rename function

* catch up to ent PR

* fix patch merge mistake
2025-07-15 12:48:00 -04:00
Ellie
23e04c2409
Add MetricsReporter interface so that databaseBackend's can share their connection counts with CensusManager (#31269)
* add interface and impl

* add tests

* fix comments

* Update builtin/logical/database/backend.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-14 14:52:55 -05:00
Violet Hynes
7684ac9eab
VAULT-36562 CE changes (#31054)
* VAULT-36563 CE side

* CE changes

* Go mod changes

* I'm dumb
2025-06-20 15:16:40 -04:00
helenfufu
146c032600
CE changes for plugin download (#30927)
* ce changes for https://github.com/hashicorp/vault-enterprise/pull/8193

* lower case enterprise only errors

---------

Co-authored-by: Ben Ash <bash@hashicorp.com>
2025-06-10 10:31:24 -04:00
miagilepner
6212f0986e
VAULT-35080: Snapshot storage routing (#30635)
* add storage router and test case

* add tests

* fix typo
2025-05-15 17:13:02 +02:00
Violet Hynes
26c337e9ee
VAULT-35396 CE changes for SDK observation update (#30626)
* VAULT-35396 CE changes for SDK observation update

* Make proto
2025-05-15 09:46:03 -04:00
miagilepner
1c37b94d65
VAULT-35079: Scaffolding for recover operations on backends (#30556)
* allow snapshot read, recover operation, snapshot ID in request

* lint and add comment
2025-05-09 11:48:20 +01:00
Violet Hynes
664dfbe838
VAULT-35384 Add new telemetry metrics for HTTP response status codes (#30354)
* VAULT-35384 Add new telemetry metrics for HTTP status codes

* VAULT-35384 Add new telemetry metrics for HTTP status codes

* Changelog

* Changelog

* Typo

* Missed metrics

* VAULT-35384 sys/health
2025-05-06 10:15:19 -04:00
davidadeleon
6741773b0f
update vault auth submodules to api/v1.16.0 (#29548)
* update vault auth submodules to api/v1.16.0

* update go.mod

* make proto

---------

Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
2025-02-11 07:28:45 -08:00
Thy Ton
5dc9dea8ed
add EntStaticSystemView to StaticSystemView and its ce stubs (#29516) 2025-02-06 08:32:14 -08:00
vinay-gopalan
838a38443f
Update Rotation Manager OSS Stubs and SDK methods (#29401) 2025-01-28 14:24:44 -06:00
Mike Palmiotto
9d80c4548f
proto: bump protoc-gen-go to 1.36.3 (#29359) 2025-01-22 13:58:43 -05:00
Ryan Cragun
357b2949e3
protobuf: rebuild protos with protobuf 1.36.2 (#29318)
* protobuf: rebuild protos with protobuf 1.36.2
* format: please buf formatter

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-01-08 21:35:04 +00:00
vinay-gopalan
27bd3e9535
Add SDK helpers and Core stubs for plugins to communicate with Enterprise Rotation Manager (#29273)
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2025-01-07 22:22:45 +00:00
Ryan Cragun
f730d31bc6
protobuf: rebuild protos with protobuf 1.36 (#29229)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-01-03 14:19:00 -07:00
Michael Blaum
ca203c21d0
use const for in relation to vault eventing metadata (#29130)
* use const for  in relation to vault eventing metadata

* update comments

* fix comment lengths
2024-12-11 17:34:38 -05:00
helenfufu
c27a54a99c
add vault build date to system view plugin env VAULT-32676 (#29082)
---------

Co-authored-by: Thy Ton <maithytonn@gmail.com>
2024-12-10 14:30:21 -08:00
Steven Clark
9bf3d115fc
Add an option to allow cert-auth to return metadata about client cert that fails login (#29044)
* Add an option to allow cert-auth to return metadata about client certs that fail login

* Add cl

* Update SPDX header for sdk/logical/response_test.go
2024-11-29 10:22:09 -05:00
divyaac
52ba156d47
Fix protoc issue (#28928) 2024-11-15 19:33:48 +00:00
Ryan Cragun
b6145bc3bb
protobuf: rebuild protos with protobuf 1.35.1 (main) (#28617)
* protobuf: rebuild protos with protobuf 1.35.1
* protobuf: unpin protoc-gen-go-grpc on main

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-10-07 14:54:51 -06:00
Violet Hynes
fd884ad1a0
Removal of go-testing-interface (CE changes) (#27578)
* Removal of go-testing-interface CE changes

* CE only fine

* Changelog

* Changelog
2024-07-04 11:09:41 -04:00
Steven Clark
d152de025d
Pin generated proto files to 1.34.2 (#27438) 2024-06-11 12:29:45 -04:00
Ryan Cragun
1c4aa5369e
proto: rebuild with the latest protoc-gen-go (#27331)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-06-03 12:02:02 -06:00
Mike Palmiotto
080780b497
Add a TraceID for forwarded request tracing (#26939) 2024-05-10 17:04:01 +00:00
Mike Palmiotto
9c61738c63
Wrap overloaded errors from the WAL backend (#26928)
This PR adds the CE plumbing to expose underyling ErrOverloaded errors.
The wrapper allows the HTTP layer to correctly assign 503 status codes
in responses.
2024-05-10 09:43:39 -04:00
Mike Palmiotto
2d75711019
make proto 1.34.1 (#26856) 2024-05-07 14:33:18 +00:00