diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-01-15 17:55:18 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-01-15 17:58:05 +0100 |
commit | 761c79508e7fbc33c1b11754bdde4bd03ce9cbb3 (patch) | |
tree | 5b76973b71b307fbdc2cd3989edee4dd44e56064 /src/interfaces/libpq/libpq-int.h | |
parent | b6463ea6ef3e46b32be96a23f3a9f47357847ce4 (diff) | |
download | postgresql-761c79508e7fbc33c1b11754bdde4bd03ce9cbb3.tar.gz postgresql-761c79508e7fbc33c1b11754bdde4bd03ce9cbb3.zip |
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 <mths.dev@pm.me>
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/27b29a35-9b96-46a9-bc1a-914140869dac@gmail.com
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 4a5a7c8b5e3..031b93c535b 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -428,6 +428,8 @@ struct pg_conn char *target_session_attrs; /* desired session properties */ char *require_auth; /* name of the expected auth method */ char *load_balance_hosts; /* load balance over hosts */ + char *scram_client_key; /* base64-encoded SCRAM client key */ + char *scram_server_key; /* base64-encoded SCRAM server key */ bool cancelRequest; /* true if this connection is used to send a * cancel request, instead of being a normal @@ -518,6 +520,10 @@ struct pg_conn AddrInfo *addr; /* the array of addresses for the currently * tried host */ bool send_appname; /* okay to send application_name? */ + size_t scram_client_key_len; + void *scram_client_key_binary; /* binary SCRAM client key */ + size_t scram_server_key_len; + void *scram_server_key_binary; /* binary SCRAM server key */ /* Miscellaneous stuff */ int be_pid; /* PID of backend --- needed for cancels */ |