Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gssencmode option to connection string for PgSQL & PDO PgSQL driver #6320

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ pdo_pgsql / pgsql
- ``sslcrl`` (string): specifies the filename of the SSL certificate
revocation list (CRL).
See `https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNECT-SSLCRL`
- ``gssencmode`` (string): Optional GSS-encrypted channel/GSSEncMode configuration.
See `https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE`
- ``application_name`` (string): Name of the application that is
connecting to database. Optional. It will be displayed at ``pg_stat_activity``.

Expand Down
4 changes: 4 additions & 0 deletions src/Driver/PDO/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
$dsn .= 'application_name=' . $params['application_name'] . ';';
}

if (isset($params['gssencmode'])) {
$dsn .= 'gssencmode=' . $params['gssencmode'] . ';';

Check warning on line 130 in src/Driver/PDO/PgSQL/Driver.php

View check run for this annotation

Codecov / codecov/patch

src/Driver/PDO/PgSQL/Driver.php#L130

Added line #L130 was not covered by tests
}

return $dsn;
}
}
1 change: 1 addition & 0 deletions src/Driver/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ private function constructConnectionString(
'user' => $params['user'] ?? null,
'password' => $params['password'] ?? null,
'sslmode' => $params['sslmode'] ?? null,
'gssencmode' => $params['gssencmode'] ?? null,
],
static fn ($value) => $value !== '' && $value !== null,
);
Expand Down
Loading