Commit Graph

324 Commits (90ef5bba3fff4eaa6e8d2faf20489bb907876b8b)

Author SHA1 Message Date
Oliver Tan 90ef5bba3f add GSSAPI authentication
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (https://github.com/lib/pq/issues/971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
2022-04-15 08:17:48 -05:00
Matthew Gabeler-Lee 5982e4b4f8 fix detection of database does not exist error during connect 2022-04-09 07:47:59 -05:00
Jack Christensen b7a85d1a6f Consider any "0A000" error a possible cached plan changed error
https://github.com/jackc/pgx/issues/1162
2022-03-05 08:23:58 -06:00
William Storey ded272b1f2 Remove documentation line stating only one IP is used
With `expandWithIPs()` (added in #14), we try all IPs.
2022-02-19 08:10:07 -06:00
William Storey ccb96b8aca Fix typos in comments 2022-02-19 08:10:07 -06:00
Jack Christensen 34bf0a5df9 Upgrade golang.org/x/text to v0.3.7
https://github.com/jackc/pgconn/issues/103
2022-02-19 08:00:51 -06:00
Jack Christensen 3e5de44314 Release v1.11.0 2022-02-07 10:54:39 -06:00
Jack Christensen 05d532b5df Fix connect when receiving NoticeResponse
refs #102
2022-01-20 16:41:47 -06:00
Oscar 109c4c2d95 fix standby mode validation 2021-12-28 09:31:38 -06:00
Oscar 3aaf3409ce remove redundant map value type 2021-12-28 09:31:38 -06:00
Oscar 3ce8a835e1 add support for read-only, primary, standby, prefer-standby target_session_attributes 2021-12-28 09:31:38 -06:00
Blake Embrey a1852214fe Keep status connecting after tls 2021-12-27 14:28:33 -06:00
Blake Embrey b148a14bbe Fix defer usage 2021-12-27 14:28:33 -06:00
Blake Embrey 01a6923376 Rename fn to new 2021-12-27 14:28:33 -06:00
Blake Embrey 024de4c8f3 Unwatch and re-watch tls 2021-12-27 14:28:33 -06:00
Blake Embrey c0a0be876d Fix TLS connection timeout 2021-12-27 14:28:33 -06:00
James Hartig 5a5260b73d feat: support port in ip from LookupFunc to override config
Fixes #97
2021-12-18 08:16:31 -06:00
Jack Christensen 662ecb496f Release v1.10.1 2021-11-20 09:56:46 -06:00
Jack Christensen 146268e829 Move context test above bad statement cleanup 2021-11-13 04:12:35 -06:00
Georges Varouchas cd7dcd5802 have lru.Get() always check if context is already expired 2021-11-13 04:10:45 -06:00
Georges Varouchas 141f132ae7 add a unit test on LRU context check
TestLRUContext highlights the lack of context check when querying for a cached value
2021-11-13 04:10:45 -06:00
Jack Christensen 162dc65eff Make ContextWatcher concurrency safe
fixes #94
2021-11-06 08:57:49 -05:00
Rueian 290ee79d1e feat: remove unnecessary pending for CopyInResponse 2021-10-02 07:36:21 -05:00
Kei Kamikawa 3bee0c6398 removed lines to read conn 2021-08-28 08:52:37 -05:00
Jack Christensen 53f5fed36c Release v1.10.0 2021-07-24 10:52:26 -05:00
Jack Christensen d89c8390a5 Update dependencies and go mod tidy 2021-07-24 10:25:38 -05:00
Jack Christensen 6996e8d6c5 Context errors returned instead of net.Error
The net.Error caused by using SetDeadline to implement context
cancellation shouldn't leak.

fixes #80
2021-07-24 09:09:22 -05:00
Jack Christensen 13d454882b Release v1.9.0 2021-07-10 09:54:39 -05:00
Jack Christensen 5b7c6a3c8e Upgrade to pgproto3 v2.1.1 2021-07-10 09:54:24 -05:00
Michael Darr a50d96d491 Make timeout error private
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Michael Darr 9a9830c00d Always double-wrap contextAlreadyDoneError
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Michael Darr b3e64d3cdb Simplify SafeToRetry for ErrTimeout
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Michael Darr c0b4d3bc05 Implement timeout error
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-07 18:14:36 -05:00
Joshua Brindle a123e5b4e5 Add defaults for sslcert, sslkey, and sslrootcert
per https://www.postgresql.org/docs/current/libpq-ssl.html
psql will use client certs located in ~/.postgresql on posix systems
or %APPDATA%\postgresql on Windows systems.
2021-06-26 11:25:41 -05:00
mgoddard bf76d1ed51 Solve issue with 'sslmode=verify-full' when there are multiple hosts 2021-06-19 10:14:17 -05:00
Sivabalan Thirunavukkarasu bacf81fb4e Bumping versions for other dependencies 2021-06-19 10:06:47 -05:00
Sivabalan Thirunavukkarasu cfcd61d0cb Updating dependency versions 2021-06-19 10:06:47 -05:00
Jack Christensen fb42201c18 Fix default host when parsing URL without host but with port
fixes https://github.com/jackc/pgconn/issues/72
2021-05-14 18:39:31 -05:00
Jack Christensen 3f76b98073 Allow dbname query parameter in URL conn string
fixes #69
2021-04-09 18:20:06 -05:00
Jack Christensen 464a7d88d9 Release v1.8.1 2021-03-25 09:15:45 -04:00
Jack Christensen cdb667b5b0 Update copyright date 2021-03-25 09:15:45 -04:00
Ethan Pailes e8f75629d0 upgrade x/crypto to avoid CVE-2020-9283
I found this when scanning for security issues in some
dependencies. I doubt that this CVE will impact pgconn
since I don't think it uses the ssh cropto module, but
I think it is worth being fairly agressive about upgrading
security sensative libraries and this doesn't seem to be
a breaking change.
2021-03-23 07:44:35 -05:00
Andrey Borodin 8990c125cf Stop fallback on ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION 2021-03-12 08:31:29 -06:00
Andrey Borodin b6027e37f4 Stop fallback in case of invalid password 2021-03-12 08:31:29 -06:00
Andrey Borodin 70be4b4a02 Fix incoherent type assignment 2021-03-12 08:31:29 -06:00
Andrey Borodin 26ccb4ee08 Resume fallback on server error
When server responds with "TLS required" or too "many connections for role" fallbacks are not traversed any further. This could be OK, but fallbacks without TLS are added autoatically so that if we have multiple hosts requiring TLS we never traverse beyond first one.
2021-03-12 08:31:29 -06:00
Jack Christensen 5daa019e4e Update README.md to authentication test setup 2021-03-06 16:08:38 -06:00
Jack Christensen 0d307bcc5e Add CockroachDB to CI 2021-03-06 16:06:32 -06:00
Jack Christensen 1e905d8e38 Refactor connection strings into build matrix
This is in preparation for adding CockroachDB to the build matrix.
2021-03-06 15:20:03 -06:00
Jack Christensen 7de3392269 Manually specify all build matrix options
- Saves some CI time by only testing older version of Go once
- Specify connection
2021-03-06 15:15:03 -06:00