diff --git a/go.mod b/go.mod index f10a14f5f..5a6dad0d7 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( github.com/hashicorp/vault-plugin-secrets-gcpkms v0.5.2-0.20190814210149-315cdbf5de6e github.com/hashicorp/vault-plugin-secrets-kv v0.5.2-0.20190814210155-e060c2a001a8 github.com/hashicorp/vault/api v1.0.5-0.20190904164530-82f8309ab640 - github.com/hashicorp/vault/sdk v0.1.14-0.20190904164450-29f2490f986b + github.com/hashicorp/vault/sdk v0.1.14-0.20190917153655-ea21a2a1bf3f github.com/influxdata/influxdb v0.0.0-20190411212539-d24b7ba8c4c4 github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect github.com/jackc/pgx v3.3.0+incompatible // indirect @@ -91,7 +91,6 @@ require ( github.com/joyent/triton-go v0.0.0-20190112182421-51ffac552869 github.com/keybase/go-crypto v0.0.0-20190403132359-d65b6b94177f github.com/kr/pretty v0.1.0 - github.com/kr/pty v1.1.3 // indirect github.com/kr/text v0.1.0 github.com/lib/pq v1.2.0 github.com/mattn/go-colorable v0.1.2 diff --git a/go.sum b/go.sum index dd1be4f43..62b14cd48 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,6 @@ github.com/hashicorp/raft v1.0.1/go.mod h1:DVSAWItjLjTOkVbSpWQ0j0kUADIvDaCtBxIcb github.com/hashicorp/raft v1.1.1 h1:HJr7UE1x/JrJSc9Oy6aDBHtNHUUBHjcQjTgvUVihoZs= github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= -github.com/hashicorp/raft-snapshot v1.0.1 h1:cx002JsTEAfAP0pIuANlDtTXg/pi2Db6YbRRmLQTQKw= -github.com/hashicorp/raft-snapshot v1.0.1/go.mod h1:5sL9eUn72lH5DzsFIJ9jaysITbHksSSszImWSOTC8Ic= github.com/hashicorp/raft-snapshot v1.0.2-0.20190827162939-8117efcc5aab h1:WzGMwlO1DvaC93SvVOBOKtn+nXGEDXapyJuaRV3/VaY= github.com/hashicorp/raft-snapshot v1.0.2-0.20190827162939-8117efcc5aab/go.mod h1:5sL9eUn72lH5DzsFIJ9jaysITbHksSSszImWSOTC8Ic= github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= diff --git a/vendor/github.com/hashicorp/raft-snapshot/snapshot.go b/vendor/github.com/hashicorp/raft-snapshot/snapshot.go index 571ca8a7e..0c3ce7393 100644 --- a/vendor/github.com/hashicorp/raft-snapshot/snapshot.go +++ b/vendor/github.com/hashicorp/raft-snapshot/snapshot.go @@ -23,6 +23,17 @@ type Snapshot struct { index uint64 } +// Size returns the file size of the snapshot archive. +func (s *Snapshot) Size() (int64, error) { + info, err := s.file.Stat() + if err != nil { + return 0, err + } + + return info.Size(), nil +} + +// Sealer is used to seal and open the SHASUM file inside the archive. type Sealer interface { Seal(context.Context, []byte) ([]byte, error) Open(context.Context, []byte) ([]byte, error) diff --git a/vendor/github.com/hashicorp/vault/api/client.go b/vendor/github.com/hashicorp/vault/api/client.go index fb50f2073..7abc7e006 100644 --- a/vendor/github.com/hashicorp/vault/api/client.go +++ b/vendor/github.com/hashicorp/vault/api/client.go @@ -140,8 +140,8 @@ func DefaultConfig() *Config { config := &Config{ Address: "https://127.0.0.1:8200", HttpClient: cleanhttp.DefaultPooledClient(), + Timeout: time.Second * 60, } - config.HttpClient.Timeout = time.Second * 60 transport := config.HttpClient.Transport.(*http.Transport) transport.TLSHandshakeTimeout = 10 * time.Second diff --git a/vendor/github.com/hashicorp/vault/sdk/logical/request.go b/vendor/github.com/hashicorp/vault/sdk/logical/request.go index 98d56cec8..7e7de2073 100644 --- a/vendor/github.com/hashicorp/vault/sdk/logical/request.go +++ b/vendor/github.com/hashicorp/vault/sdk/logical/request.go @@ -2,7 +2,7 @@ package logical import ( "fmt" - "io" + "net/http" "strings" "time" ) @@ -173,9 +173,9 @@ type Request struct { // we can delete it before sending off to plugins ClientTokenSource ClientTokenSource - // RequestReader if set can be used to read the full request body from the - // http request that generated this logical.Request object. - RequestReader io.ReadCloser `json:"-" sentinel:""` + // HTTPRequest, if set, can be used to access fields from the HTTP request + // that generated this logical.Request object, such as the request body. + HTTPRequest *http.Request `json:"-" sentinel:""` // ResponseWriter if set can be used to stream a response value to the http // request that generated this logical.Request object. diff --git a/vendor/github.com/hashicorp/vault/sdk/logical/response.go b/vendor/github.com/hashicorp/vault/sdk/logical/response.go index ecc208f96..fb799ba4b 100644 --- a/vendor/github.com/hashicorp/vault/sdk/logical/response.go +++ b/vendor/github.com/hashicorp/vault/sdk/logical/response.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "fmt" - "io" + "net/http" "sync/atomic" "github.com/hashicorp/vault/sdk/helper/wrapping" @@ -187,16 +187,16 @@ func RespondWithStatusCode(resp *Response, req *Request, code int) (*Response, e // HTTPResponseWriter is optionally added to a request object and can be used to // write directly to the HTTP response writter. type HTTPResponseWriter struct { - writer io.Writer + http.ResponseWriter written *uint32 } // NewHTTPResponseWriter creates a new HTTPRepoinseWriter object that wraps the // provided io.Writer. -func NewHTTPResponseWriter(w io.Writer) *HTTPResponseWriter { +func NewHTTPResponseWriter(w http.ResponseWriter) *HTTPResponseWriter { return &HTTPResponseWriter{ - writer: w, - written: new(uint32), + ResponseWriter: w, + written: new(uint32), } } @@ -204,7 +204,7 @@ func NewHTTPResponseWriter(w io.Writer) *HTTPResponseWriter { func (rw *HTTPResponseWriter) Write(bytes []byte) (int, error) { atomic.StoreUint32(rw.written, 1) - return rw.writer.Write(bytes) + return rw.ResponseWriter.Write(bytes) } // Written tells us if the writer has been written to yet. diff --git a/vendor/github.com/hashicorp/vault/sdk/version/version_base.go b/vendor/github.com/hashicorp/vault/sdk/version/version_base.go index 2aa7e7d7f..446a51a5d 100644 --- a/vendor/github.com/hashicorp/vault/sdk/version/version_base.go +++ b/vendor/github.com/hashicorp/vault/sdk/version/version_base.go @@ -8,7 +8,7 @@ var ( // Whether cgo is enabled or not; set at build time CgoEnabled bool - Version = "1.2.2" - VersionPrerelease = "" + Version = "1.3.0" + VersionPrerelease = "dev" VersionMetadata = "" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index c038e7389..91cfc6ef3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -327,7 +327,7 @@ github.com/hashicorp/nomad/api github.com/hashicorp/nomad/api/contexts # github.com/hashicorp/raft v1.1.1 github.com/hashicorp/raft -# github.com/hashicorp/raft-snapshot v1.0.1 +# github.com/hashicorp/raft-snapshot v1.0.2-0.20190827162939-8117efcc5aab github.com/hashicorp/raft-snapshot # github.com/hashicorp/serf v0.8.2 github.com/hashicorp/serf/coordinate @@ -375,7 +375,7 @@ github.com/hashicorp/vault-plugin-secrets-gcpkms github.com/hashicorp/vault-plugin-secrets-kv # github.com/hashicorp/vault/api v1.0.5-0.20190904164530-82f8309ab640 => ./api github.com/hashicorp/vault/api -# github.com/hashicorp/vault/sdk v0.1.14-0.20190904164450-29f2490f986b => ./sdk +# github.com/hashicorp/vault/sdk v0.1.14-0.20190917153655-ea21a2a1bf3f => ./sdk github.com/hashicorp/vault/sdk/helper/salt github.com/hashicorp/vault/sdk/helper/strutil github.com/hashicorp/vault/sdk/helper/wrapping