Skip to content

Commit

Permalink
fix: trim newlines from files reading by secrets
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Nov 2, 2024
1 parent ea55dbf commit 972bf98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/config/secret.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"bytes"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -41,6 +42,8 @@ func (secret *Secret) UnmarshalText(text []byte) error {
return fmt.Errorf("unable read secret %s: %w", filePath, err)
}

body = bytes.TrimSpace(body)

*secret = Secret(body)
default:
*secret = Secret(stringText)
Expand Down

0 comments on commit 972bf98

Please sign in to comment.