vault/command
Jeff Mitchell 19e5061779
Allow returning warnings and other data in 404s in the Go API (#4256)
* Allow returning list information and other data in 404s.

On read it'll output data and/or warnings on a 404 if they exist. On
list, the same behavior; the actual 'vault list' command doesn't change
behavior though in terms of output unless there are no actual keys (so
it doesn't just magically show other data).

This corrects some assumptions in response_util and wrapping.go; it also
corrects a few places in the latter where it could leak a (useless)
token in some error cases.

* Use same 404 logic in delete/put too

* Add the same secret parsing logic to the KV request functions
2018-04-03 22:35:45 -04:00
..
config Make the error message that comes from parsing the config file more 2018-03-19 19:40:51 -04:00
server Move to "github.com/hashicorp/go-hclog" (#4227) 2018-04-02 17:46:59 -07:00
test-fixtures Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
token Introduce auth as a subcommand 2017-10-24 09:30:47 -04:00
approle_concurrency_integ_test.go Move to "github.com/hashicorp/go-hclog" (#4227) 2018-04-02 17:46:59 -07:00
audit.go Make audit a subcommand 2017-10-24 09:30:47 -04:00
audit_disable.go Make audit a subcommand 2017-10-24 09:30:47 -04:00
audit_disable_test.go Make audit a subcommand 2017-10-24 09:30:47 -04:00
audit_enable.go Make audit a subcommand 2017-10-24 09:30:47 -04:00
audit_enable_test.go Adding tests to ensure all backends are mountable (#3861) 2018-02-01 11:30:04 -05:00
audit_list.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
audit_list_test.go Update audit-list command 2017-10-24 09:28:06 -04:00
auth.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
auth_disable.go Introduce auth as a subcommand 2017-10-24 09:30:47 -04:00
auth_disable_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
auth_enable.go Merge branch 'master-oss' into 0.10-beta 2018-03-27 12:40:30 -04:00
auth_enable_test.go Adding tests to ensure all backends are mountable (#3861) 2018-02-01 11:30:04 -05:00
auth_help.go Fix confusing error messages around help for 'vault auth' (#4058) 2018-03-01 10:55:24 -05:00
auth_help_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
auth_list.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
auth_list_test.go Add new auth-list command 2017-10-24 09:28:06 -04:00
auth_test.go Introduce auth as a subcommand 2017-10-24 09:30:47 -04:00
auth_tune.go Fix some command help output formatting 2018-03-21 23:58:16 -04:00
auth_tune_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
base.go reintroduce flagMFA (#4223) 2018-03-30 12:11:10 -04:00
base_flags.go Add a custom flag for specifying "system" ttls 2017-10-24 09:30:48 -04:00
base_helpers.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
base_helpers_test.go Expand and centralize helpers 2017-10-24 09:28:05 -04:00
base_predict.go Add API functions and completions for plugins (#4194) 2018-03-26 13:40:33 -04:00
base_predict_test.go Add API functions and completions for plugins (#4194) 2018-03-26 13:40:33 -04:00
command_test.go Move to "github.com/hashicorp/go-hclog" (#4227) 2018-04-02 17:46:59 -07:00
commands.go Add HA support to the Google Cloud Storage backend (#4226) 2018-03-30 12:36:37 -04:00
config.go Create a new command/config subpackage. (#4055) 2018-02-28 20:09:21 -05:00
config_test.go Remove config from Meta; it's only used right now with the token helper. 2016-04-01 16:02:18 -04:00
delete.go Update delete command 2017-10-24 09:30:47 -04:00
delete_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
format.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
format_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
identity_group_aliases_integ_test.go Move to "github.com/hashicorp/go-hclog" (#4227) 2018-04-02 17:46:59 -07:00
kv.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_delete.go Allow for comma separated strings in the TypeCommaIntSlice field type (#4257) 2018-04-03 17:58:42 -07:00
kv_destroy.go Allow for comma separated strings in the TypeCommaIntSlice field type (#4257) 2018-04-03 17:58:42 -07:00
kv_enable_versioning.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_get.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_helpers.go Allow returning warnings and other data in 404s in the Go API (#4256) 2018-04-03 22:35:45 -04:00
kv_list.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_metadata.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_metadata_delete.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_metadata_get.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_metadata_put.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_put.go command/kv: Add a "kv" subcommand for using the key-value store (#4168) 2018-03-21 15:02:41 -07:00
kv_undelete.go Allow for comma separated strings in the TypeCommaIntSlice field type (#4257) 2018-04-03 17:58:42 -07:00
lease.go Add lease subcommand 2017-10-24 09:30:47 -04:00
lease_renew.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
lease_renew_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
lease_revoke.go Add lease subcommand 2017-10-24 09:30:47 -04:00
lease_revoke_test.go Add lease subcommand 2017-10-24 09:30:47 -04:00
list.go Allow returning warnings and other data in 404s in the Go API (#4256) 2018-04-03 22:35:45 -04:00
list_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
login.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
login_test.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
main.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
operator.go Add "operator" subcommand 2017-10-24 09:30:48 -04:00
operator_generate_root.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
operator_generate_root_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
operator_init.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
operator_init_test.go Also exclude init command from race detector 2018-02-16 11:09:36 -05:00
operator_key_status.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
operator_key_status_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
operator_rekey.go Re-add lost stored-shares parameter to operator rekey command. (#3974) 2018-02-14 16:10:45 -05:00
operator_rekey_test.go Exclude rekey command tests from race detector 2018-02-08 13:34:45 -05:00
operator_seal.go Add "operator" subcommand 2017-10-24 09:30:48 -04:00
operator_seal_test.go Add "operator" subcommand 2017-10-24 09:30:48 -04:00
operator_step_down.go Add "operator" subcommand 2017-10-24 09:30:48 -04:00
operator_step_down_test.go Add "operator" subcommand 2017-10-24 09:30:48 -04:00
operator_unseal.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
operator_unseal_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
path_help.go Update path-help command 2017-10-24 09:30:48 -04:00
path_help_test.go Fix bad rebase 2017-10-24 09:39:34 -04:00
path_map_upgrade_api_test.go Move to "github.com/hashicorp/go-hclog" (#4227) 2018-04-02 17:46:59 -07:00
pgp_test.go Add helper for decrypting via PGP in tests 2017-10-24 09:28:06 -04:00
policies_deprecated.go Fix compile 2018-03-16 13:55:56 -04:00
policies_deprecated_test.go Add "policy" subcommand 2017-10-24 09:30:48 -04:00
policy.go Fix minor docs and help text issues (#4184) 2018-03-22 09:29:59 -04:00
policy_delete.go Add "policy" subcommand 2017-10-24 09:30:48 -04:00
policy_delete_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
policy_fmt.go Use renamed method 2017-10-24 09:39:51 -04:00
policy_fmt_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
policy_list.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
policy_list_test.go Add "policy" subcommand 2017-10-24 09:30:48 -04:00
policy_read.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
policy_read_test.go Add "policy" subcommand 2017-10-24 09:30:48 -04:00
policy_write.go Add "policy" subcommand 2017-10-24 09:30:48 -04:00
policy_write_test.go Update policy-write command 2017-10-24 09:29:37 -04:00
read.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
read_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
rotate.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
rotate_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
secrets.go Rename mounts to secrets engines and add the subcommand 2017-10-24 09:30:48 -04:00
secrets_disable.go Rename mounts to secrets engines and add the subcommand 2017-10-24 09:30:48 -04:00
secrets_disable_test.go Rename mounts to secrets engines and add the subcommand 2017-10-24 09:30:48 -04:00
secrets_enable.go Merge branch 'master-oss' into 0.10-beta 2018-03-27 12:40:30 -04:00
secrets_enable_test.go Fix tests 2018-03-21 23:50:44 -04:00
secrets_list.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
secrets_list_test.go Rename mounts to secrets engines and add the subcommand 2017-10-24 09:30:48 -04:00
secrets_move.go Rename mounts to secrets engines and add the subcommand 2017-10-24 09:30:48 -04:00
secrets_move_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
secrets_tune.go Fix some command help output formatting 2018-03-21 23:58:16 -04:00
secrets_tune_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
server.go OSS: Adding UI handlers and configurable headers (#390) 2018-04-03 09:34:01 -05:00
server_test.go Fix bad rebase 2017-10-24 09:39:34 -04:00
ssh.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
ssh_test.go Update ssh command 2017-10-24 09:30:46 -04:00
status.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
status_test.go Fix bad rebase 2017-10-24 09:39:34 -04:00
token.go Add token as a subcommand 2017-10-24 09:30:47 -04:00
token_capabilities.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_capabilities_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
token_create.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_create_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_lookup.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_lookup_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_renew.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_renew_test.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
token_revoke.go Add token as a subcommand 2017-10-24 09:30:47 -04:00
token_revoke_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
unwrap.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
unwrap_test.go Spelling (#4119) 2018-03-20 14:54:10 -04:00
util.go Create a new command/config subpackage. (#4055) 2018-02-28 20:09:21 -05:00
version.go Update version command 2017-10-24 09:30:48 -04:00
version_test.go Always use a local test server (#4207) 2018-03-28 10:34:37 -04:00
write.go CLI Enhancements (#3897) 2018-02-12 18:12:16 -05:00
write_test.go Update write command 2017-10-24 09:30:48 -04:00