MCPcopy
hub / github.com/getsops/sops / TestEncryptedCommentRegex

Function TestEncryptedCommentRegex

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

Source from the content-addressed store, hash-verified

349}
350
351func TestEncryptedCommentRegex(t *testing.T) {
352 branches := TreeBranches{
353 TreeBranch{
354 TreeItem{
355 Key: Comment{Value: "sops:enc"},
356 Value: nil,
357 },
358 TreeItem{
359 Key: "foo",
360 Value: "bar",
361 },
362 TreeItem{
363 Key: "bar",
364 Value: TreeBranch{
365 TreeItem{
366 Key: "foo",
367 Value: "bar",
368 },
369 TreeItem{
370 Key: Comment{Value: "before"},
371 Value: nil,
372 },
373 TreeItem{
374 Key: Comment{Value: "sops:enc"},
375 Value: nil,
376 },
377 TreeItem{
378 Key: "encrypted",
379 Value: "bar",
380 },
381 },
382 },
383 TreeItem{
384 Key: "array",
385 Value: []interface{}{
386 "bar",
387 Comment{Value: "sops:enc"},
388 "baz",
389 },
390 },
391 TreeItem{
392 Key: Comment{Value: "sops:enc"},
393 Value: nil,
394 },
395 TreeItem{
396 Key: Comment{Value: "after"},
397 Value: nil,
398 },
399 TreeItem{
400 Key: "encarray",
401 Value: []interface{}{
402 "bar",
403 "baz",
404 },
405 },
406 },
407 }
408 tree := Tree{Branches: branches, Metadata: Metadata{EncryptedCommentRegex: "sops:enc"}}

Callers

nothing calls this directly

Calls 2

EncryptMethod · 0.95
DecryptMethod · 0.95

Tested by

no test coverage detected