From f491851ed1741c27be3c4d32d9d50830487f9d46 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 15 Apr 2019 12:14:20 -0400 Subject: [PATCH] Move some things around in api/sdk --- api/go.sum | 10 ++++- .../plugin_helpers.go} | 37 +++++++++++++++---- sdk/{ => database}/dbplugin/client.go | 0 sdk/{ => database}/dbplugin/database.pb.go | 9 +++-- sdk/{ => database}/dbplugin/database.proto | 2 +- .../dbplugin/databasemiddleware.go | 0 sdk/{ => database}/dbplugin/grpc_transport.go | 0 sdk/{ => database}/dbplugin/plugin.go | 33 ++++++++++++++++- sdk/{ => database}/dbplugin/server.go | 0 .../helper/connutil/connutil.go | 0 .../helper/connutil/sql.go | 2 +- .../helper/credsutil/credsutil.go | 2 +- .../helper/credsutil/credsutil_test.go | 0 .../helper/credsutil/sql.go | 2 +- .../helper/dbutil/dbutil.go | 2 +- .../helper/dbutil/dbutil_test.go | 2 +- sdk/go.mod | 2 +- sdk/go.sum | 4 +- 18 files changed, 85 insertions(+), 22 deletions(-) rename api/{plugin_tls.go => plugins/plugin_helpers.go} (82%) rename sdk/{ => database}/dbplugin/client.go (100%) rename sdk/{ => database}/dbplugin/database.pb.go (99%) rename sdk/{ => database}/dbplugin/database.proto (96%) rename sdk/{ => database}/dbplugin/databasemiddleware.go (100%) rename sdk/{ => database}/dbplugin/grpc_transport.go (100%) rename sdk/{ => database}/dbplugin/plugin.go (69%) rename sdk/{ => database}/dbplugin/server.go (100%) rename sdk/{dbplugin => database}/helper/connutil/connutil.go (100%) rename sdk/{dbplugin => database}/helper/connutil/sql.go (98%) rename sdk/{dbplugin => database}/helper/credsutil/credsutil.go (95%) rename sdk/{dbplugin => database}/helper/credsutil/credsutil_test.go (100%) rename sdk/{dbplugin => database}/helper/credsutil/sql.go (97%) rename sdk/{dbplugin => database}/helper/dbutil/dbutil.go (96%) rename sdk/{dbplugin => database}/helper/dbutil/dbutil_test.go (97%) diff --git a/api/go.sum b/api/go.sum index 7baf42804..dd8eaf304 100644 --- a/api/go.sum +++ b/api/go.sum @@ -1,5 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -28,6 +30,7 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0 h1:z3ollgGRg8RjfJH6UVBaG54R70GFd++QOkvnJH3VSBY= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -45,9 +48,11 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -68,6 +73,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -88,7 +95,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -102,6 +108,7 @@ golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e h1:nFYrTHrdrAOpShe27kaFHjsqYSEQ0KWqdWLu3xuZJts= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -113,6 +120,7 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= diff --git a/api/plugin_tls.go b/api/plugins/plugin_helpers.go similarity index 82% rename from api/plugin_tls.go rename to api/plugins/plugin_helpers.go index b312f6ff8..2123d3673 100644 --- a/api/plugin_tls.go +++ b/api/plugins/plugin_helpers.go @@ -6,17 +6,18 @@ import ( "encoding/base64" "errors" "flag" + "fmt" "net/url" "os" squarejwt "gopkg.in/square/go-jose.v2/jwt" "github.com/hashicorp/errwrap" + "github.com/hashicorp/vault/api" + "github.com/hashicorp/vault/sdk/database/dbplugin" "github.com/hashicorp/vault/sdk/helper/pluginutil" ) -var () - // APIClientMeta is a helper that plugins can use to configure TLS connections // back to Vault. type APIClientMeta struct { @@ -42,10 +43,10 @@ func (f *APIClientMeta) FlagSet() *flag.FlagSet { } // GetTLSConfig will return a TLSConfig based off the values from the flags -func (f *APIClientMeta) GetTLSConfig() *TLSConfig { +func (f *APIClientMeta) GetTLSConfig() *api.TLSConfig { // If we need custom TLS configuration, then set it if f.flagCACert != "" || f.flagCAPath != "" || f.flagClientCert != "" || f.flagClientKey != "" || f.flagInsecure { - t := &TLSConfig{ + t := &api.TLSConfig{ CACert: f.flagCACert, CAPath: f.flagCAPath, ClientCert: f.flagClientCert, @@ -62,7 +63,7 @@ func (f *APIClientMeta) GetTLSConfig() *TLSConfig { // VaultPluginTLSProvider is run inside a plugin and retrieves the response // wrapped TLS certificate from vault. It returns a configured TLS Config. -func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error) { +func VaultPluginTLSProvider(apiTLSConfig *api.TLSConfig) func() (*tls.Config, error) { if os.Getenv(pluginutil.PluginMetadataModeEnv) == "true" { return nil } @@ -98,7 +99,7 @@ func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error) } // Unwrap the token - clientConf := DefaultConfig() + clientConf := api.DefaultConfig() clientConf.Address = vaultAddr if apiTLSConfig != nil { err := clientConf.ConfigureTLS(apiTLSConfig) @@ -106,7 +107,7 @@ func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error) return nil, errwrap.Wrapf("error configuring api client {{err}}", err) } } - client, err := NewClient(clientConf) + client, err := api.NewClient(clientConf) if err != nil { return nil, errwrap.Wrapf("error during api client creation: {{err}}", err) } @@ -177,3 +178,25 @@ func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error) return tlsConfig, nil } } + +// ServeDBPlugin is used to start a database plugin's RPC server. It takes an +// interface that must implement a known plugin interface to vault and an +// optional api.TLSConfig for use during the initial unwrap request to vault. +// The api config is particularly useful when vault is setup to require client +// cert checking. It's in the API package to avoid SDK depending on API. +func ServeDBPlugin(plugin interface{}, tlsConfig *api.TLSConfig) { + tlsProvider := VaultPluginTLSProvider(tlsConfig) + + err := pluginutil.OptionallyEnableMlock() + if err != nil { + fmt.Println(err) + return + } + + switch p := plugin.(type) { + case dbplugin.Database: + dbplugin.Serve(p, tlsProvider) + default: + fmt.Println("Unsupported plugin type") + } +} diff --git a/sdk/dbplugin/client.go b/sdk/database/dbplugin/client.go similarity index 100% rename from sdk/dbplugin/client.go rename to sdk/database/dbplugin/client.go diff --git a/sdk/dbplugin/database.pb.go b/sdk/database/dbplugin/database.pb.go similarity index 99% rename from sdk/dbplugin/database.pb.go rename to sdk/database/dbplugin/database.pb.go index de664b925..3b3f27419 100644 --- a/sdk/dbplugin/database.pb.go +++ b/sdk/database/dbplugin/database.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: sdk/dbplugin/database.proto +// source: sdk/database/dbplugin/database.proto package dbplugin import ( context "context" fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" timestamp "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -677,7 +678,7 @@ func init() { proto.RegisterType((*Empty)(nil), "dbplugin.Empty") } -func init() { proto.RegisterFile("sdk/dbplugin/database.proto", fileDescriptor_02295ede278ca775) } +func init() { proto.RegisterFile("sdk/database/dbplugin/database.proto", fileDescriptor_02295ede278ca775) } var fileDescriptor_02295ede278ca775 = []byte{ // 713 bytes of a gzipped FileDescriptorProto @@ -1058,5 +1059,5 @@ var _Database_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "sdk/dbplugin/database.proto", + Metadata: "sdk/database/dbplugin/database.proto", } diff --git a/sdk/dbplugin/database.proto b/sdk/database/dbplugin/database.proto similarity index 96% rename from sdk/dbplugin/database.proto rename to sdk/database/dbplugin/database.proto index 2edf2e42f..c3f4831b0 100644 --- a/sdk/dbplugin/database.proto +++ b/sdk/database/dbplugin/database.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/hashicorp/vault/sdk/dbplugin"; +option go_package = "github.com/hashicorp/vault/sdk/database/dbplugin"; package dbplugin; diff --git a/sdk/dbplugin/databasemiddleware.go b/sdk/database/dbplugin/databasemiddleware.go similarity index 100% rename from sdk/dbplugin/databasemiddleware.go rename to sdk/database/dbplugin/databasemiddleware.go diff --git a/sdk/dbplugin/grpc_transport.go b/sdk/database/dbplugin/grpc_transport.go similarity index 100% rename from sdk/dbplugin/grpc_transport.go rename to sdk/database/dbplugin/grpc_transport.go diff --git a/sdk/dbplugin/plugin.go b/sdk/database/dbplugin/plugin.go similarity index 69% rename from sdk/dbplugin/plugin.go rename to sdk/database/dbplugin/plugin.go index 7868f690a..6d248d15a 100644 --- a/sdk/dbplugin/plugin.go +++ b/sdk/database/dbplugin/plugin.go @@ -16,17 +16,48 @@ import ( // Database is the interface that all database objects must implement. type Database interface { + // Type returns the TypeName for the particular database backend + // implementation. This type name is usually set as a constant within the + // database backend implementation, e.g. "mysql" for the MySQL database + // backend. Type() (string, error) + + // CreateUser is called on `$ vault read database/creds/:role-name` and it's + // also the first time anything is touched from `$ vault write + // database/roles/:role-name`. This is likely to be the highest-throughput + // method for most plugins. CreateUser(ctx context.Context, statements Statements, usernameConfig UsernameConfig, expiration time.Time) (username string, password string, err error) + + // RenewUser is triggered by a renewal call to the API. In many database + // backends, this triggers a call on the underlying database that extends a + // VALID UNTIL clause on a user. However, if no such need exists, setting + // this as a NO-OP means that when renewal is called, the lease renewal time + // is pushed further out as appropriate, thus pushing out the time until the + // RevokeUser method is called. RenewUser(ctx context.Context, statements Statements, username string, expiration time.Time) error + + // RevokeUser is triggered either automatically by a lease expiration, or by + // a revocation call to the API. RevokeUser(ctx context.Context, statements Statements, username string) error + // RotateRootCredentials is triggered by a root credential rotation call to + // the API. RotateRootCredentials(ctx context.Context, statements []string) (config map[string]interface{}, err error) + // Init is called on `$ vault write database/config/:db-name`, or when you + // do a creds call after Vault's been restarted. The config provided won't + // hold all the keys and values provided in the API call, some will be + // stripped by the database engine before the config is provided. The config + // returned will be stored, which will persist it across shutdowns. Init(ctx context.Context, config map[string]interface{}, verifyConnection bool) (saveConfig map[string]interface{}, err error) + + // Close attempts to close the underlying database connection that was + // established by the backend. Close() error - // DEPRECATED, will be removed in a future plugin version bump. + // DEPRECATED: Will be removed in a future plugin version bump. + // Initialize is a backwards-compatible implementation that simply calls + // Init, dropping the saveConfig, and returning the err. Initialize(ctx context.Context, config map[string]interface{}, verifyConnection bool) (err error) } diff --git a/sdk/dbplugin/server.go b/sdk/database/dbplugin/server.go similarity index 100% rename from sdk/dbplugin/server.go rename to sdk/database/dbplugin/server.go diff --git a/sdk/dbplugin/helper/connutil/connutil.go b/sdk/database/helper/connutil/connutil.go similarity index 100% rename from sdk/dbplugin/helper/connutil/connutil.go rename to sdk/database/helper/connutil/connutil.go diff --git a/sdk/dbplugin/helper/connutil/sql.go b/sdk/database/helper/connutil/sql.go similarity index 98% rename from sdk/dbplugin/helper/connutil/sql.go rename to sdk/database/helper/connutil/sql.go index 74e34370c..44917e0d5 100644 --- a/sdk/dbplugin/helper/connutil/sql.go +++ b/sdk/database/helper/connutil/sql.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/errwrap" - "github.com/hashicorp/vault/sdk/dbplugin/helper/dbutil" + "github.com/hashicorp/vault/sdk/database/helper/dbutil" "github.com/hashicorp/vault/sdk/helper/parseutil" "github.com/mitchellh/mapstructure" ) diff --git a/sdk/dbplugin/helper/credsutil/credsutil.go b/sdk/database/helper/credsutil/credsutil.go similarity index 95% rename from sdk/dbplugin/helper/credsutil/credsutil.go rename to sdk/database/helper/credsutil/credsutil.go index 5b2bfdb96..9871deba8 100644 --- a/sdk/dbplugin/helper/credsutil/credsutil.go +++ b/sdk/database/helper/credsutil/credsutil.go @@ -5,7 +5,7 @@ import ( "fmt" - "github.com/hashicorp/vault/sdk/dbplugin" + "github.com/hashicorp/vault/sdk/database/dbplugin" "github.com/hashicorp/vault/sdk/helper/base62" ) diff --git a/sdk/dbplugin/helper/credsutil/credsutil_test.go b/sdk/database/helper/credsutil/credsutil_test.go similarity index 100% rename from sdk/dbplugin/helper/credsutil/credsutil_test.go rename to sdk/database/helper/credsutil/credsutil_test.go diff --git a/sdk/dbplugin/helper/credsutil/sql.go b/sdk/database/helper/credsutil/sql.go similarity index 97% rename from sdk/dbplugin/helper/credsutil/sql.go rename to sdk/database/helper/credsutil/sql.go index 435b83bed..01dd834b6 100644 --- a/sdk/dbplugin/helper/credsutil/sql.go +++ b/sdk/database/helper/credsutil/sql.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/hashicorp/vault/sdk/dbplugin" + "github.com/hashicorp/vault/sdk/database/dbplugin" ) const ( diff --git a/sdk/dbplugin/helper/dbutil/dbutil.go b/sdk/database/helper/dbutil/dbutil.go similarity index 96% rename from sdk/dbplugin/helper/dbutil/dbutil.go rename to sdk/database/helper/dbutil/dbutil.go index 183abe57c..725338112 100644 --- a/sdk/dbplugin/helper/dbutil/dbutil.go +++ b/sdk/database/helper/dbutil/dbutil.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/vault/sdk/dbplugin" + "github.com/hashicorp/vault/sdk/database/dbplugin" ) var ( diff --git a/sdk/dbplugin/helper/dbutil/dbutil_test.go b/sdk/database/helper/dbutil/dbutil_test.go similarity index 97% rename from sdk/dbplugin/helper/dbutil/dbutil_test.go rename to sdk/database/helper/dbutil/dbutil_test.go index 27c9cde60..ba4827926 100644 --- a/sdk/dbplugin/helper/dbutil/dbutil_test.go +++ b/sdk/database/helper/dbutil/dbutil_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/hashicorp/vault/sdk/dbplugin" + "github.com/hashicorp/vault/sdk/database/dbplugin" ) func TestStatementCompatibilityHelper(t *testing.T) { diff --git a/sdk/go.mod b/sdk/go.mod index 5aaedb71e..833702659 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -29,7 +29,7 @@ require ( github.com/pierrec/lz4 v2.0.5+incompatible github.com/ryanuber/go-glob v1.0.0 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect + golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 // indirect golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db // indirect google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 // indirect diff --git a/sdk/go.sum b/sdk/go.sum index a4c7d8698..6eebaa323 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -102,8 +102,8 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=