Commit Graph

53 Commits

Author SHA1 Message Date
Andrey Borodin 3f50c152a2
Revert "Groups implementation (#609)" (#611)
This reverts commit 5f13f83697.
2024-05-07 18:55:52 +05:00
Andrey Borodin 5f13f83697
Groups implementation (#609) 2024-05-07 15:50:38 +05:00
NikitaUnisikhin 6519d71b84
fix (#603) 2024-04-25 13:43:59 +05:00
NikitaUnisikhin 34947dc019
add test and fix (#600) 2024-03-28 16:36:06 +01:00
NikitaUnisikhin bf05761979
fix (#596) 2024-03-18 19:40:25 +05:00
dependabot[bot] 9f33abca4f
Bump github.com/jackc/pgx/v4 in /docker/ody-integration-test (#591)
Bumps [github.com/jackc/pgx/v4](https://github.com/jackc/pgx) from 4.7.1 to 4.18.2.
- [Changelog](https://github.com/jackc/pgx/blob/v4.18.2/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v4.7.1...v4.18.2)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 17:34:16 +05:00
NikitaUnisikhin 7032f869f8
Copy test (#589)
* add copy test

* refactoring

* fix test

* fix entrypoint

* rebase master
2024-03-18 17:34:05 +05:00
NikitaUnisikhin 4f6aa1db1e
Gorm tests (#594)
* its work

* refactoring

* refactoring

* add test.sh

* refactoring, change docker-compose-test

* add logs

* fix?

* add gorm-test local

* fix

* refactoring

* add copy test

* refactoring

* fix test

* fix entrypoint

* rebase master

* its work

* refactoring

* refactoring

* add test.sh

* refactoring, change docker-compose-test

* add logs

* fix?

* add gorm-test local

* fix

* refactoring

* fix
2024-03-18 17:33:37 +05:00
NikitaUnisikhin b8b0651026
Proto tests (#595)
* add spqr proto tests

* fix
2024-03-18 16:54:25 +05:00
reshke ff5b656310
Sync relay extended proto messages in tx pool. (#586)
* Fix relay in tx pool + prep stmt try 2

* fmt

* fix
2024-03-05 13:29:11 +05:00
reshke 9d0de5d4e5
Request additional sync point on discard. (#584)
* Drop bin, add gitignore

* Request additional sync point on discard.

* Update sources/reset.c

Co-authored-by: Yury Frolov <57130330+EinKrebs@users.noreply.github.com>

---------

Co-authored-by: Yury Frolov <57130330+EinKrebs@users.noreply.github.com>
2024-03-04 13:39:59 +05:00
NikitaUnisikhin f60df91a54
Add addr pool in rule (#550) 2024-02-14 14:57:20 +03:00
Andrey Borodin cbdd76c522
Pool wait test (#548)
* Add pool wait test

* Fix

* Cleanup test conf

* Harder consts
2023-11-23 14:49:18 +04:00
NikitaUnisikhin 7420b6a7a4
test fix (#546)
* lagpolling fixed, there were problems with odySignalTestSet

* done

* fix testCount in cores test
2023-11-22 00:08:43 +05:00
NikitaUnisikhin 8dd494a8fc
OD sigterm race condition fix (#544) 2023-11-20 14:02:35 +05:00
NikitaUnisikhin 9a423940b9
Added config testing (odyssey --test) (#537)
* added configuration testing (odyssey --test)

* fixes

* fix names

* fix names

* apply fmt

* start create tests

* rebuild

* tests done

* --test no longer forks the process

* config without rules is no longer valid

* fix tests

* fix storage_type tests

* fix storage_tls tests

* fix config-examples/odyssey-aq.conf

* change .gitignore

* rm .DS_Store
2023-11-10 14:57:22 +05:00
reshke 1710d40246
Target session attr feature for storage (#456)
* Target session attr feature for storage


Storage host section is now accepts a comma-separated
PostgreSQL hosts list, in format "host2,host2"
or "[host1]:port1,host2" etc.

Storage structure now holds pointer to host, which connection was acquired.
This is required to cancel`s queries to work fine.

Target session attrs policies added:

    read-write
    read-only
    any (default)

Target session attrs uses pg_is_in_recovery function to
check if host in primary or replica. in_hot_standby option is not checked yet.
2022-08-18 17:15:13 +05:00
Ilya Maltsev ce3a777d2b
Access management to PostgreSQL with LDAP (#454)
This commit extends functionality of ldap authentication. It introduces LDAP server groups match feature, allowing r strict access between different users to different databases on same host.  Odyssey now will receive optional attributes from LDAP server while authenticating user and use them to acquire backend connection under proper role.
2022-08-13 13:55:13 +05:00
vadv f9a1ec21bc
Add HBA config file support, add hba reload logic. (#442)
Add HBA config file support, add hba reload logic.

Currently supported:

    local/host/hostssl/hostnossl
    IPv4/IPv6 address ranges
    rules reload on receiving SIGHUP
    simple tests

What to improve:

    default db/user
    @<file> support in db/user fields
    ? set auth method for each hba rule
    ? replace rw_lock with coroutine synchronization
    ? make parser kind of configurable


Authored-by: Alexander Belev <belyov97@gmail.com>
Co-authored-by: Dmitry Vasiliev <dmitrivasilyev@ozon.ru>
2022-07-04 15:01:34 +05:00
kirill reshke 4871445fea
Fix odyssey scram compile with PG15, also fix compile-time warns (#440)
* Fix odyssey scram compile with PG15

* fmt test script

* fix rules printing, set pool size to 85 in prep stmt test
2022-06-22 14:56:07 +03:00
kirill reshke fade74703a
Reserve prep stmt (#397)
* Add typedef to enum declaration

* preserve prepared statement basics

* murmur hash impl

* Hash set and hash map

* Hash set and hash map

* Allow relay to rewrite packets

* Fixes

* tmp

* Fmt

* Rebase fixes

* Min working version

* Fix heap buffer overflow

* Add show server_prep_smtms command to console db

* Store prep stmts by body hash

* Fix deadlock in console show prep stmts

* Better discard

* CLeanup code

* Support for multiple override msgs

* Remove rewrite logic

* Config validation

* Fixes

* Fmt

* Deploy rewrited msgs only on sync state

* Fix memoty issues allocaltion

* Smart discard

* Fix asan

* Handle fronent close prepered statement msg

* Fix memory leak

* Fixes

* Tests

* Fix tests

* fix tests

* remove bin

* fix clang compiler warns

* Reduse matrix to 1 case, because it doesnt change anything, as tests runs inside docker
2022-01-18 14:08:15 +05:00
kirill reshke 0287a17ba5
Config override client pg options (#399)
* Alter route cmd

* Read override options from cnf

* Tests and fixs

* fixes

* Fix memory leak
2022-01-10 10:31:04 +05:00
kirill reshke 6fa3f94b6e
Improve pgoptions parsing & add more tests (#393) 2021-12-27 13:42:14 +05:00
kirill reshke 419037c4ae
Remove usage of non-thread-save function (getopt) usage (#395)
* Remove usage of non-thread-save function (getopt) usage

* Fix fmt

* Fix include popt

* shell tests for pgoptions
2021-12-26 02:18:30 +05:00
kirill reshke 04d971df7b
Fix config validation for roles in local storage (#392) 2021-12-20 14:53:33 +05:00
Тимофей Шляпников d6e2c61087
Add roles in console DB (#371)
* Ldapless

* Ldapless

* Console are now considering roles

* For pull from origin

* Done, but not tested

* Works, but do not drop connections to console

* Update to origin

* Added drop connections with lowered role via reload

* Format and rename

* Fix makefile & dev.conf

* Fix makefile & dev.conf

* Fix lagpolling tests

* Fix tests

* Fix tests

* Add tests & fix .conf

* Add tests & fix .conf

* Add tests & fix .conf

Co-authored-by: tim-shlyap <tim-shlyap@yandex-team.ru>
2021-12-16 04:08:42 +05:00
kirill reshke 56057468c0
Add auth query basic tests & add test with restart for lag polling (#387)
* Add auth query basic tests

* Remove unused file ini.sql

* Refactor lag polling tests
2021-12-10 11:13:58 +05:00
kirill reshke 95fad60af2
Fix flacy test & func naming (#381) 2021-12-08 18:12:14 +05:00
kirill reshke ba6513323f
Add storage watchdog with standby lag polling support (#380)
* Move auth query server querying logic to separate file

* Refactor query code to support not only "auth_query" like queries

* Move storage logic to separate file & add storage watchdog

* Force several settings on starts

* Fix simple query parsing

* Fixed bugs

* Fix config reload

* Add tests

* Move cathcup logic to separate func

* Fix tests[2]

Co-authored-by: Andrey Borodin <amborodin@acm.org>
2021-12-08 15:54:43 +05:00
Andrey Borodin c9932b606b
Merge pull request #372 from reshke/master
Deb fixes for pgdg
2021-12-05 19:51:16 +03:00
kirill reshke 01f3c036b7
Update tls certs in test, regenerate them with 4096 bytes length, move test to docker (#374)
* Update tls certs in test, regenerate them with 4096 bytes length

* Fix compile errors

* Fix tests
2021-12-05 20:41:01 +05:00
reshke 63b981e8c0 Deb fixes for https://www.postgresql.org/message-id/flat/YOMyXyErQ50je0zh%40msg.df7cb.de#c997486f4403d814ff6d1967772e58eb 2021-12-03 21:52:33 +00:00
Pratik Balar 84f7ce6458 fix: lint and format sh, set xtrace where necessary...
- Ignore grep in grep
- trim spaces
2021-11-25 14:47:09 +05:30
3nprob a3d2e0f72f Rename cleint-server.go -> client-server.go 2021-11-14 17:03:51 +09:00
3nprob 3be43f3caa Rename ody-intergration-test -> ody-integration-test 2021-11-14 17:03:00 +09:00
kirill reshke 763862ac8c
fix tests and drop travis ci (#358)
* Fix test

* replace clang-format-9 with clang-format

* Drop travis
2021-11-12 16:54:50 +05:00
reshke a78664e7b7 Add password_passthrough option to route 2021-05-19 17:18:49 +05:00
Dmitry Ibragimov e40d3ad424
Fix default_user ldap auth for default user configuration (#313)
* Fix default_user ldap auth

* apply fmt

Co-authored-by: reshke <Kirill Reshke>
2021-05-04 21:13:20 +05:00
reshke dc44b323d1 return error if ldap connection establishment failed, rebind ldap
connection in case of server failture
2021-04-29 12:51:07 +05:00
reshke 74623edfb5 LDAP auth in od 2021-04-28 17:54:56 +05:00
kirill reshke ffebb6f855
dockerbuild fix (#289)
Co-authored-by: reshke <Kirill Reshke>
2021-03-05 17:40:23 +05:00
kirill reshke 173a0defe7
remove custom logic for sigterm (#286)
* remove custom logic for sigterm

* fmt

* add comment

Co-authored-by: reshke <Kirill Reshke>
2021-03-05 14:29:30 +05:00
Georgy Rylov 575f75d7cb
Add simple way to develop on Mac and refactor dockerfiles a little bit (#287) 2021-03-04 23:04:07 +05:00
kirill reshke f305546e9c
fix scram build & tests, also make makefile a little bit more clear && better (#259)
* fix scram build & tests, also make makefile a little bit more clear and parametrized

* fix fmt & fmt target better

* remove shell test from tests run

Co-authored-by: reshke <Kirill Reshke>
2021-01-12 12:06:27 +05:00
reshke a1f76ea5d6 Fix dockerfile to make CI ok 2020-12-07 22:48:54 +05:00
kirill reshke bc568250bf
odyssey tests with asan, little test refactor (#225)
* odyssey tests with asan

* better headers, rework test

Co-authored-by: reshke <Kirill Reshke>
2020-10-27 13:47:25 +05:00
kirill reshke a5f716025c
fix coveirty issues + remove legacy (#224)
* fix a couple of severity issues

* emove lagacy

* zero cost debug macros on release

* dbg macro fix

* apply fmt

Co-authored-by: reshke <Kirill Reshke>
2020-10-26 17:29:05 +05:00
reshke f030093484 use SO_REUSEPORT to graceful shutdown 2020-08-10 13:39:09 +05:00
Kazantcev Andrey 61267b578d
Update ubuntu image version (#177)
The old ubuntu version uses an old cmake which didn't support `add_compile_definitions`
2020-06-16 10:44:19 +05:00
Fumiyuki Kato 8cec9ef917
add PostgreSQL Apt Repository to Dockerfile (#136) 2020-03-17 09:52:40 +05:00