open-vault/http
Seth Vargo 98ad431d6d Continuously attempt to unseal if sealed keys are supported (#6039)
* Add helper for checking if an error is a fatal error

The double-double negative was really confusing, and this pattern is used a few places in Vault. This negates the double negative, making the devx a bit easier to follow.

* Check return value of UnsealWithStoredKeys in sys/init

* Return proper error types when attempting unseal with stored key

Prior to this commit, "nil" could have meant unsupported auto-unseal, a transient error, or success. This updates the function to return the correct error type, signaling to the caller whether they should retry or fail.

* Continuously attempt to unseal if sealed keys are supported

This fixes a bug that occurs on bootstrapping an initial cluster. Given a collection of Vault nodes and an initialized storage backend, they will all go into standby waiting for initialization. After one node is initialized, the other nodes had no mechanism by which they "re-check" to see if unseal keys are present. This adds a goroutine to the server command which continually waits for unseal keys to exist. It exits in the following conditions:

- the node is unsealed
- the node does not support stored keys
- a fatal error occurs (as defined by Vault)
- the server is shutting down

In all other situations, the routine wakes up at the specified interval and attempts to unseal with the stored keys.
2019-01-23 16:34:34 -05:00
..
auth_token_test.go The big one (#5346) 2018-09-17 23:03:00 -04:00
cors.go Fix nil pointer 2018-06-09 16:57:57 -04:00
forwarded_for_test.go Allow max request size to be user-specified (#4824) 2018-07-06 15:44:56 -04:00
forwarding_bench_test.go The big one (#5346) 2018-09-17 23:03:00 -04:00
forwarding_test.go Logger cleanup (#5480) 2018-10-09 09:43:17 -07:00
handler.go Run goimports across the repository (#6010) 2019-01-08 16:48:57 -08:00
handler_test.go Run goimports across the repository (#6010) 2019-01-08 16:48:57 -08:00
help.go The big one (#5346) 2018-09-17 23:03:00 -04:00
help_test.go Remove cookie authentication. 2015-08-21 19:46:23 -07:00
http_test.go Run goimports across the repository (#6010) 2019-01-08 16:48:57 -08:00
logical.go Run goimports across the repository (#6010) 2019-01-08 16:48:57 -08:00
logical_test.go Batch tokens (#755) 2018-10-15 12:56:24 -04:00
plugin_test.go Run all builtins as plugins (#5536) 2018-11-06 17:21:24 -08:00
stub_assets.go OSS: Adding UI handlers and configurable headers (#390) 2018-04-03 09:34:01 -05:00
sys_audit_test.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00
sys_auth_test.go Run all builtins as plugins (#5536) 2018-11-06 17:21:24 -08:00
sys_config_cors_test.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00
sys_generate_root.go Simplify base62.Random (#5982) 2018-12-20 07:40:01 -08:00
sys_generate_root_test.go Seal migration (OSS) (#781) 2018-10-22 23:34:02 -07:00
sys_health.go Add LastWAL in leader/health output (#5523) 2018-10-16 09:38:44 -04:00
sys_health_test.go Fix http tests (#5195) 2018-08-27 15:13:41 -07:00
sys_init.go Continuously attempt to unseal if sealed keys are supported (#6039) 2019-01-23 16:34:34 -05:00
sys_init_test.go Tackle #4929 a different way (#4932) 2018-07-24 13:57:25 -07:00
sys_internal_test.go Kv preflight (#4430) 2018-04-23 15:00:02 -07:00
sys_leader.go Add LastWAL in leader/health output (#5523) 2018-10-16 09:38:44 -04:00
sys_leader_test.go Add performance standby status to status output (#5192) 2018-08-27 10:01:07 -07:00
sys_lease_test.go Exclude /sys/leases/renew from registering with expiration manager (#2891) 2017-06-20 12:34:00 -04:00
sys_mount_test.go Mount tune options (#5809) 2018-11-19 14:23:25 -08:00
sys_mounts_test.go Rename "generic" secret backend to "kv" (#3292) 2017-09-15 09:02:29 -04:00
sys_policy_test.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00
sys_rekey.go Fix tests 2018-05-29 17:02:52 -04:00
sys_rekey_test.go The big one (#5346) 2018-09-17 23:03:00 -04:00
sys_rotate_test.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00
sys_seal.go Seal migration (OSS) (#781) 2018-10-22 23:34:02 -07:00
sys_seal_test.go Seal migration (OSS) (#781) 2018-10-22 23:34:02 -07:00
sys_wrapping_test.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
testing.go Pass in an ErrorLog to http.Server (#5135) 2018-08-21 11:23:18 -04:00
unwrapping_raw_body_test.go Fix response wrapping from K/V version 2 (#4511) 2018-05-10 15:40:03 -04:00
util.go The big one (#5346) 2018-09-17 23:03:00 -04:00