Skip to content

Commit

Permalink
disable encryption in regular builds
Browse files Browse the repository at this point in the history
  • Loading branch information
arriven committed Apr 10, 2022
1 parent e410ddf commit 90589c1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/crypto.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build encrypted
// +build encrypted

package utils

import (
Expand Down
24 changes: 24 additions & 0 deletions src/utils/crypto_noop.go
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")
}

0 comments on commit 90589c1

Please sign in to comment.