File tree 5 files changed +16
-19
lines changed
docker-entrypoint-initdb.d
5 files changed +16
-19
lines changed Original file line number Diff line number Diff line change 21
21
image : postgres:${{ matrix.postgres }}
22
22
env :
23
23
POSTGRES_PASSWORD : postgres
24
+ POSTGRES_INITDB_ARGS : --auth-host=md5
24
25
# Set health checks to wait until postgres has started
25
26
options : >-
26
27
--health-cmd pg_isready
34
35
fail-fast : false
35
36
matrix :
36
37
php : ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
37
- postgres : [12, 13]
38
+ postgres : [12, 13, 14, 15 ]
38
39
composer : [lowest, locked, highest]
39
40
needs :
40
41
- supported-versions-matrix
46
47
PGPASSWORD=postgres psql -h localhost -U postgres -c "ALTER ROLE pgasync PASSWORD 'pgasync'"
47
48
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE USER pgasyncpw"
48
49
PGPASSWORD=postgres psql -h localhost -U postgres -c "ALTER ROLE pgasyncpw PASSWORD 'example_password'"
50
+ PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE USER scram_user"
51
+ PGPASSWORD=postgres psql -h localhost -U postgres -c "SET password_encryption='scram-sha-256';ALTER ROLE scram_user PASSWORD 'scram_password'"
49
52
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE pgasync_test OWNER pgasync"
50
53
PGPASSWORD=pgasync psql -h localhost -U pgasync -f tests/test_db.sql pgasync_test
51
54
# PGPASSWORD=postgres cat tests/test_db.sql | xargs -I % psql -h localhost -U postgres -c "%"
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ services:
7
7
environment :
8
8
- PGDATA=/database
9
9
- POSTGRES_PASSWORD=some_password
10
+ - POSTGRES_INITDB_ARGS=--auth-host=md5
10
11
- TZ=America/New_York
11
12
volumes :
12
13
- .:/app
@@ -16,15 +17,7 @@ services:
16
17
ports :
17
18
- " 5432:5432"
18
19
19
- pgasync-postgres-15 :
20
- container_name : pgasync-postgres-15
21
- image : postgres:15
22
- environment :
23
- - PGDATA=/database
24
- - POSTGRES_USER=sampleuser
25
- - POSTGRES_PASSWORD=some_password
26
- - TZ=America/New_York
27
- volumes :
28
- - .:/app
29
- ports :
30
- - " 5415:5432"
20
+ configs :
21
+ pg_hba :
22
+ file : pg_hba_new.conf
23
+
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ echo "Running as $USER in $PWD"
5
5
6
6
createuser -U postgres --createdb pgasync
7
7
createuser -U postgres --createdb pgasyncpw
8
+ createuser -U postgres --createdb scram_user
8
9
psql -U postgres -c " ALTER ROLE pgasyncpw PASSWORD 'example_password'"
10
+ psql -U postgres -c " SET password_encryption='scram-sha-256'; ALTER ROLE scram_user PASSWORD 'scram_password'"
9
11
10
12
cd /app
11
13
cp pg_hba_new.conf database/pg_hba.conf
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public static function prependLengthInt32(string $s): string
23
23
return Message::int32 ($ len + 4 ) . $ s ;
24
24
}
25
25
26
- public static function createMessageFromIdentifier (string $ identifier , array $ dependencies ): ParserInterface
26
+ public static function createMessageFromIdentifier (string $ identifier , array $ dependencies = [] ): ParserInterface
27
27
{
28
28
switch ($ identifier ) {
29
29
case 'R ' :
Original file line number Diff line number Diff line change 8
8
9
9
class ScramSha256PasswordTest extends TestCase
10
10
{
11
- public function testScamSha256Login ()
11
+ public function testScramSha256Login ()
12
12
{
13
13
$ client = new Client ([
14
- "user " => 'sampleuser ' ,
15
- "database " => 'postgres ' ,
16
- "port " => 5415 ,
14
+ "user " => 'scram_user ' ,
15
+ "database " => $ this ->getDbName (),
17
16
"auto_disconnect " => true ,
18
- "password " => "some_password "
17
+ "password " => "scram_password "
19
18
], $ this ->getLoop ());
20
19
21
20
$ hello = null ;
You can’t perform that action at this time.
0 commit comments