781 Commits

Author SHA1 Message Date
miagilepner
2c1d8b6fb4
VAULT-36198: Add API/CLI support for reading, listing, recovering from a snapshot (#30701) 2025-05-21 15:10:20 +02:00
Andrew Hewus Fresh
a6c35b6d5e
Directly exec ExternalTokenHelper rather than using a SHELL (#29653)
* [OT] use `new` builtin for visual clarity

`new(ExternalTokenHelper)` is a lot easier to parse than
`(*ExternalTokenHelper)(nil)`

* add `Args` field to `ExternalTokenHelper`

This will be used to store any extra command arguments and allows
`BinaryPath` to hold *just* the binary path.

* remove shell invocation

Since `BinPath` no longer has to hold any additional arguments we can
execute the command directly without inoking the shell first.

* update `testExternalTokenHelper` to make use of the new `Args` field

* updated `ExternalTokenHelper` documentation

* Add changelog entry for token_helper without shell

Currently using 0.txt until we have a PR id.

* Rename 0.txt to 29653.txt

We got a PR ID, so fix the changelog file

---------

Co-authored-by: Roosevelt Burden <rburden@grantstreet.com>
Co-authored-by: Roosevelt Burden <roosevelt.burden@grantstreet.com>
2025-04-04 14:34:26 -04:00
Violet Hynes
bbaaa3f76e
VAULT-34541 CE changes (#29920) 2025-03-18 16:01:59 -04:00
Steven Clark
e31d45514d
Rework certificate authentication client api (#29931)
* Rework certificate authentication api

 - Use the passed in Vault api client to perform the connection
    - This provides namespace support, retry behaviors and uses
      the existing secret parsing logic instead of re-implementing it
 - Change the cert auth role to be an optional argument
 - Allow users to use a different cert auth mount point

* Clean up test name

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

---------

Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
2025-03-14 15:48:52 -04:00
Steven Clark
1802204dec
Update golang.org/x/net to v0.37.0 for GO-2025-3503 (#29925) 2025-03-14 11:53:38 -04:00
Wito Chandra
a782fa859c
feat(api-client): add cert auth method (#29546)
* feat(api-client): add cert auth method

* chore: apply feedbacks

* doc: add copyright & update changelog

---------

Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
2025-03-11 14:03:57 -04:00
Violet Hynes
9fd4ba9d14
VAULT-34126 CE part (#29849) 2025-03-06 11:09:03 -05:00
Steven Clark
152e5b53e1
Update go-jose to v3.0.4/v4.0.5 (#29771)
* Update go-jose to v3.0.4

 - Updating to address CVE-2025-27144

* Update v4 references in sdk and api

* Update go-jose across all api auth projects to v4.0.5
2025-02-28 11:15:59 -05: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
Steven Clark
9456671f04
Prepare code base for Go 1.24 update. (#29412)
* Fix "t.Fatal from a non-test goroutine" errors in cache_test.go

 - t.Fatal(f) should not be called within a Go routine based on it's documentation and only from the main test's thread.
 - In 1.24 this seems to cause build failures

* Address all "non-constant format string errors" from go vet

 - Within 1.24 these now cause test builds to fail

…" from go vet
2025-01-27 14:34:07 -05:00
Violet Hynes
32d61c3893
Update go/x/net and go/x/crypto to latest versions throughout (#29422) 2025-01-27 10:47:40 -05:00
miagilepner
73bf3ebc7c
VAULT-31755: Add removed and HA health to the sys/health endpoint (#28991)
* logic

* actually got test working

* heartbeat health test

* fix healthy definition and add changelog

* fix test condition

* actually fix test condition

* Update vault/testing.go

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>

* close body

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2024-12-04 11:09:10 +01:00
miagilepner
4b98fd9b1a
VAULT-31751, VAULT-31752: removed_from_cluster in vault status (#28938)
* add removed from cluster to status output

* test for command

* update docs

* changelog
2024-11-19 11:13:10 +01:00
Scott Miller
415d260995
Support trimming trailing slashes via a mount tuneable to support CMPv2 (#28752)
* Support trimming trailing slashes via a mount tuneable to support CMPv2

* changelog/

* Perform trimming in handleLoginRequest too

* Eagerly fetch the mount entry so we only test this once

* Add a mount match function that gets path and entry

* Update vault/request_handling.go

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>

* more docs

* Some patches (from ENT) didnt apply

* patch fail

* Update vault/router.go

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>

* PR feedback

* dupe

* another dupe

* Add support for enabling trim_request_trailing_slashes on mount creation

* Fix read mount api returning configuration for trim_request_trailing_slashes

* Fix test assertion

* Switch enable and tune arguments to BoolPtrVal to allow end-users to specify false flag

* Add trim-request-trailing-slashes to the auth enable API and CLI

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2024-10-24 10:47:17 -05:00
Josh Black
d1355cb98f
explain how -output-curl-string works in comments to avoid confusion (#28576) 2024-10-04 11:14:21 -07:00
Tero Saarni
6f13aec0d3
core/api: Add missing LICENSE files to sub-modules (#27920)
Go module tooling mandates that each sub-module contains its own LICENSE file.
If absent, it defaults to the LICENSE file in the root of the git repository.
This resulted in the api/auth/* modules erroneously inheriting the BUSL
license instead of the correct MPL license, as indicated by the SPDX info in
the actual API code.

This update ensures that module documentation is displayed correctly on
pkg.go.dev and resolves issues with various tools showing incorrect license
information for the sub-modules.

Signed-off-by: Tero Saarni <tero.saarni@est.tech>
2024-09-23 13:06:35 -04:00
Victor Rodriguez
ab8bc34c53
update vault auth submodules to api/v1.15.0 (#28338) 2024-09-10 18:03:47 +00:00
idnandre
e26c246cbb
chore: fix deprecated ioutil readall (#27823)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-30 09:18:24 -04:00
Chris Capurso
a28464b860
Add non-root access with filtering support to activity export API (#27846)
* VAULT-28577: change CSV MIME type to text/csv

* VAULT-28578: require sudo for export API

* add validation and associated error handling

* change export API default to 204 if no data returned

* VAULT-28579: allow export API in non-root namespace, add filtering support

* update test fixtures to reflect filtering changes

* TestActivityLog_Export moved to ENT-only test

* add test to verify sudo access

* add changelog entry
2024-07-24 09:21:52 -04:00
idnandre
b833d4714d
chore: fix deprecated ioutil nopcloser (#27650)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-03 13:38:34 -04:00
Violet Hynes
037d82130c
VAULT-28422 Upgrade go-retryablehttp for CE (#27602) 2024-06-26 09:05:02 -04:00
Jacob Henner
46a41a549b
Specify headers by environment variable (#21993)
* Specify headers by environment var

* Add changelog entry

* Add tests, docs

* Formatting

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-06-19 16:51:24 -04:00
Peter Wilson
26eae55a7d
updated dependencies for auth/gcp (#27415) 2024-06-10 16:08:15 +00:00
Violet Hynes
b41dcee3fa
VAULT-24050 Fix erroneous warning showing when -address is provided (#27265)
* VAULT-24050 Fix erroneous warning showing when -address is provided

* VAULT-24050 changelog
2024-05-30 09:48:06 -04:00
Antonio
fab2899508
Bump backoff/v3 to backoff/v4 (#26868)
This makes it so projects that are already using backoff don't need to
pull up an old version of it just because of vault/api. This major
version change is compatible with existing usage in code.

Refs #24707.

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-05-29 12:04:46 -04:00
Tianhao Guo
2a1775f45f
fix an edge case bug that "identity_policies" is nil (#17007)
* check if "identity_policies" is nil to fix cli vault login error

* add changelog

* skip add identity_policies to resp when there's no identity_policies associated in token's namespace

This is an edge case, when an entity has identity_policies associated in other namespaces but no identity_policies in this token's namespace, `identityPolicies[out.NamespaceID]` is nil, client side doesn't handle nil which raises error.

* update changelog

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-05-28 15:34:59 -04:00
Peter Wilson
545064cb6d
update vault auth submodules to api/v1.14.0 (#27190)
* update vault auth submodules to api/v1.14.0

* go mod tidy in repo root
2024-05-23 11:00:55 -04:00
hc-github-team-secure-vault-core
c4eb7f74e7
Update vault-plugin-database-elasticsearch to v0.15.0 (#27136)
* Update vault-plugin-database-elasticsearch to v0.15.0

* Add changelog

* fix failing tests + update dep in api dir

---------

Co-authored-by: hc-github-team-secure-vault-ecosystem <hc-github-team-secure-vault-ecosystem@users.noreply.github.com>
Co-authored-by: Milena Zlaticanin <60530402+Zlaticanin@users.noreply.github.com>
Co-authored-by: Zlaticanin <zlaticaninmilena@gmail.com>
2024-05-22 10:47:08 -07:00
Peter Wilson
af71350e55
updated golang.org/x/net dependency for api + go mod tidy (#27031) 2024-05-15 14:52:26 +01:00
Violet Hynes
b16b94a72a
VAULT-25341 Address issue where having no permissions to renew caused auto-auth to attempt to renew with no backoff (#26844)
* VAULT-25341 Address issue where having no permissions to renew caused Agent and Proxy auth to attempt to renew with no backoff

* Fiddle with go.mod changes that shouldn't have happened

* VAULT-25341 small cleanup and extra test

* VAULT-25341 backoff only in error case

* VAULT-25341 godocs

* VAULT-25342 changelog

* Update command/agent_test.go

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

* VAULT-25341 rename file audit

---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
2024-05-09 11:12:42 -04:00
Tom Proctor
86d529e115
Upgrade api package go-jose to v4 (#26527)
* Upgrade api package go-jose to v4
* go-jose/v4 requires go 1.21
2024-04-19 12:17:41 +01:00
Christopher Swenson
961bf20bdb
Use enumer to generate String() methods for most enums (#25705)
We have many hand-written String() methods (and similar) for enums.
These require more maintenance and are more error-prone than using
automatically generated methods. In addition, the auto-generated
versions can be more efficient.

Here, we switch to using https://github.com/loggerhead/enumer, itself
a fork of https://github.com/diegostamigni/enumer, no longer maintained,
and a fork of the mostly standard tool
https://pkg.go.dev/golang.org/x/tools/cmd/stringer.
We use this fork of enumer for Go 1.20+ compatibility and because
we require the `-transform` flag to be able to generate
constants that match our current code base.

Some enums were not targeted for this change:
2024-04-17 11:14:14 -07:00
Josh Black
a8a621f539
CE changes for https://github.com/hashicorp/vault-enterprise/pull/5695 (#26449) 2024-04-16 18:26:26 +00:00
Nick Cabatoff
2560beea8e
CE part of https://github.com/hashicorp/vault-enterprise/pull/4269 (#26406) 2024-04-15 20:08:57 +00:00
Andrew Stucki
57cb563be5
Fix exponential backoff for api.LifetimeWatcher (#26383)
* Fix exponential backoff for api.LifetimeWatcher

* Add changelog entry
2024-04-12 12:59:58 -04:00
John-Michael Faircloth
594d304f25
api: do not require sudo for GetAuth wrapper (#25968)
* api: do not require sudo for GetAuth wrapper

* changelog
2024-03-15 14:40:22 -07:00
dependabot[bot]
031e56d3a4
Bump github.com/go-jose/go-jose/v3 from 3.0.1 to 3.0.3 in /api (#25841)
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.1 to 3.0.3.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/v3.0.3/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v3.0.1...v3.0.3)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2024-03-15 17:52:57 +00:00
Tom Proctor
9ed00822ea
Move CLI token helper to api module (#25744)
* Move command/config + command/token to api/cliconfig + api/tokenhelper
* Remove unused functions and unused import
* Simplify and inline function copied from SDK
* Delete unused duplicated/forwarding config implementation from command package
* Delete unused code, unexport API surface that's only used internally to the package
* Fix up license headers
* Add changelog
* Tweak .gitignore to track hcl files in testdata/ folders
2024-03-04 18:29:20 +00:00
John-Michael Faircloth
54c28fdf4b
api: add wrapper functions for GET auth and mount (#25499)
* api: add GET for auth and mount

* add changelog

* add unit test

* add auth unit test

* add external api tests

* add godoc to tests
2024-02-20 10:31:08 -06:00
Josh Black
fa13dbd381
add gosimport to make fmt and run it (#25383)
* add gosimport to make fmt and run it

* move installation to tools.sh

* correct weird spacing issue

* Update Makefile

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

* fix a weird issue

---------

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2024-02-13 14:07:02 -08:00
Violet Hynes
1529422559
Update Vault auth submodule API versions for 1.16 (#25290) 2024-02-08 10:46:33 -05:00
Violet Hynes
3ba802d8dc
Move wg.Add outside of goroutine (#25104)
* Move wg.Add outside of goroutine

* Fix other test
2024-01-26 19:01:54 +00:00
miagilepner
49a59bda5e
Fix api/ and sdk/ package tests (#25067)
* fix

* left in incorrectly

* don't print generate commands

* handle line breaks

* remove -e
2024-01-25 14:45:44 +01:00
Marc Boudreau
24e5c2c2f3
VAULT-22504: Support Custom Messages in api Package (#24959)
* add methods in Sys struct to manipulate UI Custom Messages

* adding go-docs

* extracting recurring URL path into a constant

* using same stretchr/testify version as the main go.mod
2024-01-23 13:20:58 -05:00
Austin Gebauer
a93ee17946
cli: adds plugin identity token to enable and tune commands for secret engines and auth methods (#24980)
* adds plugin identity token to secrets CLI for enable and tune

* adds plugin identity token to auth CLI for enable and tune

* adds field to mount config input and output

* adds changelog

* fix tests

* fix another test
2024-01-22 16:00:03 -08:00
Austin Gebauer
76a62d5997
sys: adds identity_token_key to mounts/auth for enable/tune (#24962)
* sys: adds identity_token_key to mounts/auth for enable/tune

* adds changelog

* adds godoc on new tests

* adds function for identityStoreKeyExists

* use read lock, remove helper func

* tune test in logical_system_test, remove router access method

* fix key existence check in namespaces
2024-01-22 15:28:11 -08:00
Violet Hynes
074a35eac6
Update aws-sdk-go to latest (#24916) 2024-01-17 15:17:00 -05:00
Tom Proctor
80f85a05f6
New root namespace plugin reload API sys/plugins/reload/:type/:name (#24878) 2024-01-17 15:46:27 +00:00
Steven Clark
6f5a7a9e8c
Add WriteRaw to client api and new PKI test helper (#24818)
- This is to support the EST test cases within Vault Enterprise
2024-01-11 13:51:42 -05:00
Stephen Wodecki
d3c790a495
ParseAddress test fix (#17382)
* check prefix of previous address

* add tests for dial context switching

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-10 15:35:23 +00:00