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

Function edit

cmd/sops/edit.go:75–100  ·  view source on GitHub ↗
(opts editOpts)

Source from the content-addressed store, hash-verified

73}
74
75func edit(opts editOpts) ([]byte, error) {
76 // Load the file
77 tree, err := common.LoadEncryptedFileWithBugFixes(common.GenericDecryptOpts{
78 Cipher: opts.Cipher,
79 InputStore: opts.InputStore,
80 InputPath: opts.InputPath,
81 IgnoreMAC: opts.IgnoreMAC,
82 KeyServices: opts.KeyServices,
83 })
84 if err != nil {
85 return nil, err
86 }
87 // Decrypt the file
88 dataKey, err := common.DecryptTree(common.DecryptTreeOpts{
89 Cipher: opts.Cipher,
90 IgnoreMac: opts.IgnoreMAC,
91 Tree: tree,
92 KeyServices: opts.KeyServices,
93 DecryptionOrder: opts.DecryptionOrder,
94 })
95 if err != nil {
96 return nil, err
97 }
98
99 return editTree(opts, tree, dataKey)
100}
101
102type cancelError struct{}
103

Callers 1

mainFunction · 0.85

Calls 3

DecryptTreeFunction · 0.92
editTreeFunction · 0.85

Tested by

no test coverage detected