-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c6b8f4
commit f60df91
Showing
31 changed files
with
823 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,4 @@ PGPASSWORD=passwd psql -h localhost -p 6432 -U auth_query_user_md5 -c "SELECT 1" | |
exit 1 | ||
} | ||
|
||
|
||
ody-stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
listen { | ||
host "*" | ||
port 6432 | ||
} | ||
|
||
storage "postgres_server" { | ||
type "remote" | ||
host "127.0.0.1" | ||
port 5432 | ||
} | ||
|
||
database "addr_db" { | ||
user "user_addr_correct" "127.0.0.0/24" { | ||
authentication "clear_text" | ||
password "correct_password" | ||
storage "postgres_server" | ||
pool "session" | ||
} | ||
|
||
user "user_addr_incorrect" "255.0.0.0/24" { | ||
authentication "clear_text" | ||
password "correct_password" | ||
storage "postgres_server" | ||
pool "session" | ||
} | ||
|
||
user "user_addr_default" default { | ||
authentication "clear_text" | ||
password "correct_password" | ||
storage "postgres_server" | ||
pool "session" | ||
} | ||
|
||
user "user_addr_empty" { | ||
authentication "clear_text" | ||
password "correct_password" | ||
storage "postgres_server" | ||
pool "session" | ||
} | ||
|
||
user "user_addr_hostname_localhost" "localhost" { | ||
authentication "clear_text" | ||
password "correct_password" | ||
storage "postgres_server" | ||
pool "session" | ||
} | ||
} | ||
|
||
daemonize yes | ||
pid_file "/var/run/odyssey.pid" | ||
|
||
unix_socket_dir "/tmp" | ||
unix_socket_mode "0644" | ||
|
||
locks_dir "/tmp" | ||
|
||
log_format "%p %t %l [%i %s] (%c) %m\n" | ||
log_file "/var/log/odyssey.log" | ||
log_to_stdout no | ||
log_config yes | ||
log_debug yes | ||
log_session yes | ||
log_stats no | ||
log_query yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash -x | ||
|
||
set -ex | ||
|
||
/usr/bin/odyssey /rule-address/addr.conf | ||
|
||
PGPASSWORD=correct_password psql -h localhost -p 6432 -U user_addr_correct -c "SELECT 1" addr_db > /dev/null 2>&1 || { | ||
echo "ERROR: failed auth with correct addr, correct password and plain password in config" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=incorrect_password psql -h localhost -p 6432 -U user_addr_correct -c "SELECT 1" addr_db > /dev/null 2>&1 && { | ||
echo "ERROR: successfully auth with correct addr, but incorrect password" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=correct_password psql -h localhost -p 6432 -U user_addr_incorrect -c "SELECT 1" addr_db > /dev/null 2>&1 && { | ||
echo "ERROR: successfully auth with incorrect addr" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=correct_password psql -h localhost -p 6432 -U user_addr_default -c "SELECT 1" addr_db > /dev/null 2>&1 || { | ||
echo "ERROR: failed auth with correct addr, correct password and plain password in config" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=incorrect_password psql -h localhost -p 6432 -U user_addr_default -c "SELECT 1" addr_db > /dev/null 2>&1 && { | ||
echo "ERROR: successfully auth with correct addr, but incorrect password" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=correct_password psql -h localhost -p 6432 -U user_addr_empty -c "SELECT 1" addr_db > /dev/null 2>&1 || { | ||
echo "ERROR: failed auth with correct addr, correct password and plain password in config" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=incorrect_password psql -h localhost -p 6432 -U user_addr_empty -c "SELECT 1" addr_db > /dev/null 2>&1 && { | ||
echo "ERROR: successfully auth with correct addr, but incorrect password" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=correct_password psql -h localhost -p 6432 -U user_addr_hostname_localhost -c "SELECT 1" addr_db > /dev/null 2>&1 || { | ||
echo "ERROR: failed auth with correct addr, correct password and plain password in config" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
PGPASSWORD=incorrect_password psql -h localhost -p 6432 -U user_addr_hostname_localhost -c "SELECT 1" addr_db > /dev/null 2>&1 && { | ||
echo "ERROR: successfully auth with correct addr, but incorrect password" | ||
|
||
cat /var/log/odyssey.log | ||
|
||
exit 1 | ||
} | ||
|
||
ody-stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ set(od_src | |
storage.c | ||
murmurhash.c | ||
hashmap.c | ||
address.c | ||
hba.c | ||
hba_reader.c | ||
hba_rule.c | ||
|
Oops, something went wrong.