security: hardening по результатам аудита безопасности
This commit is contained in:
@@ -134,7 +134,6 @@ func setBackupFlags(
|
||||
_ = cmd.Flags().Set("pg-host", "localhost")
|
||||
_ = cmd.Flags().Set("pg-port", "5432")
|
||||
_ = cmd.Flags().Set("pg-user", "testuser")
|
||||
_ = cmd.Flags().Set("pg-password", "testpass")
|
||||
_ = cmd.Flags().Set("pg-database", "testdb")
|
||||
}
|
||||
|
||||
@@ -162,6 +161,7 @@ func TestBackupCmd_Structure(t *testing.T) {
|
||||
|
||||
func TestBackupCmd_Success(t *testing.T) {
|
||||
restoreGlobals(t)
|
||||
t.Setenv("APP_PG_PASSWORD", "testpass")
|
||||
|
||||
backupDir := t.TempDir()
|
||||
pqPath := filepath.Join(backupDir, "pq.pub")
|
||||
@@ -240,7 +240,7 @@ func TestBackupCmd_Success(t *testing.T) {
|
||||
|
||||
key := dumper.receivedOpts.Key
|
||||
matched, _ := regexp.MatchString(
|
||||
`^synapse-\d{8}-\d{6}\.dump\.pqenc$`,
|
||||
`^synapse-\d{8}-\d{6}-[a-f0-9]{6}\.dump\.pqenc$`,
|
||||
key,
|
||||
)
|
||||
if !matched {
|
||||
@@ -300,6 +300,7 @@ func TestBackupCmd_Success(t *testing.T) {
|
||||
|
||||
func TestBackupCmd_PgDumpFailure(t *testing.T) {
|
||||
restoreGlobals(t)
|
||||
t.Setenv("APP_PG_PASSWORD", "testpass")
|
||||
|
||||
backupDir := t.TempDir()
|
||||
pqPath := filepath.Join(backupDir, "pq.pub")
|
||||
|
||||
Reference in New Issue
Block a user