File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1919* Unix socket support
2020* Notifications: ` LISTEN ` /` NOTIFY `
2121* pgpass support
22-
23- ## Optional Features
24-
25- * GSS (Kerberos) auth (to use, see GoDoc)
22+ * GSS (Kerberos) auth
2623
2724## Tests
2825
Original file line number Diff line number Diff line change @@ -1074,9 +1074,9 @@ func isDriverSetting(key string) bool {
10741074 return true
10751075 case "binary_parameters" :
10761076 return true
1077- case "service " :
1077+ case "krbsrvname " :
10781078 return true
1079- case "spn " :
1079+ case "krbspn " :
10801080 return true
10811081 default :
10821082 return false
@@ -1168,13 +1168,13 @@ func (cn *conn) auth(r *readBuf, o values) {
11681168
11691169 var token []byte
11701170
1171- if spn , ok := o ["spn " ]; ok {
1171+ if spn , ok := o ["krbspn " ]; ok {
11721172 // Use the supplied SPN if provided..
11731173 token , err = cli .GetInitTokenFromSpn (spn )
11741174 } else {
11751175 // Allow the kerberos service name to be overridden
11761176 service := "postgres"
1177- if val , ok := o ["service " ]; ok {
1177+ if val , ok := o ["krbsrvname " ]; ok {
11781178 service = val
11791179 }
11801180
Original file line number Diff line number Diff line change @@ -57,8 +57,6 @@ supported:
5757 * sslkey - Key file location. The file must contain PEM encoded data.
5858 * sslrootcert - The location of the root certificate file. The file
5959 must contain PEM encoded data.
60- * spn - Configures GSS (Kerberos) SPN.
61- * service - GSS (Kerberos) service name to use when constructing the SPN (default is `postgres`).
6260
6361Valid values for sslmode are:
6462
@@ -259,5 +257,12 @@ package:
259257This package is in a separate module so that users who don't need Kerberos
260258don't have to download unnecessary dependencies.
261259
260+ When imported, additional connection string parameters are supported:
261+
262+ * krbsrvname - GSS (Kerberos) service name when constructing the
263+ SPN (default is `postgres`). This will be combined with the host
264+ to form the full SPN: `krbsrvname/host`.
265+ * krbspn - GSS (Kerberos) SPN. This takes priority over
266+ `krbsrvname` if present.
262267*/
263268package pq
You can’t perform that action at this time.
0 commit comments