From f95571a36143d992cb6c1f92cb2da3629f2191ed Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 12 Apr 2019 18:26:54 -0400 Subject: [PATCH] Move ldaputil and tlsutil over to sdk --- builtin/credential/ldap/backend.go | 2 +- builtin/credential/ldap/path_config.go | 2 +- builtin/logical/cassandra/path_config_connection.go | 2 +- builtin/logical/cassandra/util.go | 2 +- helper/listenerutil/listener.go | 2 +- physical/consul/consul.go | 2 +- physical/zookeeper/zookeeper.go | 2 +- plugins/database/cassandra/connection_producer.go | 2 +- plugins/database/influxdb/connection_producer.go | 2 +- sdk/go.mod | 2 ++ sdk/go.sum | 4 ++++ {helper => sdk/helper}/ldaputil/client.go | 2 +- {helper => sdk/helper}/ldaputil/client_test.go | 0 {helper => sdk/helper}/ldaputil/config.go | 2 +- {helper => sdk/helper}/ldaputil/config_test.go | 0 {helper => sdk/helper}/ldaputil/connection.go | 0 {helper => sdk/helper}/ldaputil/ldap.go | 0 {helper => sdk/helper}/tlsutil/tlsutil.go | 0 {helper => sdk/helper}/tlsutil/tlsutil_test.go | 0 vault/core.go | 2 +- .../hashicorp/vault-plugin-secrets-ad/plugin/client/client.go | 2 +- .../hashicorp/vault-plugin-secrets-ad/plugin/client/config.go | 2 +- .../hashicorp/vault-plugin-secrets-ad/plugin/path_config.go | 2 +- 23 files changed, 21 insertions(+), 15 deletions(-) rename {helper => sdk/helper}/ldaputil/client.go (99%) rename {helper => sdk/helper}/ldaputil/client_test.go (100%) rename {helper => sdk/helper}/ldaputil/config.go (99%) rename {helper => sdk/helper}/ldaputil/config_test.go (100%) rename {helper => sdk/helper}/ldaputil/connection.go (100%) rename {helper => sdk/helper}/ldaputil/ldap.go (100%) rename {helper => sdk/helper}/tlsutil/tlsutil.go (100%) rename {helper => sdk/helper}/tlsutil/tlsutil_test.go (100%) diff --git a/builtin/credential/ldap/backend.go b/builtin/credential/ldap/backend.go index 72acbde4fe..cb4961cca7 100644 --- a/builtin/credential/ldap/backend.go +++ b/builtin/credential/ldap/backend.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/vault/helper/ldaputil" + "github.com/hashicorp/vault/sdk/helper/ldaputil" "github.com/hashicorp/vault/helper/mfa" "github.com/hashicorp/vault/sdk/helper/strutil" "github.com/hashicorp/vault/sdk/logical" diff --git a/builtin/credential/ldap/path_config.go b/builtin/credential/ldap/path_config.go index cc9c068e2c..8f1a9e8fd2 100644 --- a/builtin/credential/ldap/path_config.go +++ b/builtin/credential/ldap/path_config.go @@ -4,7 +4,7 @@ import ( "context" "github.com/hashicorp/vault/sdk/helper/consts" - "github.com/hashicorp/vault/helper/ldaputil" + "github.com/hashicorp/vault/sdk/helper/ldaputil" "github.com/hashicorp/vault/sdk/logical" "github.com/hashicorp/vault/sdk/framework" ) diff --git a/builtin/logical/cassandra/path_config_connection.go b/builtin/logical/cassandra/path_config_connection.go index 970c3d66c3..890efa074f 100644 --- a/builtin/logical/cassandra/path_config_connection.go +++ b/builtin/logical/cassandra/path_config_connection.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/vault/sdk/helper/certutil" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/sdk/logical" "github.com/hashicorp/vault/sdk/framework" ) diff --git a/builtin/logical/cassandra/util.go b/builtin/logical/cassandra/util.go index 3af2417cd6..80261e5da5 100644 --- a/builtin/logical/cassandra/util.go +++ b/builtin/logical/cassandra/util.go @@ -9,7 +9,7 @@ import ( "github.com/gocql/gocql" "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/certutil" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/sdk/logical" ) diff --git a/helper/listenerutil/listener.go b/helper/listenerutil/listener.go index b619e8467f..1539831179 100644 --- a/helper/listenerutil/listener.go +++ b/helper/listenerutil/listener.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/parseutil" "github.com/hashicorp/vault/helper/reload" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/jefferai/isbadcipher" "github.com/mitchellh/cli" ) diff --git a/physical/consul/consul.go b/physical/consul/consul.go index da56a1088c..3914aabcb1 100644 --- a/physical/consul/consul.go +++ b/physical/consul/consul.go @@ -30,7 +30,7 @@ import ( "github.com/hashicorp/vault/sdk/helper/consts" "github.com/hashicorp/vault/sdk/helper/parseutil" "github.com/hashicorp/vault/sdk/helper/strutil" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/sdk/physical" ) diff --git a/physical/zookeeper/zookeeper.go b/physical/zookeeper/zookeeper.go index adbdcd4af4..d94e7e0d3d 100644 --- a/physical/zookeeper/zookeeper.go +++ b/physical/zookeeper/zookeeper.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/vault/sdk/physical" metrics "github.com/armon/go-metrics" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/samuel/go-zookeeper/zk" ) diff --git a/plugins/database/cassandra/connection_producer.go b/plugins/database/cassandra/connection_producer.go index d434e8de49..79de83701d 100644 --- a/plugins/database/cassandra/connection_producer.go +++ b/plugins/database/cassandra/connection_producer.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/certutil" "github.com/hashicorp/vault/sdk/helper/parseutil" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/plugins/helper/database/connutil" "github.com/hashicorp/vault/plugins/helper/database/dbutil" ) diff --git a/plugins/database/influxdb/connection_producer.go b/plugins/database/influxdb/connection_producer.go index 87b48826fe..65b6523385 100644 --- a/plugins/database/influxdb/connection_producer.go +++ b/plugins/database/influxdb/connection_producer.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/certutil" "github.com/hashicorp/vault/sdk/helper/parseutil" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/plugins/helper/database/connutil" influx "github.com/influxdata/influxdb/client/v2" "github.com/mitchellh/mapstructure" diff --git a/sdk/go.mod b/sdk/go.mod index f3bfbc861a..8b7fe0783a 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -5,6 +5,7 @@ go 1.12 require ( github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 github.com/fatih/structs v1.1.0 + github.com/go-ldap/ldap v3.0.2+incompatible github.com/go-test/deep v1.0.1 github.com/gogo/protobuf v1.2.1 github.com/golang/protobuf v1.3.1 @@ -31,4 +32,5 @@ require ( golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db // indirect google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 // indirect google.golang.org/grpc v1.19.1 + gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect ) diff --git a/sdk/go.sum b/sdk/go.sum index 7bf7de508b..cf85ab4d95 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -12,6 +12,8 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/go-ldap/ldap v3.0.2+incompatible h1:kD5HQcAzlQ7yrhfn+h+MSABeAy/jAJhvIJ/QDllP44g= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= @@ -133,4 +135,6 @@ google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/helper/ldaputil/client.go b/sdk/helper/ldaputil/client.go similarity index 99% rename from helper/ldaputil/client.go rename to sdk/helper/ldaputil/client.go index f117c60606..70bcc230e2 100644 --- a/helper/ldaputil/client.go +++ b/sdk/helper/ldaputil/client.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/errwrap" hclog "github.com/hashicorp/go-hclog" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" ) type Client struct { diff --git a/helper/ldaputil/client_test.go b/sdk/helper/ldaputil/client_test.go similarity index 100% rename from helper/ldaputil/client_test.go rename to sdk/helper/ldaputil/client_test.go diff --git a/helper/ldaputil/config.go b/sdk/helper/ldaputil/config.go similarity index 99% rename from helper/ldaputil/config.go rename to sdk/helper/ldaputil/config.go index 7336532168..44db75e1b7 100644 --- a/helper/ldaputil/config.go +++ b/sdk/helper/ldaputil/config.go @@ -8,7 +8,7 @@ import ( "strings" "text/template" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/sdk/framework" "github.com/hashicorp/errwrap" diff --git a/helper/ldaputil/config_test.go b/sdk/helper/ldaputil/config_test.go similarity index 100% rename from helper/ldaputil/config_test.go rename to sdk/helper/ldaputil/config_test.go diff --git a/helper/ldaputil/connection.go b/sdk/helper/ldaputil/connection.go similarity index 100% rename from helper/ldaputil/connection.go rename to sdk/helper/ldaputil/connection.go diff --git a/helper/ldaputil/ldap.go b/sdk/helper/ldaputil/ldap.go similarity index 100% rename from helper/ldaputil/ldap.go rename to sdk/helper/ldaputil/ldap.go diff --git a/helper/tlsutil/tlsutil.go b/sdk/helper/tlsutil/tlsutil.go similarity index 100% rename from helper/tlsutil/tlsutil.go rename to sdk/helper/tlsutil/tlsutil.go diff --git a/helper/tlsutil/tlsutil_test.go b/sdk/helper/tlsutil/tlsutil_test.go similarity index 100% rename from helper/tlsutil/tlsutil_test.go rename to sdk/helper/tlsutil/tlsutil_test.go diff --git a/vault/core.go b/vault/core.go index f1d05715e8..fe0be12074 100644 --- a/vault/core.go +++ b/vault/core.go @@ -34,7 +34,7 @@ import ( "github.com/hashicorp/vault/sdk/helper/mlock" "github.com/hashicorp/vault/helper/namespace" "github.com/hashicorp/vault/helper/reload" - "github.com/hashicorp/vault/helper/tlsutil" + "github.com/hashicorp/vault/sdk/helper/tlsutil" "github.com/hashicorp/vault/sdk/logical" "github.com/hashicorp/vault/sdk/physical" "github.com/hashicorp/vault/shamir" diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/client.go b/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/client.go index 93fa4ded2a..6fd08390e6 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/client.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/client.go @@ -9,7 +9,7 @@ import ( "github.com/go-errors/errors" "github.com/go-ldap/ldap" "github.com/hashicorp/go-hclog" - "github.com/hashicorp/vault/helper/ldaputil" + "github.com/hashicorp/vault/sdk/helper/ldaputil" "golang.org/x/text/encoding/unicode" ) diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/config.go b/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/config.go index df26e99476..fe01e790b6 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/config.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/client/config.go @@ -3,7 +3,7 @@ package client import ( "time" - "github.com/hashicorp/vault/helper/ldaputil" + "github.com/hashicorp/vault/sdk/helper/ldaputil" ) type ADConf struct { diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/path_config.go b/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/path_config.go index d30bf6ab18..c19f387708 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/path_config.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-ad/plugin/path_config.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/vault-plugin-secrets-ad/plugin/client" "github.com/hashicorp/vault-plugin-secrets-ad/plugin/util" - "github.com/hashicorp/vault/helper/ldaputil" + "github.com/hashicorp/vault/sdk/helper/ldaputil" "github.com/hashicorp/vault/sdk/logical" "github.com/hashicorp/vault/sdk/framework" )