MCPcopy Create free account
hub / github.com/getsops/sops / TestEncryptComments

Function TestEncryptComments

sops_test.go:934–959  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

932}
933
934func TestEncryptComments(t *testing.T) {
935 tree := Tree{
936 Branches: TreeBranches{
937 TreeBranch{
938 TreeItem{
939 Key: Comment{Value: "foo"},
940 Value: nil,
941 },
942 TreeItem{
943 Key: "list",
944 Value: []interface{}{
945 "1",
946 Comment{Value: "bar"},
947 "2",
948 },
949 },
950 },
951 },
952 Metadata: Metadata{
953 UnencryptedSuffix: DefaultUnencryptedSuffix,
954 },
955 }
956 tree.Encrypt(bytes.Repeat([]byte{'f'}, 32), reverseCipher{})
957 assert.Equal(t, "oof", tree.Branches[0][0].Key.(Comment).Value)
958 assert.Equal(t, "rab", tree.Branches[0][1].Value.([]interface{})[1])
959}
960
961func TestDecryptComments(t *testing.T) {
962 tree := Tree{

Callers

nothing calls this directly

Calls 1

EncryptMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…