Skip to content

Commit ff11ce4

Browse files
committed
Remove handling of HBA role/group membership
We don't use it, and how to quote/escape it has been underspecified for years.
1 parent 9018342 commit ff11ce4

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

internal/postgres/hba.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ func (hba *HostBasedAuthentication) Replication() *HostBasedAuthentication {
116116
return hba
117117
}
118118

119-
// Role makes hba match connections by users that are members of a specific role.
120-
func (hba *HostBasedAuthentication) Role(name string) *HostBasedAuthentication {
121-
hba.user = "+" + hba.quote(name)
122-
return hba
123-
}
124-
125119
// SameNetwork makes hba match connection attempts from IP addresses in any
126120
// subnet to which the server is directly connected.
127121
func (hba *HostBasedAuthentication) SameNetwork() *HostBasedAuthentication {

internal/postgres/hba_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ func TestHostBasedAuthentication(t *testing.T) {
5252
User("KD6-3.7").Method("scram-sha-256").
5353
String())
5454

55-
assert.Equal(t, `hostssl "data" +"admin" all md5 clientcert="verify-ca"`,
56-
NewHBA().TLS().Database("data").Role("admin").
55+
assert.Equal(t, `hostssl "data" all all md5 clientcert="verify-ca"`,
56+
NewHBA().TLS().Database("data").
5757
Method("md5").Options(map[string]string{"clientcert": "verify-ca"}).
5858
String())
5959

0 commit comments

Comments
 (0)