diff --git a/builtin/credential/cert/path_certs.go b/builtin/credential/cert/path_certs.go index fc1876632..7c5543db4 100644 --- a/builtin/credential/cert/path_certs.go +++ b/builtin/credential/cert/path_certs.go @@ -73,7 +73,7 @@ At least one must exist in the Common Name. Supports globbing.`, Description: `A comma-separated list of DNS names. At least one must exist in the SANs. Supports globbing.`, DisplayAttrs: &framework.DisplayAttributes{ - Name: "Allowed DNS SANs", + Name: "Allowed DNS SANs", Group: "Constraints", }, }, @@ -83,7 +83,7 @@ At least one must exist in the SANs. Supports globbing.`, Description: `A comma-separated list of Email Addresses. At least one must exist in the SANs. Supports globbing.`, DisplayAttrs: &framework.DisplayAttributes{ - Name: "Allowed Email SANs", + Name: "Allowed Email SANs", Group: "Constraints", }, }, @@ -93,7 +93,7 @@ At least one must exist in the SANs. Supports globbing.`, Description: `A comma-separated list of URIs. At least one must exist in the SANs. Supports globbing.`, DisplayAttrs: &framework.DisplayAttributes{ - Name: "Allowed URI SANs", + Name: "Allowed URI SANs", Group: "Constraints", }, }, diff --git a/command/agent/cf_end_to_end_test.go b/command/agent/cf_end_to_end_test.go index 8ebe606b9..865b62c1e 100644 --- a/command/agent/cf_end_to_end_test.go +++ b/command/agent/cf_end_to_end_test.go @@ -71,9 +71,9 @@ func TestCFEndToEnd(t *testing.T) { // Configure a CA certificate like a Vault operator would in setting up CF. if _, err := client.Logical().Write("auth/cf/config", map[string]interface{}{ "identity_ca_certificates": testCFCerts.CACertificate, - "cf_api_addr": mockCFAPI.URL, - "cf_username": cfAPI.AuthUsername, - "cf_password": cfAPI.AuthPassword, + "cf_api_addr": mockCFAPI.URL, + "cf_username": cfAPI.AuthUsername, + "cf_password": cfAPI.AuthPassword, }); err != nil { t.Fatal(err) } diff --git a/command/auth_enable.go b/command/auth_enable.go index a52bc2f28..bc4c52d24 100644 --- a/command/auth_enable.go +++ b/command/auth_enable.go @@ -259,10 +259,10 @@ func (c *AuthEnableCommand) Run(args []string) int { } authOpts := &api.EnableAuthOptions{ - Type: authType, - Description: c.flagDescription, - Local: c.flagLocal, - SealWrap: c.flagSealWrap, + Type: authType, + Description: c.flagDescription, + Local: c.flagLocal, + SealWrap: c.flagSealWrap, ExternalEntropyAccess: c.flagExternalEntropyAccess, Config: api.AuthConfigInput{ DefaultLeaseTTL: c.flagDefaultLeaseTTL.String(), diff --git a/command/server.go b/command/server.go index aad9ef02e..6db0ff1b6 100644 --- a/command/server.go +++ b/command/server.go @@ -6,7 +6,6 @@ import ( "encoding/base64" "encoding/hex" "fmt" - "go.uber.org/atomic" "io" "io/ioutil" "net" @@ -54,6 +53,7 @@ import ( "github.com/mitchellh/cli" "github.com/mitchellh/go-testing-interface" "github.com/posener/complete" + "go.uber.org/atomic" "golang.org/x/net/http/httpproxy" "google.golang.org/api/option" "google.golang.org/grpc/grpclog" diff --git a/command/server/config_test.go b/command/server/config_test.go index 3da60c808..808df7bff 100644 --- a/command/server/config_test.go +++ b/command/server/config_test.go @@ -11,7 +11,7 @@ func TestLoadConfigFile(t *testing.T) { } func TestLoadConfigFile_topLevel(t *testing.T) { - testLoadConfigFile_topLevel(t,nil) + testLoadConfigFile_topLevel(t, nil) } func TestLoadConfigFile_json(t *testing.T) { @@ -19,7 +19,7 @@ func TestLoadConfigFile_json(t *testing.T) { } func TestLoadConfigFile_json2(t *testing.T) { - testLoadConfigFile_json2(t,nil) + testLoadConfigFile_json2(t, nil) } func TestLoadConfigDir(t *testing.T) { @@ -34,6 +34,6 @@ func TestParseListeners(t *testing.T) { testParseListeners(t) } -func TestParseEntropy(t *testing.T){ - testParseEntropy(t,true) -} \ No newline at end of file +func TestParseEntropy(t *testing.T) { + testParseEntropy(t, true) +} diff --git a/command/server/config_test_helpers.go b/command/server/config_test_helpers.go index 74d8a5c03..12fff634b 100644 --- a/command/server/config_test_helpers.go +++ b/command/server/config_test_helpers.go @@ -222,7 +222,7 @@ func testParseEntropy(t *testing.T, oss bool) { case err != test.outErr: t.Fatalf("error mismatch: expected %#v got %#v", err, test.outErr) case err == nil && config.Entropy != nil && *config.Entropy != test.outEntropy: - fmt.Printf("\n config.Entropy: %#v",config.Entropy) + fmt.Printf("\n config.Entropy: %#v", config.Entropy) t.Fatalf("entropy config mismatch: expected %#v got %#v", test.outEntropy, *config.Entropy) } } @@ -556,4 +556,4 @@ listener "tcp" { t.Fatalf("expected \n\n%#v\n\n to be \n\n%#v\n\n", config, *expected) } -} \ No newline at end of file +} diff --git a/command/server/config_util.go b/command/server/config_util.go index ffbb62222..cade182e4 100644 --- a/command/server/config_util.go +++ b/command/server/config_util.go @@ -4,7 +4,7 @@ import ( "github.com/hashicorp/hcl/hcl/ast" ) -var( +var ( parseEntropy = parseEntropyOSS ) diff --git a/command/server/seal/server_seal.go b/command/server/seal/server_seal.go index 6b27f631d..21af6d410 100644 --- a/command/server/seal/server_seal.go +++ b/command/server/seal/server_seal.go @@ -28,8 +28,8 @@ func configureSeal(configSeal *server.Seal, infoKeys *[]string, info *map[string return configureAzureKeyVaultSeal(configSeal, infoKeys, info, logger, inseal) case seal.OCIKMS: - return configureOCIKMSSeal(configSeal, infoKeys, info, logger, inseal) - + return configureOCIKMSSeal(configSeal, infoKeys, info, logger, inseal) + case seal.Transit: return configureTransitSeal(configSeal, infoKeys, info, logger, inseal) diff --git a/helper/testhelpers/ldap/ldaphelper.go b/helper/testhelpers/ldap/ldaphelper.go index 5322684fe..f2b248318 100644 --- a/helper/testhelpers/ldap/ldaphelper.go +++ b/helper/testhelpers/ldap/ldaphelper.go @@ -2,11 +2,12 @@ package ldap import ( "fmt" + "testing" + "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/helper/testhelpers/docker" "github.com/hashicorp/vault/sdk/helper/ldaputil" "github.com/ory/dockertest" - "testing" ) func PrepareTestContainer(t *testing.T, version string) (cleanup func(), cfg *ldaputil.ConfigEntry) { diff --git a/helper/testhelpers/teststorage/teststorage.go b/helper/testhelpers/teststorage/teststorage.go index 3dbe0e6f1..e279bbb5c 100644 --- a/helper/testhelpers/teststorage/teststorage.go +++ b/helper/testhelpers/teststorage/teststorage.go @@ -2,16 +2,16 @@ package teststorage import ( "fmt" - "github.com/hashicorp/vault/helper/testhelpers" - "github.com/hashicorp/vault/physical/raft" "io/ioutil" "os" realtesting "testing" "time" "github.com/hashicorp/go-hclog" + "github.com/hashicorp/vault/helper/testhelpers" "github.com/hashicorp/vault/helper/testhelpers/consul" physConsul "github.com/hashicorp/vault/physical/consul" + "github.com/hashicorp/vault/physical/raft" "github.com/hashicorp/vault/sdk/physical" physFile "github.com/hashicorp/vault/sdk/physical/file" "github.com/hashicorp/vault/sdk/physical/inmem" diff --git a/http/handler.go b/http/handler.go index 20eeb8592..7f5fbb6ee 100644 --- a/http/handler.go +++ b/http/handler.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/NYTimes/gziphandler" "io" "io/ioutil" "net" @@ -17,6 +16,7 @@ import ( "strings" "time" + "github.com/NYTimes/gziphandler" assetfs "github.com/elazarl/go-bindata-assetfs" "github.com/hashicorp/errwrap" "github.com/hashicorp/go-cleanhttp" diff --git a/http/handler_test.go b/http/handler_test.go index b844e06f6..31079ef9c 100644 --- a/http/handler_test.go +++ b/http/handler_test.go @@ -269,8 +269,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -282,8 +282,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -296,8 +296,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -309,8 +309,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -323,8 +323,8 @@ func TestSysMounts_headerAuth(t *testing.T) { }, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -336,8 +336,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -350,8 +350,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -363,8 +363,8 @@ func TestSysMounts_headerAuth(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), diff --git a/http/sys_auth_test.go b/http/sys_auth_test.go index af8444a24..fa774a302 100644 --- a/http/sys_auth_test.go +++ b/http/sys_auth_test.go @@ -27,8 +27,8 @@ func TestSysAuth(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "token/": map[string]interface{}{ - "description": "token based credentials", - "type": "token", + "description": "token based credentials", + "type": "token", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -42,8 +42,8 @@ func TestSysAuth(t *testing.T) { }, }, "token/": map[string]interface{}{ - "description": "token based credentials", - "type": "token", + "description": "token based credentials", + "type": "token", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -103,8 +103,8 @@ func TestSysEnableAuth(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "foo/": map[string]interface{}{ - "description": "foo", - "type": "noop", + "description": "foo", + "type": "noop", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -117,8 +117,8 @@ func TestSysEnableAuth(t *testing.T) { "options": map[string]interface{}{}, }, "token/": map[string]interface{}{ - "description": "token based credentials", - "type": "token", + "description": "token based credentials", + "type": "token", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -132,8 +132,8 @@ func TestSysEnableAuth(t *testing.T) { }, }, "foo/": map[string]interface{}{ - "description": "foo", - "type": "noop", + "description": "foo", + "type": "noop", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -146,8 +146,8 @@ func TestSysEnableAuth(t *testing.T) { "options": map[string]interface{}{}, }, "token/": map[string]interface{}{ - "description": "token based credentials", - "type": "token", + "description": "token based credentials", + "type": "token", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -216,12 +216,12 @@ func TestSysDisableAuth(t *testing.T) { "token_type": "default-service", "force_no_cache": false, }, - "description": "token based credentials", - "type": "token", + "description": "token based credentials", + "type": "token", "external_entropy_access": false, - "local": false, - "seal_wrap": false, - "options": interface{}(nil), + "local": false, + "seal_wrap": false, + "options": interface{}(nil), }, }, "token/": map[string]interface{}{ @@ -231,12 +231,12 @@ func TestSysDisableAuth(t *testing.T) { "token_type": "default-service", "force_no_cache": false, }, - "description": "token based credentials", - "type": "token", + "description": "token based credentials", + "type": "token", "external_entropy_access": false, - "local": false, - "seal_wrap": false, - "options": interface{}(nil), + "local": false, + "seal_wrap": false, + "options": interface{}(nil), }, } testResponseStatus(t, resp, 200) diff --git a/http/sys_mount_test.go b/http/sys_mount_test.go index 8fc01c14a..ab448ac5e 100644 --- a/http/sys_mount_test.go +++ b/http/sys_mount_test.go @@ -29,8 +29,8 @@ func TestSysMounts(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -42,8 +42,8 @@ func TestSysMounts(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -56,8 +56,8 @@ func TestSysMounts(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -69,8 +69,8 @@ func TestSysMounts(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -83,8 +83,8 @@ func TestSysMounts(t *testing.T) { }, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -96,8 +96,8 @@ func TestSysMounts(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -110,8 +110,8 @@ func TestSysMounts(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -123,8 +123,8 @@ func TestSysMounts(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -184,8 +184,8 @@ func TestSysMount(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "foo/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -197,8 +197,8 @@ func TestSysMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -210,8 +210,8 @@ func TestSysMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -224,8 +224,8 @@ func TestSysMount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -237,8 +237,8 @@ func TestSysMount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -251,8 +251,8 @@ func TestSysMount(t *testing.T) { }, }, "foo/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -264,8 +264,8 @@ func TestSysMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -277,8 +277,8 @@ func TestSysMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -291,8 +291,8 @@ func TestSysMount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -304,8 +304,8 @@ func TestSysMount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -385,8 +385,8 @@ func TestSysRemount(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "bar/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -398,8 +398,8 @@ func TestSysRemount(t *testing.T) { "options": map[string]interface{}{}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -411,8 +411,8 @@ func TestSysRemount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -425,8 +425,8 @@ func TestSysRemount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -438,8 +438,8 @@ func TestSysRemount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -452,8 +452,8 @@ func TestSysRemount(t *testing.T) { }, }, "bar/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -465,8 +465,8 @@ func TestSysRemount(t *testing.T) { "options": map[string]interface{}{}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -478,8 +478,8 @@ func TestSysRemount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -492,8 +492,8 @@ func TestSysRemount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -505,8 +505,8 @@ func TestSysRemount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -566,8 +566,8 @@ func TestSysUnmount(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -579,8 +579,8 @@ func TestSysUnmount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -593,8 +593,8 @@ func TestSysUnmount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -606,8 +606,8 @@ func TestSysUnmount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -620,8 +620,8 @@ func TestSysUnmount(t *testing.T) { }, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -633,8 +633,8 @@ func TestSysUnmount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -647,8 +647,8 @@ func TestSysUnmount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -660,8 +660,8 @@ func TestSysUnmount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -803,8 +803,8 @@ func TestSysTuneMount(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "foo/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -816,8 +816,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -829,8 +829,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -843,8 +843,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -856,8 +856,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -870,8 +870,8 @@ func TestSysTuneMount(t *testing.T) { }, }, "foo/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -883,8 +883,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -896,8 +896,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -910,8 +910,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -923,8 +923,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1010,8 +1010,8 @@ func TestSysTuneMount(t *testing.T) { "auth": nil, "data": map[string]interface{}{ "foo/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("259196400"), @@ -1023,8 +1023,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1036,8 +1036,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1050,8 +1050,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1063,8 +1063,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1077,8 +1077,8 @@ func TestSysTuneMount(t *testing.T) { }, }, "foo/": map[string]interface{}{ - "description": "foo", - "type": "kv", + "description": "foo", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("259196400"), @@ -1090,8 +1090,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "secret/": map[string]interface{}{ - "description": "key/value secret storage", - "type": "kv", + "description": "key/value secret storage", + "type": "kv", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1103,8 +1103,8 @@ func TestSysTuneMount(t *testing.T) { "options": map[string]interface{}{"version": "1"}, }, "sys/": map[string]interface{}{ - "description": "system endpoints used for control, policy and debugging", - "type": "system", + "description": "system endpoints used for control, policy and debugging", + "type": "system", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1117,8 +1117,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), @@ -1130,8 +1130,8 @@ func TestSysTuneMount(t *testing.T) { "options": interface{}(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, "config": map[string]interface{}{ "default_lease_ttl": json.Number("0"), diff --git a/physical/azure/azure.go b/physical/azure/azure.go index 4782e4425..217f12511 100644 --- a/physical/azure/azure.go +++ b/physical/azure/azure.go @@ -74,7 +74,7 @@ func NewAzureBackend(conf map[string]string, logger log.Logger) (physical.Backen environmentName = "AzurePublicCloud" } } - + environmentUrl := os.Getenv("AZURE_ARM_ENDPOINT") if environmentUrl == "" { environmentUrl = conf["arm_endpoint"] @@ -87,7 +87,7 @@ func NewAzureBackend(conf map[string]string, logger log.Logger) (physical.Backen environment, err = azure.EnvironmentFromURL(environmentUrl) if err != nil { errorMsg := fmt.Sprintf("failed to look up Azure environment descriptor for URL %q: {{err}}", - environmentUrl) + environmentUrl) return nil, errwrap.Wrapf(errorMsg, err) } } else { diff --git a/physical/oci/oci.go b/physical/oci/oci.go index e47060200..fcacc66ae 100644 --- a/physical/oci/oci.go +++ b/physical/oci/oci.go @@ -5,6 +5,13 @@ import ( "bytes" "errors" "fmt" + "io/ioutil" + "net/http" + "sort" + "strconv" + "strings" + "time" + "github.com/armon/go-metrics" "github.com/hashicorp/errwrap" log "github.com/hashicorp/go-hclog" @@ -15,12 +22,6 @@ import ( "github.com/oracle/oci-go-sdk/common/auth" "github.com/oracle/oci-go-sdk/objectstorage" "golang.org/x/net/context" - "io/ioutil" - "net/http" - "sort" - "strconv" - "strings" - "time" ) // Verify Backend satisfies the correct interfaces diff --git a/physical/oci/oci_ha.go b/physical/oci/oci_ha.go index a053a0ea4..5ae94ce67 100644 --- a/physical/oci/oci_ha.go +++ b/physical/oci/oci_ha.go @@ -7,16 +7,17 @@ import ( "encoding/json" "errors" "fmt" - "github.com/armon/go-metrics" - "github.com/hashicorp/errwrap" - "github.com/hashicorp/go-uuid" - "github.com/hashicorp/vault/sdk/physical" - "github.com/oracle/oci-go-sdk/objectstorage" "io/ioutil" "net/http" "sync" "sync/atomic" "time" + + "github.com/armon/go-metrics" + "github.com/hashicorp/errwrap" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/vault/sdk/physical" + "github.com/oracle/oci-go-sdk/objectstorage" ) // The lock implementation below prioritizes ensuring that there are not 2 primary at any given point in time diff --git a/physical/oci/oci_ha_test.go b/physical/oci/oci_ha_test.go index e3d5bc3e1..6dfaba976 100644 --- a/physical/oci/oci_ha_test.go +++ b/physical/oci/oci_ha_test.go @@ -2,12 +2,13 @@ package oci import ( + "os" + "testing" + "github.com/hashicorp/go-uuid" "github.com/hashicorp/vault/sdk/physical" "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/objectstorage" - "os" - "testing" ) func TestOCIHABackend(t *testing.T) { diff --git a/physical/oci/oci_test.go b/physical/oci/oci_test.go index d17c0c8a7..46edcb8c7 100644 --- a/physical/oci/oci_test.go +++ b/physical/oci/oci_test.go @@ -2,6 +2,9 @@ package oci import ( + "os" + "testing" + log "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-uuid" "github.com/hashicorp/vault/sdk/helper/logging" @@ -9,8 +12,6 @@ import ( "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/objectstorage" "golang.org/x/net/context" - "os" - "testing" ) func TestOCIBackend(t *testing.T) { diff --git a/sdk/helper/base62/base62.go b/sdk/helper/base62/base62.go index 0f65e23f6..57a76d442 100644 --- a/sdk/helper/base62/base62.go +++ b/sdk/helper/base62/base62.go @@ -4,8 +4,9 @@ package base62 import ( "crypto/rand" - uuid "github.com/hashicorp/go-uuid" "io" + + uuid "github.com/hashicorp/go-uuid" ) const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" diff --git a/sdk/helper/entropy/entropy.go b/sdk/helper/entropy/entropy.go index e425c0276..afaef76ed 100644 --- a/sdk/helper/entropy/entropy.go +++ b/sdk/helper/entropy/entropy.go @@ -2,6 +2,7 @@ package entropy import ( "fmt" + "github.com/hashicorp/errwrap" ) @@ -13,7 +14,7 @@ type Reader struct { source Sourcer } -func NewReader(source Sourcer) *Reader{ +func NewReader(source Sourcer) *Reader { return &Reader{source} } @@ -21,7 +22,7 @@ func NewReader(source Sourcer) *Reader{ // If r returns an error having read at least len(p) bytes, the error is dropped. // It returns the number of bytes copied and an error if fewer bytes were read. // On return, n == len(p) if and only if err == nil. -func (r *Reader) Read(p []byte) (n int, err error){ +func (r *Reader) Read(p []byte) (n int, err error) { requested := len(p) randBytes, err := r.source.GetRandom(requested) delivered := copy(p, randBytes) diff --git a/sdk/helper/entropy/entropy_test.go b/sdk/helper/entropy/entropy_test.go index 9863d1057..3bfb203f0 100644 --- a/sdk/helper/entropy/entropy_test.go +++ b/sdk/helper/entropy/entropy_test.go @@ -4,8 +4,9 @@ import ( "bytes" "errors" "fmt" - "github.com/hashicorp/errwrap" "testing" + + "github.com/hashicorp/errwrap" ) type mockSourcer struct{} diff --git a/sdk/helper/keysutil/policy_test.go b/sdk/helper/keysutil/policy_test.go index d1c01fb82..341ecda70 100644 --- a/sdk/helper/keysutil/policy_test.go +++ b/sdk/helper/keysutil/policy_test.go @@ -2,12 +2,12 @@ package keysutil import ( "context" + "crypto/rand" "reflect" "strconv" "sync" "testing" "time" - "crypto/rand" "github.com/hashicorp/vault/sdk/helper/jsonutil" "github.com/hashicorp/vault/sdk/logical" diff --git a/sdk/helper/tokenutil/tokenutil.go b/sdk/helper/tokenutil/tokenutil.go index 67fcba2bc..bc4dd1d73 100644 --- a/sdk/helper/tokenutil/tokenutil.go +++ b/sdk/helper/tokenutil/tokenutil.go @@ -75,7 +75,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeCommaStringSlice, Description: `Comma separated string or JSON list of CIDR blocks. If set, specifies the blocks of IP addresses which are allowed to use the generated token.`, DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Bound CIDRs", + Name: "Generated Token's Bound CIDRs", Group: "Tokens", }, }, @@ -84,7 +84,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeDurationSecond, Description: tokenExplicitMaxTTLHelp, DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Explicit Maximum TTL", + Name: "Generated Token's Explicit Maximum TTL", Group: "Tokens", }, }, @@ -93,7 +93,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeDurationSecond, Description: "The maximum lifetime of the generated token", DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Maximum TTL", + Name: "Generated Token's Maximum TTL", Group: "Tokens", }, }, @@ -102,7 +102,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeBool, Description: "If true, the 'default' policy will not automatically be added to generated tokens", DisplayAttrs: &framework.DisplayAttributes{ - Name: "Do Not Attach 'default' Policy To Generated Tokens", + Name: "Do Not Attach 'default' Policy To Generated Tokens", Group: "Tokens", }, }, @@ -111,7 +111,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeDurationSecond, Description: tokenPeriodHelp, DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Period", + Name: "Generated Token's Period", Group: "Tokens", }, }, @@ -120,7 +120,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeCommaStringSlice, Description: "Comma-separated list of policies", DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Policies", + Name: "Generated Token's Policies", Group: "Tokens", }, }, @@ -130,7 +130,7 @@ func TokenFields() map[string]*framework.FieldSchema { Default: "default-service", Description: "The type of token to generate, service or batch", DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Type", + Name: "Generated Token's Type", Group: "Tokens", }, }, @@ -139,7 +139,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeDurationSecond, Description: "The initial ttl of the token to generate", DisplayAttrs: &framework.DisplayAttributes{ - Name: "Generated Token's Initial TTL", + Name: "Generated Token's Initial TTL", Group: "Tokens", }, }, @@ -148,7 +148,7 @@ func TokenFields() map[string]*framework.FieldSchema { Type: framework.TypeInt, Description: "The maximum number of times a token may be used, a value of zero means unlimited", DisplayAttrs: &framework.DisplayAttributes{ - Name: "Maximum Uses of Generated Tokens", + Name: "Maximum Uses of Generated Tokens", Group: "Tokens", }, }, diff --git a/vault/external_tests/identity/identity_test.go b/vault/external_tests/identity/identity_test.go index f82f061cc..76dd2b4ca 100644 --- a/vault/external_tests/identity/identity_test.go +++ b/vault/external_tests/identity/identity_test.go @@ -1,16 +1,16 @@ package identity import ( - "github.com/go-ldap/ldap" - "github.com/hashicorp/vault/sdk/helper/ldaputil" "testing" + "github.com/go-ldap/ldap" log "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/api" ldapcred "github.com/hashicorp/vault/builtin/credential/ldap" "github.com/hashicorp/vault/helper/namespace" ldaphelper "github.com/hashicorp/vault/helper/testhelpers/ldap" vaulthttp "github.com/hashicorp/vault/http" + "github.com/hashicorp/vault/sdk/helper/ldaputil" "github.com/hashicorp/vault/sdk/logical" "github.com/hashicorp/vault/vault" ) diff --git a/vault/external_tests/misc/recovery_test.go b/vault/external_tests/misc/recovery_test.go index 1121f3c4e..518fa12d7 100644 --- a/vault/external_tests/misc/recovery_test.go +++ b/vault/external_tests/misc/recovery_test.go @@ -1,17 +1,17 @@ package misc import ( - "github.com/go-test/deep" - "go.uber.org/atomic" "path" "testing" + "github.com/go-test/deep" "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/helper/testhelpers" "github.com/hashicorp/vault/http" "github.com/hashicorp/vault/sdk/helper/logging" "github.com/hashicorp/vault/sdk/physical/inmem" "github.com/hashicorp/vault/vault" + "go.uber.org/atomic" ) func TestRecovery(t *testing.T) { diff --git a/vault/generate_root_recovery.go b/vault/generate_root_recovery.go index e19c12ca0..e677802e2 100644 --- a/vault/generate_root_recovery.go +++ b/vault/generate_root_recovery.go @@ -2,6 +2,7 @@ package vault import ( "context" + "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/base62" "go.uber.org/atomic" diff --git a/vault/ha.go b/vault/ha.go index ad6b28ecc..3e89b1c2c 100644 --- a/vault/ha.go +++ b/vault/ha.go @@ -6,11 +6,12 @@ import ( "crypto/x509" "errors" "fmt" - "github.com/hashicorp/vault/vault/seal/shamir" "strings" "sync/atomic" "time" + "github.com/hashicorp/vault/vault/seal/shamir" + "github.com/armon/go-metrics" "github.com/hashicorp/errwrap" "github.com/hashicorp/go-multierror" diff --git a/vault/init_test.go b/vault/init_test.go index 9135aa81f..77715b40c 100644 --- a/vault/init_test.go +++ b/vault/init_test.go @@ -2,15 +2,14 @@ package vault import ( "context" - "github.com/hashicorp/vault/vault/seal" "reflect" "testing" log "github.com/hashicorp/go-hclog" - "github.com/hashicorp/vault/sdk/helper/logging" "github.com/hashicorp/vault/sdk/logical" "github.com/hashicorp/vault/sdk/physical/inmem" + "github.com/hashicorp/vault/vault/seal" ) func TestCore_Init(t *testing.T) { diff --git a/vault/logical_raw.go b/vault/logical_raw.go index 9474e55a7..3c73fc303 100644 --- a/vault/logical_raw.go +++ b/vault/logical_raw.go @@ -3,11 +3,12 @@ package vault import ( "context" "fmt" + "strings" + log "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/sdk/framework" "github.com/hashicorp/vault/sdk/helper/compressutil" "github.com/hashicorp/vault/sdk/logical" - "strings" ) var ( diff --git a/vault/logical_system_test.go b/vault/logical_system_test.go index 0b192f1d1..ef8e892e7 100644 --- a/vault/logical_system_test.go +++ b/vault/logical_system_test.go @@ -150,11 +150,11 @@ func TestSystemBackend_mounts(t *testing.T) { // copy what's given exp := map[string]interface{}{ "secret/": map[string]interface{}{ - "type": "kv", + "type": "kv", "external_entropy_access": false, - "description": "key/value secret storage", - "accessor": resp.Data["secret/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["secret/"].(map[string]interface{})["uuid"], + "description": "key/value secret storage", + "accessor": resp.Data["secret/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["secret/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -167,11 +167,11 @@ func TestSystemBackend_mounts(t *testing.T) { }, }, "sys/": map[string]interface{}{ - "type": "system", + "type": "system", "external_entropy_access": false, - "description": "system endpoints used for control, policy and debugging", - "accessor": resp.Data["sys/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["sys/"].(map[string]interface{})["uuid"], + "description": "system endpoints used for control, policy and debugging", + "accessor": resp.Data["sys/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["sys/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -183,11 +183,11 @@ func TestSystemBackend_mounts(t *testing.T) { "options": map[string]string(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, - "accessor": resp.Data["cubbyhole/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["cubbyhole/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["cubbyhole/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["cubbyhole/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -198,11 +198,11 @@ func TestSystemBackend_mounts(t *testing.T) { "options": map[string]string(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, - "accessor": resp.Data["identity/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["identity/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["identity/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["identity/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["identity/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["identity/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -251,11 +251,11 @@ func TestSystemBackend_mount(t *testing.T) { // copy what's given exp := map[string]interface{}{ "secret/": map[string]interface{}{ - "type": "kv", + "type": "kv", "external_entropy_access": false, - "description": "key/value secret storage", - "accessor": resp.Data["secret/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["secret/"].(map[string]interface{})["uuid"], + "description": "key/value secret storage", + "accessor": resp.Data["secret/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["secret/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -268,11 +268,11 @@ func TestSystemBackend_mount(t *testing.T) { }, }, "sys/": map[string]interface{}{ - "type": "system", + "type": "system", "external_entropy_access": false, - "description": "system endpoints used for control, policy and debugging", - "accessor": resp.Data["sys/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["sys/"].(map[string]interface{})["uuid"], + "description": "system endpoints used for control, policy and debugging", + "accessor": resp.Data["sys/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["sys/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -284,11 +284,11 @@ func TestSystemBackend_mount(t *testing.T) { "options": map[string]string(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, - "accessor": resp.Data["cubbyhole/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["cubbyhole/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["cubbyhole/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["cubbyhole/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -299,11 +299,11 @@ func TestSystemBackend_mount(t *testing.T) { "options": map[string]string(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, - "accessor": resp.Data["identity/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["identity/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["identity/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["identity/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["identity/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["identity/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -314,11 +314,11 @@ func TestSystemBackend_mount(t *testing.T) { "options": map[string]string(nil), }, "prod/secret/": map[string]interface{}{ - "description": "", - "type": "kv", + "description": "", + "type": "kv", "external_entropy_access": false, - "accessor": resp.Data["prod/secret/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["prod/secret/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["prod/secret/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["prod/secret/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": int64(2100), "max_lease_ttl": int64(2700), @@ -1456,11 +1456,11 @@ func TestSystemBackend_authTable(t *testing.T) { exp := map[string]interface{}{ "token/": map[string]interface{}{ - "type": "token", + "type": "token", "external_entropy_access": false, - "description": "token based credentials", - "accessor": resp.Data["token/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["token/"].(map[string]interface{})["uuid"], + "description": "token based credentials", + "accessor": resp.Data["token/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["token/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": int64(0), "max_lease_ttl": int64(0), @@ -1511,11 +1511,11 @@ func TestSystemBackend_enableAuth(t *testing.T) { exp := map[string]interface{}{ "foo/": map[string]interface{}{ - "type": "noop", + "type": "noop", "external_entropy_access": false, - "description": "", - "accessor": resp.Data["foo/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["foo/"].(map[string]interface{})["uuid"], + "description": "", + "accessor": resp.Data["foo/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["foo/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": int64(2100), "max_lease_ttl": int64(2700), @@ -1527,11 +1527,11 @@ func TestSystemBackend_enableAuth(t *testing.T) { "options": map[string]string{}, }, "token/": map[string]interface{}{ - "type": "token", + "type": "token", "external_entropy_access": false, - "description": "token based credentials", - "accessor": resp.Data["token/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["token/"].(map[string]interface{})["uuid"], + "description": "token based credentials", + "accessor": resp.Data["token/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["token/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": int64(0), "max_lease_ttl": int64(0), @@ -2296,11 +2296,11 @@ func TestSystemBackend_InternalUIMounts(t *testing.T) { exp = map[string]interface{}{ "secret": map[string]interface{}{ "secret/": map[string]interface{}{ - "type": "kv", + "type": "kv", "external_entropy_access": false, - "description": "key/value secret storage", - "accessor": resp.Data["secret"].(map[string]interface{})["secret/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["secret"].(map[string]interface{})["secret/"].(map[string]interface{})["uuid"], + "description": "key/value secret storage", + "accessor": resp.Data["secret"].(map[string]interface{})["secret/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["secret"].(map[string]interface{})["secret/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["secret"].(map[string]interface{})["secret/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret"].(map[string]interface{})["secret/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -2313,11 +2313,11 @@ func TestSystemBackend_InternalUIMounts(t *testing.T) { }, }, "sys/": map[string]interface{}{ - "type": "system", + "type": "system", "external_entropy_access": false, - "description": "system endpoints used for control, policy and debugging", - "accessor": resp.Data["secret"].(map[string]interface{})["sys/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["secret"].(map[string]interface{})["sys/"].(map[string]interface{})["uuid"], + "description": "system endpoints used for control, policy and debugging", + "accessor": resp.Data["secret"].(map[string]interface{})["sys/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["secret"].(map[string]interface{})["sys/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["secret"].(map[string]interface{})["sys/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret"].(map[string]interface{})["sys/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -2329,11 +2329,11 @@ func TestSystemBackend_InternalUIMounts(t *testing.T) { "options": map[string]string(nil), }, "cubbyhole/": map[string]interface{}{ - "description": "per-token private secret storage", - "type": "cubbyhole", + "description": "per-token private secret storage", + "type": "cubbyhole", "external_entropy_access": false, - "accessor": resp.Data["secret"].(map[string]interface{})["cubbyhole/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["secret"].(map[string]interface{})["cubbyhole/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["secret"].(map[string]interface{})["cubbyhole/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["secret"].(map[string]interface{})["cubbyhole/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["secret"].(map[string]interface{})["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret"].(map[string]interface{})["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -2344,11 +2344,11 @@ func TestSystemBackend_InternalUIMounts(t *testing.T) { "options": map[string]string(nil), }, "identity/": map[string]interface{}{ - "description": "identity store", - "type": "identity", + "description": "identity store", + "type": "identity", "external_entropy_access": false, - "accessor": resp.Data["secret"].(map[string]interface{})["identity/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["secret"].(map[string]interface{})["identity/"].(map[string]interface{})["uuid"], + "accessor": resp.Data["secret"].(map[string]interface{})["identity/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["secret"].(map[string]interface{})["identity/"].(map[string]interface{})["uuid"], "config": map[string]interface{}{ "default_lease_ttl": resp.Data["secret"].(map[string]interface{})["identity/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret"].(map[string]interface{})["identity/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), @@ -2368,13 +2368,13 @@ func TestSystemBackend_InternalUIMounts(t *testing.T) { "force_no_cache": false, "token_type": "default-service", }, - "type": "token", + "type": "token", "external_entropy_access": false, - "description": "token based credentials", - "accessor": resp.Data["auth"].(map[string]interface{})["token/"].(map[string]interface{})["accessor"], - "uuid": resp.Data["auth"].(map[string]interface{})["token/"].(map[string]interface{})["uuid"], - "local": false, - "seal_wrap": false, + "description": "token based credentials", + "accessor": resp.Data["auth"].(map[string]interface{})["token/"].(map[string]interface{})["accessor"], + "uuid": resp.Data["auth"].(map[string]interface{})["token/"].(map[string]interface{})["uuid"], + "local": false, + "seal_wrap": false, }, }, }