Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/gitsshsigning/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func writeSignatureToFile(signature []byte, bufferFile string) error {
sigFile := bufferFile + ".sig"
// #nosec G306 -- TODO Consider using a more secure permission setting and ownership if needed.
if err := os.WriteFile(sigFile, signature, 0o644); err != nil {
log.Errorf("Failed to write signature to file: %v", err)
log.Errorf("failed to write signature to file: %v", err)
return err
}
return nil
Expand Down Expand Up @@ -127,7 +127,7 @@ func sendSignatureRequest(requestBody []byte) ([]byte, error) {
bytes.NewReader(requestBody),
)
if err != nil {
log.Errorf("Error retrieving git ssh signature: %v", err)
log.Errorf("error retrieving git ssh signature: %v", err)
return nil, err
}
defer func() { _ = response.Body.Close() }()
Expand All @@ -151,7 +151,7 @@ func sendSignatureRequest(requestBody []byte) ([]byte, error) {
func parseSignatureResponse(responseBody []byte) ([]byte, error) {
signatureResponse := &GitSSHSignatureResponse{}
if err := json.Unmarshal(responseBody, signatureResponse); err != nil {
log.Errorf("Error decoding git ssh signature: %v", err)
log.Errorf("error decoding git ssh signature: %v", err)
return nil, fmt.Errorf(
"error decoding signature response (body: %s): %w",
string(responseBody),
Expand Down
10 changes: 5 additions & 5 deletions pkg/gitsshsigning/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ var GitConfigTemplate = `
// - users this script as gpg.ssh.program
// This is needed since git expects `gpg.ssh.program` to be an executable.
func ConfigureHelper(userName, gitSigningKey string) error {
log.Debug("Creating helper script")
log.Debug("creating helper script")
if err := createHelperScript(); err != nil {
return err
}
log.Debugf("Helper script created. Making it executable.")
log.Debugf("helper script created. making it executable.")
if err := makeScriptExecutable(); err != nil {
return err
}
log.Debugf("Script executable. Getting config path.")
log.Debugf("script executable. getting config path.")
gitConfigPath, err := getGitConfigPath(userName)
if err != nil {
return err
}
log.Debugf("Got config path: %v", gitConfigPath)
log.Debugf("got config path: %v", gitConfigPath)
if err := updateGitConfig(gitConfigPath, userName, gitSigningKey); err != nil {
log.Errorf("Failed updating git configuration: %v", err)
log.Errorf("failed updating git configuration: %v", err)
return err
}

Expand Down
Loading