-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable encryption in regular builds
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build encrypted | ||
// +build encrypted | ||
|
||
package utils | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//go:build !encrypted | ||
// +build !encrypted | ||
|
||
package utils | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
) | ||
|
||
// GetEncryptionKeys returns list of encryption keys from ENCRYPTION_KEYS env variable name or default value | ||
func GetEncryptionKeys() ([]string, error) { | ||
return nil, fmt.Errorf("encryption not supported") | ||
} | ||
|
||
// IsEncrypted returns true if cfg encrypted with age tool (https://github.com/FiloSottile/age) | ||
func IsEncrypted(cfg []byte) bool { | ||
return bytes.Contains(cfg, []byte(`age-encryption`)) | ||
} | ||
|
||
// Decrypt decrypts config using EncryptionKeys | ||
func Decrypt(cfg []byte) ([]byte, error) { | ||
return nil, fmt.Errorf("encryption not supported") | ||
} |