2
0

Improve testing / contributing instructions

* Extract CONTRIBUTING.md
* Add instructions and scripts to setup standalone PostgreSQL server
  that tests the various connection and authentication types.
This commit is contained in:
Jack Christensen
2022-10-29 17:14:09 -05:00
parent 1ec3816a20
commit 55b5067ddd
9 changed files with 158 additions and 51 deletions
+3
View File
@@ -0,0 +1,3 @@
# Test Setup
This directory contains miscellaneous files used to setup a test database.
+13
View File
@@ -0,0 +1,13 @@
[ req ]
default_bits = 2048
distinguished_name = dn
req_extensions = v3_req
prompt = no
[ dn ]
commonName = localhost
[ v3_req ]
subjectAltName = @alt_names
keyUsage = digitalSignature
extendedKeyUsage = serverAuth
[alt_names]
DNS.1 = localhost
+6
View File
@@ -0,0 +1,6 @@
local all postgres trust
local all all trust
host all pgx_md5 127.0.0.1/32 md5
host all pgx_scram 127.0.0.1/32 scram-sha-256
host all pgx_pw 127.0.0.1/32 password
hostssl all pgx_ssl 127.0.0.1/32 scram-sha-256
+15
View File
@@ -0,0 +1,15 @@
-- Create extensions and types.
create extension hstore;
create domain uint64 as numeric(20,0);
-- Create users for different types of connections and authentication.
create user pgx_ssl PASSWORD 'secret';
set password_encryption = md5;
create user pgx_md5 PASSWORD 'secret';
set password_encryption = 'scram-sha-256';
create user pgx_pw PASSWORD 'secret';
create user pgx_scram PASSWORD 'secret';
-- The tricky test user, below, has to actually exist so that it can be used in a test
-- of aclitem formatting. It turns out aclitems cannot contain non-existing users/roles.
create user " tricky, ' } "" \\ test user " superuser password 'secret';
+4
View File
@@ -0,0 +1,4 @@
ssl = on
ssl_cert_file = 'server.crt'
ssl_key_file = 'server.key'
ssl_ca_file = 'root.crt'