Skip to content

Commit

Permalink
fix: allows encryption with specified key
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Oct 22, 2024
1 parent 9e27ab0 commit 4350ac9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/security/encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import (

// Encrypt encrypts a string.
func (c Crypto) Encrypt(plainText string) (string, error) {
block, err := aes.NewCipher([]byte(c.EncryptionKey))
return c.EncryptWithKey(plainText, c.EncryptionKey)
}

// Encrypt encrypts a string with provided key.
func (c Crypto) EncryptWithKey(plainText string, key string) (string, error) {

Check failure on line 17 in pkg/security/encrypt.go

View workflow job for this annotation

GitHub Actions / runner / golangci-lint

[golangci] reported by reviewdog 🐶 File is not `gofumpt`-ed with `-extra` (gofumpt) Raw Output: pkg/security/encrypt.go:17: File is not `gofumpt`-ed with `-extra` (gofumpt) func (c Crypto) EncryptWithKey(plainText string, key string) (string, error) {
block, err := aes.NewCipher([]byte(key))
if err != nil {
return "", err
}
Expand Down

0 comments on commit 4350ac9

Please sign in to comment.