sops
sops copied to clipboard
Encrypt in a package and export method encrypt to be used in import "go.mozilla.org/sops/v3/encrypt"
In Go projects where you need encrypting with sops it'd be nice to have a direct access to the method func encrypt(opts encryptOpts) (encryptedFile []byte, err error)
in cmd/sops/encrypt.go. In that manner you could do something like:
import (
...
"go.mozilla.org/sops/v3/encrypt"
...
)
...
encryptedFile, _ := encrypt.Encrypt(encrypt.EncryptOpts{
InputStore: &yaml.Store{},
OutputStore: &yaml.Store{},
InputBytes: buffer,
Cipher: aes.NewCipher(),
KeyServices: svcs,
UnencryptedSuffix: "_unencrypted",
EncryptedSuffix: "",
UnencryptedRegex: "",
EncryptedRegex: "",
KeyGroups: groups,
GroupThreshold: 0,
})