Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Attempting reverting client config to password
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrichlake committed Sep 12, 2024
1 parent 5e01d29 commit 35ccd0e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/sftp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,18 @@ func NewSftpHandler(credentialGetter secrets.CredentialGetter) (*SftpHandler, er
return nil, err
}

sftpPasswordSecret := "sftp-password-" + utils.EnvironmentName() // pragma: allowlist secret
sftpPassword, err := credentialGetter.GetSecret(sftpPasswordSecret)
if err != nil {
slog.Error("Unable to get SFTP password secret", slog.String("KeyName", sftpPasswordSecret), slog.Any(utils.ErrorKey, err))
return nil, err
}

config := &ssh.ClientConfig{
User: sftpUser,
Auth: []ssh.AuthMethod{
ssh.PublicKeys(pem),
//ssh.PublicKeys(pem),
ssh.Password(sftpPassword),
},
HostKeyCallback: hostKeyCallback,
}
Expand Down

0 comments on commit 35ccd0e

Please sign in to comment.