File tree 8 files changed +494
-12
lines changed
8 files changed +494
-12
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,15 @@ jobs:
12
12
- image : cimg/rust:1.58.1
13
13
environment :
14
14
RUST_LOG : info
15
- - image : cimg/ postgres:14.0
16
- auth :
17
- username : mydockerhub-user
18
- password : $DOCKERHUB_PASSWORD
15
+ - image : postgres:14
16
+ # auth:
17
+ # username: mydockerhub-user
18
+ # password: $DOCKERHUB_PASSWORD
19
19
environment :
20
20
POSTGRES_USER : postgres
21
21
POSTGRES_DB : postgres
22
+ POSTGRES_PASSWORD : postgres
23
+ POSTGRES_HOST_AUTH_METHOD : scram-sha-256
22
24
# Add steps to the job
23
25
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
24
26
steps :
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function start_pgcat() {
12
12
}
13
13
14
14
# Setup the database with shards and user
15
- psql -e -h 127.0.0.1 -p 5432 -U postgres -f tests/sharding/query_routing_setup.sql
15
+ PGPASSWORD=postgres psql -e -h 127.0.0.1 -p 5432 -U postgres -f tests/sharding/query_routing_setup.sql
16
16
PGPASSWORD=sharding_user pgbench -h 127.0.0.1 -U sharding_user shard0 -i
17
17
PGPASSWORD=sharding_user pgbench -h 127.0.0.1 -U sharding_user shard1 -i
18
18
PGPASSWORD=sharding_user pgbench -h 127.0.0.1 -U sharding_user shard2 -i
@@ -72,7 +72,7 @@ psql -h 127.0.0.1 -p 6432 -d pgbouncer -c "SET client_encoding TO 'utf8'" > /dev
72
72
(! psql -e -h 127.0.0.1 -p 6432 -d random_db -c ' SHOW STATS' > /dev/null)
73
73
74
74
# Start PgCat in debug to demonstrate failover better
75
- start_pgcat " debug "
75
+ start_pgcat " trace "
76
76
77
77
# Add latency to the replica at port 5433 slightly above the healthcheck timeout
78
78
toxiproxy-cli toxic add -t latency -a latency=300 postgres_replica
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " pgcat"
3
- version = " 0.1 .0-beta2 "
3
+ version = " 0.2 .0-beta1 "
4
4
edition = " 2021"
5
5
6
6
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -25,3 +25,7 @@ log = "0.4"
25
25
arc-swap = " 1"
26
26
env_logger = " 0.9"
27
27
parking_lot = " 0.11"
28
+ hmac = " 0.12"
29
+ sha2 = " 0.10"
30
+ base64 = " 0.13"
31
+ stringprep = " 0.1"
Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ pub const CANCEL_REQUEST_CODE: i32 = 80877102;
14
14
// AuthenticationMD5Password
15
15
pub const MD5_ENCRYPTED_PASSWORD : i32 = 5 ;
16
16
17
+ // SASL
18
+ pub const SASL : i32 = 10 ;
19
+ pub const SASL_CONTINUE : i32 = 11 ;
20
+ pub const SASL_FINAL : i32 = 12 ;
21
+ pub const SCRAM_SHA_256 : & str = "SCRAM-SHA-256" ;
22
+ pub const NONCE_LENGTH : usize = 24 ;
23
+
17
24
// AuthenticationOk
18
25
pub const AUTHENTICATION_SUCCESSFUL : i32 = 0 ;
19
26
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ mod errors;
54
54
mod messages;
55
55
mod pool;
56
56
mod query_router;
57
+ mod scram;
57
58
mod server;
58
59
mod sharding;
59
60
mod stats;
You can’t perform that action at this time.
0 commit comments