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

Method LoadEncryptedFile

stores/yaml/store.go:304–319  ·  view source on GitHub ↗

LoadEncryptedFile loads the contents of an encrypted yaml file onto a sops.Tree runtime object

(in []byte)

Source from the content-addressed store, hash-verified

302// LoadEncryptedFile loads the contents of an encrypted yaml file onto a
303// sops.Tree runtime object
304func (store *Store) LoadEncryptedFile(in []byte) (sops.Tree, error) {
305 branches, err := store.LoadPlainFile(in)
306 if err != nil {
307 return sops.Tree{}, err
308 }
309 branches, metadata, err := stores.ExtractMetadata(branches, stores.MetadataOpts{
310 Flatten: stores.MetadataFlattenNone,
311 })
312 if err != nil {
313 return sops.Tree{}, err
314 }
315 return sops.Tree{
316 Branches: branches,
317 Metadata: metadata,
318 }, nil
319}
320
321// LoadPlainFile loads the contents of a plaintext yaml file onto a
322// sops.Tree runtime object

Callers

nothing calls this directly

Implementers 5

Storestores/dotenv/store.go
Storestores/ini/store.go
Storestores/yaml/store.go
Storestores/json/store.go
BinaryStorestores/json/store.go

Calls 2

LoadPlainFileMethod · 0.95
ExtractMetadataFunction · 0.92

Tested by

no test coverage detected