configurePgHBA writes a pg_hba.conf that allows trust auth initially (for setting the password), then we switch to md5.
(hbaPath string)
| 506 | // configurePgHBA writes a pg_hba.conf that allows trust auth initially (for |
| 507 | // setting the password), then we switch to md5. |
| 508 | func configurePgHBA(hbaPath string) error { |
| 509 | content := `# pg_hba.conf - generated by sqlc-test-setup |
| 510 | # TYPE DATABASE USER ADDRESS METHOD |
| 511 | local all all trust |
| 512 | host all all 127.0.0.1/32 trust |
| 513 | host all all ::1/128 trust |
| 514 | ` |
| 515 | return os.WriteFile(hbaPath, []byte(content), 0o600) |
| 516 | } |
| 517 | |
| 518 | // configurePgHBAWithMD5 rewrites pg_hba.conf to use md5 for TCP connections. |
| 519 | func configurePgHBAWithMD5(hbaPath string) error { |