Skip to content
Snippets Groups Projects
Commit 5dc0fa4c authored by renovate's avatar renovate
Browse files

Update module lib/pq to v1.10.0

parent c0426878
No related branches found
No related tags found
1 merge request!11Update module lib/pq to v1.10.0
...@@ -190,6 +190,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= ...@@ -190,6 +190,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8= github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8=
github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E=
github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 h1:EnfXoSqDfSNJv0VBNqY/88RNnhSGYkrHaO0mmFGbVsc= github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 h1:EnfXoSqDfSNJv0VBNqY/88RNnhSGYkrHaO0mmFGbVsc=
......
...@@ -59,6 +59,9 @@ func ssl(o values) (func(net.Conn) (net.Conn, error), error) { ...@@ -59,6 +59,9 @@ func ssl(o values) (func(net.Conn) (net.Conn, error), error) {
return nil, err return nil, err
} }
// This pseudo-parameter is not recognized by the PostgreSQL server, so let's delete it after use.
delete(o, "sslinline")
// Accept renegotiation requests initiated by the backend. // Accept renegotiation requests initiated by the backend.
// //
// Renegotiation was deprecated then removed from PostgreSQL 9.5, but // Renegotiation was deprecated then removed from PostgreSQL 9.5, but
...@@ -83,6 +86,19 @@ func ssl(o values) (func(net.Conn) (net.Conn, error), error) { ...@@ -83,6 +86,19 @@ func ssl(o values) (func(net.Conn) (net.Conn, error), error) {
// in the user's home directory. The configured files must exist and have // in the user's home directory. The configured files must exist and have
// the correct permissions. // the correct permissions.
func sslClientCertificates(tlsConf *tls.Config, o values) error { func sslClientCertificates(tlsConf *tls.Config, o values) error {
sslinline := o["sslinline"]
if sslinline == "true" {
cert, err := tls.X509KeyPair([]byte(o["sslcert"]), []byte(o["sslkey"]))
// Clear out these params, in case they were to be sent to the PostgreSQL server by mistake
o["sslcert"] = ""
o["sslkey"] = ""
if err != nil {
return err
}
tlsConf.Certificates = []tls.Certificate{cert}
return nil
}
// user.Current() might fail when cross-compiling. We have to ignore the // user.Current() might fail when cross-compiling. We have to ignore the
// error and continue without home directory defaults, since we wouldn't // error and continue without home directory defaults, since we wouldn't
// know from where to load them. // know from where to load them.
...@@ -137,10 +153,20 @@ func sslCertificateAuthority(tlsConf *tls.Config, o values) error { ...@@ -137,10 +153,20 @@ func sslCertificateAuthority(tlsConf *tls.Config, o values) error {
if sslrootcert := o["sslrootcert"]; len(sslrootcert) > 0 { if sslrootcert := o["sslrootcert"]; len(sslrootcert) > 0 {
tlsConf.RootCAs = x509.NewCertPool() tlsConf.RootCAs = x509.NewCertPool()
cert, err := ioutil.ReadFile(sslrootcert) sslinline := o["sslinline"]
var cert []byte
if sslinline == "true" {
// // Clear out this param, in case it were to be sent to the PostgreSQL server by mistake
o["sslrootcert"] = ""
cert = []byte(sslrootcert)
} else {
var err error
cert, err = ioutil.ReadFile(sslrootcert)
if err != nil { if err != nil {
return err return err
} }
}
if !tlsConf.RootCAs.AppendCertsFromPEM(cert) { if !tlsConf.RootCAs.AppendCertsFromPEM(cert) {
return fmterrorf("couldn't parse pem in sslrootcert") return fmterrorf("couldn't parse pem in sslrootcert")
......
...@@ -40,10 +40,10 @@ func ParseURL(url string) (string, error) { ...@@ -40,10 +40,10 @@ func ParseURL(url string) (string, error) {
} }
var kvs []string var kvs []string
escaper := strings.NewReplacer(` `, `\ `, `'`, `\'`, `\`, `\\`) escaper := strings.NewReplacer(`'`, `\'`, `\`, `\\`)
accrue := func(k, v string) { accrue := func(k, v string) {
if v != "" { if v != "" {
kvs = append(kvs, k+"="+escaper.Replace(v)) kvs = append(kvs, k+"='"+escaper.Replace(v)+"'")
} }
} }
......
...@@ -45,7 +45,7 @@ github.com/golang/protobuf/ptypes/duration ...@@ -45,7 +45,7 @@ github.com/golang/protobuf/ptypes/duration
github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/ptypes/timestamp
# github.com/gorilla/handlers v1.5.1 # github.com/gorilla/handlers v1.5.1
github.com/gorilla/handlers github.com/gorilla/handlers
# github.com/lib/pq v1.9.0 # github.com/lib/pq v1.10.0
## explicit ## explicit
github.com/lib/pq github.com/lib/pq
github.com/lib/pq/oid github.com/lib/pq/oid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment