Skip to content

Commit 2e15264

Browse files
committed
fix errors and tests
1 parent 304f776 commit 2e15264

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

internal/pgbouncer/postgres_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ LANGUAGE SQL STABLE SECURITY DEFINER;`)
3434
func TestSQLAuthenticationQueryWithExposedSuperusers(t *testing.T) {
3535
assert.Equal(t, sqlAuthenticationQuery("some.fn_name", true),
3636
`CREATE OR REPLACE FUNCTION some.fn_name(username TEXT)
37-
RETURNS TABLE(username TEXT, password TEXT) AS '
37+
RETURNS TABLE(username TEXT, password TEXT) AS E'
3838
SELECT rolname::TEXT, rolpassword::TEXT
3939
FROM pg_catalog.pg_authid
4040
WHERE pg_authid.rolname = $1
4141
AND pg_authid.rolcanlogin
4242
AND (NOT pg_authid.rolreplication OR pg_authid.rolname = ''postgres'')
43-
AND pg_authid.rolname <> ''_crunchypgbouncer''
43+
AND pg_authid.rolname <> E''_crunchypgbouncer''
4444
AND (pg_authid.rolvaliduntil IS NULL OR pg_authid.rolvaliduntil >= CURRENT_TIMESTAMP)'
4545
LANGUAGE SQL STABLE SECURITY DEFINER;`)
4646
}
@@ -230,13 +230,13 @@ REVOKE ALL PRIVILEGES
230230
GRANT USAGE
231231
ON SCHEMA :"namespace" TO :"username";
232232
CREATE OR REPLACE FUNCTION :"namespace".get_auth(username TEXT)
233-
RETURNS TABLE(username TEXT, password TEXT) AS '
233+
RETURNS TABLE(username TEXT, password TEXT) AS E'
234234
SELECT rolname::TEXT, rolpassword::TEXT
235235
FROM pg_catalog.pg_authid
236236
WHERE pg_authid.rolname = $1
237237
AND pg_authid.rolcanlogin
238238
AND (NOT pg_authid.rolreplication OR pg_authid.rolname = ''postgres'')
239-
AND pg_authid.rolname <> ''_crunchypgbouncer''
239+
AND pg_authid.rolname <> E''_crunchypgbouncer''
240240
AND (pg_authid.rolvaliduntil IS NULL OR pg_authid.rolvaliduntil >= CURRENT_TIMESTAMP)'
241241
LANGUAGE SQL STABLE SECURITY DEFINER;
242242
REVOKE ALL PRIVILEGES

internal/pmm/hba.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
func PostgreSQLHBAs(inCluster *v1beta1.PostgresCluster, outHBAs *postgres.HBAs) {
1616
// Limit the monitoring user to local connections using SCRAM.
1717
outHBAs.Mandatory = append(outHBAs.Mandatory,
18-
*postgres.NewHBA().TCP().User(MonitoringUser).Method("scram-sha-256").Network("127.0.0.0/8"),
19-
*postgres.NewHBA().TCP().User(MonitoringUser).Method("scram-sha-256").Network("::1/128"),
20-
*postgres.NewHBA().TCP().User(MonitoringUser).Method("reject"))
18+
postgres.NewHBA().TCP().User(MonitoringUser).Method("scram-sha-256").Network("127.0.0.0/8"),
19+
postgres.NewHBA().TCP().User(MonitoringUser).Method("scram-sha-256").Network("::1/128"),
20+
postgres.NewHBA().TCP().User(MonitoringUser).Method("reject"))
2121
}

0 commit comments

Comments
 (0)