Commit Graph

399 Commits

Author SHA1 Message Date
Jeff Mitchell
382f28ee24 Send initialized information via sys/seal-status (#5424) 2018-09-27 14:03:37 -07:00
Martin
56083f4dd9 use constant where x-vault-token was still hardcoded (#5392) 2018-09-25 09:34:40 -07:00
Jeff Mitchell
9ee8bd3438
Possibly fix Nomad capabilities issue (#5360) 2018-09-19 13:06:37 -04:00
Brian Kassouf
d3017e259f
Add performance standby status to status output (#5192)
* Add performance standby status to status output

* Update ha.go
2018-08-27 10:01:07 -07:00
Jeff Mitchell
935815d3da Sync over some stuff 2018-08-24 12:09:03 -04:00
Jeff Mitchell
dc9d3f3012 Sync some ns stuff to api/command 2018-08-22 14:37:40 -04:00
Jeff Mitchell
9cf497f688 Remove injection into top routes (#5101) 2018-08-14 15:29:22 -04:00
Jeff Mitchell
f562a71808
Add support for passing args via vault read (#5093)
We support this in the API as of 0.10.2 so read should support it too.

Trivially tested with some log info:

`core: data: data="map[string]interface {}{"zip":[]string{"zap", "zap2"}}"`
2018-08-13 22:00:26 -04:00
Jeff Mitchell
ef6744f9af Port some ns stuff over 2018-08-10 12:13:11 -04:00
Jeff Mitchell
166a2ac372 Add headers accessor and ns function 2018-08-09 18:29:03 -04:00
Jeff Mitchell
0efaa97cfd Add json tag to names response for sys_plugins 2018-08-09 18:02:03 -04:00
Calvin Leung Huang
ece7569aca Clean up container on connection failure, switch to ory/dockertest on package postgresql (#5050) 2018-08-07 09:56:33 -07:00
Jeff Mitchell
463455aa03 Fix stepdown body closing 2018-08-04 11:50:29 -04:00
Brian Kassouf
4ca3b84f52
API: Add context to each raw request call (#4987) 2018-07-24 15:49:55 -07:00
Seth Vargo
c50881b274 Add plugin CLI for interacting with the plugin catalog (#4911)
* Add 'plugin list' command

* Add 'plugin register' command

* Add 'plugin deregister' command

* Use a shared plugin helper

* Add 'plugin read' command

* Rename to plugin info

* Add base plugin for help text

* Fix arg ordering

* Add docs

* Rearrange to alphabetize

* Fix arg ordering in example

* Don't use "sudo" in command description
2018-07-13 10:35:08 -07:00
Calvin Leung Huang
4c55d2843a
Add description flag to secrets and auth tune subcommands (#4894)
* Add description flag to secrets and auth tune subcommands

* Allow empty description to be provided in secret and auth mount tune

* Use flagNameDescription
2018-07-12 11:15:50 -04:00
Jeff Mitchell
5269abb64c Fix tests 2018-07-12 10:18:50 -04:00
Jeff Mitchell
dba48d5265
Re-add dockertest and fix up imports and update script (#4909) 2018-07-11 17:49:13 -04:00
Jeff Mitchell
a831fb4c5a Make single-lease revocation behave like expiration (#4883)
This change makes it so that if a lease is revoked through user action,
we set the expiration time to now and update pending, just as we do with
tokens. This allows the normal retry logic to apply in these cases as
well, instead of just erroring out immediately. The idea being that once
you tell Vault to revoke something it should keep doing its darndest to
actually make that happen.
2018-07-11 15:45:35 -04:00
Jeff Mitchell
765fe529d6
Changes the way policies are reported in audit logs (#4747)
* This changes the way policies are reported in audit logs.

Previously, only policies tied to tokens would be reported. This could
make it difficult to perform after-the-fact analysis based on both the
initial response entry and further requests. Now, the full set of
applicable policies from both the token and any derived policies from
Identity are reported.

To keep things consistent, token authentications now also return the
full set of policies in api.Secret.Auth responses, so this both makes it
easier for users to understand their actual full set, and it matches
what the audit logs now report.
2018-06-14 09:49:33 -04:00
Calvin Leung Huang
c212a86606
Move checkHCLKeys into hclutil (#4749) 2018-06-12 12:38:08 -04:00
Jeff Mitchell
1d4d302bfa
Clean up request logic and use retryable's more efficient handling (#4670) 2018-06-01 09:12:43 -04:00
Jeff Mitchell
49a3f71bfb Fix missing verification nonce field 2018-05-29 16:13:08 -04:00
Jeff Mitchell
6fa29dda67
Merge branch 'master' into rekey-verification 2018-05-29 10:19:57 -04:00
Jeff Mitchell
f6d3aea11f
Builds on top of #4600 to provide CLI support (#4605) 2018-05-28 00:39:53 -04:00
Jeff Mitchell
a5563e4aec
Redo API client locking (#4551)
* Redo API client locking

This assigns local values when in critical paths, allowing a single API
client to much more quickly and safely pipeline requests.

Additionally, in order to take that paradigm all the way it changes how
timeouts are set. It now uses a context value set on the request instead
of configuring the timeout in the http client per request, which was
also potentially quite racy.

Trivially tested with
VAULT_CLIENT_TIMEOUT=2 vault write pki/root/generate/internal key_type=rsa key_bits=8192
2018-05-25 14:38:06 -04:00
Jeff Mitchell
893b7b6635 Finish api tests for verification 2018-05-20 19:01:24 -04:00
Jeff Mitchell
d9535101c3 More work on recovery test 2018-05-20 18:42:14 -04:00
Jeff Mitchell
a63a0dcf05 Start of seal improvements for testing 2018-05-20 17:49:37 -04:00
Jeff Mitchell
adf53b3988 Refactor test to add recovery support 2018-05-20 17:38:04 -04:00
Jeff Mitchell
bf16f7f517 Finish non-recovery test 2018-05-20 02:42:15 -04:00
Jeff Mitchell
9f700be4cc Add some more test structure and update test 2018-05-20 00:02:45 -04:00
Jeff Mitchell
cfd087b155 Update rekey methods to indicate proper error codes in responses 2018-05-19 23:43:48 -04:00
Jeff Mitchell
fd66cc5ec8 Re-add capability to unwrap pre-0.6.2 wrapping tokens 2018-05-15 20:01:58 -04:00
Lucy Davinhart
1db9c4969a Fix syntax errors causing api package to fail tests (#4555) 2018-05-11 16:28:03 -04:00
Jeff Mitchell
cb54688f59
Fix panic when running capabilities CLI command with multiple paths (#4553)
* Fix panic using 'vault token capabilities' with more than one path

Fixes #4552

* Add test
2018-05-11 11:58:12 -04:00
Jeff Mitchell
e80234b4a7 Fix fmt 2018-05-11 11:50:10 -04:00
Robbie McKinstry
fd6f676f8f Client side rate limiting (#4421) 2018-05-11 10:42:06 -04:00
Jeff Mitchell
146e8f6c9c
Fix response wrapping from K/V version 2 (#4511)
This takes place in two parts, since working on this exposed an issue
with response wrapping when there is a raw body set. The changes are (in
diff order):

* A CurrentWrappingLookupFunc has been added to return the current
value. This is necessary for the lookahead call since we don't want the
lookahead call to be wrapped.

* Support for unwrapping < 0.6.2 tokens via the API/CLI has been
removed, because we now have backends returning 404s with data and can't
rely on the 404 trick. These can still be read manually via
cubbyhole/response.

* KV preflight version request now ensures that its calls is not
wrapped, and restores any given function after.

* When responding with a raw body, instead of always base64-decoding a
string value and erroring on failure, on failure we assume that it
simply wasn't a base64-encoded value and use it as is.

* A test that fails on master and works now that ensures that raw body
responses that are wrapped and then unwrapped return the expected
values.

* A flag for response data that indicates to the wrapping handling that
the data contained therein is already JSON decoded (more later).

* RespondWithStatusCode now defaults to a string so that the value is
HMAC'd during audit. The function always JSON encodes the body, so
before now it was always returning []byte which would skip HMACing. We
don't know what's in the data, so this is a "better safe than sorry"
issue. If different behavior is needed, backends can always manually
populate the data instead of relying on the helper function.

* We now check unwrapped data after unwrapping to see if there were raw
flags. If so, we try to detect whether the value can be unbase64'd. The
reason is that if it can it was probably originally a []byte and
shouldn't be audit HMAC'd; if not, it was probably originally a string
and should be. In either case, we then set the value as the raw body and
hit the flag indicating that it's already been JSON decoded so not to
try again before auditing. Doing it this way ensures the right typing.

* There is now a check to see if the data coming from unwrapping is
already JSON decoded and if so the decoding is skipped before setting
the audit response.
2018-05-10 15:40:03 -04:00
Jeff Mitchell
5bd7a41e26 Update comment around legacy bool in API 2018-05-09 20:35:51 -04:00
Jeff Mitchell
a5a8206560 Change retry timing to be a little less long 2018-05-09 18:33:51 -04:00
Jeff Mitchell
cc9d29d456 Adjust MaxRetries for retryablehttp 2018-05-09 18:24:41 -04:00
Jeff Mitchell
004aec9611 Update go-retryablehttp and use PassthroughErrorHandler 2018-05-09 18:11:08 -04:00
Jeff Mitchell
891ce7a975 Update go-retryablehttp vendor 2018-05-09 17:44:53 -04:00
Jeff Mitchell
545c8f13a1 Remove outdated renewer test 2018-05-09 12:33:20 -04:00
Jeff Mitchell
05ad6d50d8 Grace is deprecated so mark as such 2018-05-09 10:02:06 -04:00
Calvin Leung Huang
861cfde1c2 Move timeout declaration outside of for loop, break out early if renewed cleanly (#4522) 2018-05-07 13:47:55 -07:00
Jeff Mitchell
5a7efd6b4b Fix #4472 a better way
Unlike switch, select will randomly choose from among multiple cases if
more than one are satisfiable.
2018-05-07 16:13:04 -04:00
Jeff Mitchell
2904318a72 Revert "Close the doneCh in the renewer when we return from Renew. (#4513)"
This reverts commit 79c708f8b6.
2018-05-07 16:11:39 -04:00
Jeff Mitchell
79c708f8b6
Close the doneCh in the renewer when we return from Renew. (#4513)
Closes #4472
2018-05-04 13:25:08 -04:00