Skip to content

Commit 95c833b

Browse files
FIX (backups): Fix passing encypted password to .pgpass
1 parent 878fad5 commit 95c833b

File tree

3 files changed

+341
-186
lines changed

3 files changed

+341
-186
lines changed

backend/internal/features/backups/backups/usecases/postgresql/create_backup_uc.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ func (uc *CreatePostgresqlBackupUsecase) Execute(
8181

8282
args := uc.buildPgDumpArgs(pg)
8383

84+
decryptedPassword, err := uc.fieldEncryptor.Decrypt(db.ID, pg.Password)
85+
if err != nil {
86+
return nil, fmt.Errorf("failed to decrypt database password: %w", err)
87+
}
88+
8489
return uc.streamToStorage(
8590
ctx,
8691
backupID,
@@ -92,7 +97,7 @@ func (uc *CreatePostgresqlBackupUsecase) Execute(
9297
config.GetEnv().PostgresesInstallDir,
9398
),
9499
args,
95-
pg.Password,
100+
decryptedPassword,
96101
storage,
97102
db,
98103
backupProgressListener,

0 commit comments

Comments
 (0)