{"id":32490198,"url":"https://github.com/dvob/pg_dummy_validator","last_synced_at":"2026-02-23T08:34:11.871Z","repository":{"id":319571626,"uuid":"1074490566","full_name":"dvob/pg_dummy_validator","owner":"dvob","description":"Postgres OAuth Dummy Validator Module","archived":false,"fork":false,"pushed_at":"2025-10-11T22:28:30.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-19T14:57:55.241Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-11T22:24:21.000Z","updated_at":"2025-10-12T10:32:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5d7607c-dbb7-43e2-96b0-1c7a1fd4016c","html_url":"https://github.com/dvob/pg_dummy_validator","commit_stats":null,"previous_names":["dvob/pg_dummy_validator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dvob/pg_dummy_validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fpg_dummy_validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fpg_dummy_validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fpg_dummy_validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fpg_dummy_validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvob","download_url":"https://codeload.github.com/dvob/pg_dummy_validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fpg_dummy_validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29740024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-27T08:55:08.193Z","updated_at":"2026-02-23T08:34:11.807Z","avatar_url":"https://github.com/dvob.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL Dummy OAuth Validator Module\n\nThis repo contains a OAuth validator module to test and play around with the new OAuth feature in PostgreSQL 18.\nA OAuth validator module is the shared library which performs the actual verification of the OAuth token. As a result it returns the authenticated user/role.\nThis dummy validator doesn't validate anything at all and authenticats all tokens. It returns the value of the token as user to PostgreSQL (e.g. if a client sends token `myapp` it will be authenticated as user/role `myapp`).\n\nSee:\n- PostgreSQL OAuth Client Authentication: https://www.postgresql.org/docs/18/auth-oauth.html\n- Implementation of OAuth Validator Modules: https://www.postgresql.org/docs/current/oauth-validators.html\n\nDrivers:\n- Go pgx: https://github.com/jackc/pgx/pull/2400\n\n# Build\n## Local\nTo build it you need a Postgres installation with header files (e.g. packge `postgresql-server-dev-18`). Alternatively you can build Postgres yourself (see below).\n```\nmake\nmake install\n```\n## Docker\n```\nmake docker-build\n```\n\n# Test\nRun a test server.\n## Local\nPrepare cluster directory:\n```\ninitdb -D mytest\ncat \u003c\u003cEOF \u003emytest/pg_hba.conf\nlocal   all             all                                     trust\nhost    all    all    all    oauth    validator=dummy_validator issuer=https://example.com scope=\nEOF\n\ncat \u003c\u003cEOF \u003e\u003emytest/postgresql.conf\noauth_validator_libraries = 'dummy_validator'\nEOF\n```\n\nMake sure dummy_validator.so is installed (`make install`).\n\nRun:\n```\npg_ctl -D mytest -l mytest.log start\n```\n\nCreate user and database:\n```\npsql postgres \u003c\u003cEOF\nCREATE USER app;\nCREATE DATABASE app OWNER app;\nEOF\n```\n\n## Docker\n```\nmake docker-run\n```\n\n# Test Client\nWith patched [pgx](https://github.com/dvob/pq/tree/pg18-oauth) client:\n```golang\n\tconfig, err := pgconn.ParseConfig(\"host=localhost port=5432 user=app dbname=app sslmode=disable\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig.OAuthTokenProvider = func(ctx context.Context) (string, error) {\n        // you can change this value to a role which does not exist, then the authentication will fail\n\t\treturn \"app\", nil\n\t}\n\n\tconn, err := pgconn.ConnectConfig(context.Background(), config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer conn.Close(context.Background())\n\n\tresult := conn.ExecParams(context.Background(), \"SELECT CURRENT_USER\", nil, nil, nil, nil)\n\tfor result.NextRow() {\n\t\tt.Log(string(result.Values()[0]))\n\t}\n\t_, err = result.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n```\n\n# Build PostgreSQL\n```\nmkdir -p $HOME/pg/pg18\ngit clone git@github.com:postgres/postgres.git\ncd postgres/\ngit checkout REL_18_0\n./configure --prefix=$HOME/pg/pg18 #--with-openssl --with-libcurl\nmake\nmake install\n```\n\n```\nexport PATH=$PATH:$HOME/pg/pg18/bin\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvob%2Fpg_dummy_validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvob%2Fpg_dummy_validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvob%2Fpg_dummy_validator/lists"}