postgres_fdw: SCRAM authentication pass-through
authorPeter Eisentraut <[email protected]>
Wed, 15 Jan 2025 16:55:18 +0000 (17:55 +0100)
committerPeter Eisentraut <[email protected]>
Wed, 15 Jan 2025 16:58:05 +0000 (17:58 +0100)
commit761c79508e7fbc33c1b11754bdde4bd03ce9cbb3
tree5b76973b71b307fbdc2cd3989edee4dd44e56064
parentb6463ea6ef3e46b32be96a23f3a9f47357847ce4
postgres_fdw: SCRAM authentication pass-through

This enables SCRAM authentication for postgres_fdw when connecting to
a foreign server without having to store a plain-text password on user
mapping options.

This is done by saving the SCRAM ClientKey and ServeryKey from the
client authentication and using those instead of the plain-text
password for the server-side SCRAM exchange.  The new foreign-server
or user-mapping option "use_scram_passthrough" enables this.

Co-authored-by: Matheus Alcantara <[email protected]>
Co-authored-by: Peter Eisentraut <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/27b29a35-9b96-46a9-bc1a-914140869dac@gmail.com
14 files changed:
contrib/postgres_fdw/Makefile
contrib/postgres_fdw/connection.c
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/meson.build
contrib/postgres_fdw/option.c
contrib/postgres_fdw/t/001_auth_scram.pl [new file with mode: 0644]
doc/src/sgml/libpq.sgml
doc/src/sgml/postgres-fdw.sgml
src/backend/libpq/auth-scram.c
src/include/libpq/libpq-be.h
src/interfaces/libpq/fe-auth-scram.c
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/libpq-int.h