MCPcopy Index your code
hub / github.com/getsops/sops / LoadCreationRuleForFile

Function LoadCreationRuleForFile

config/config.go:616–623  ·  view source on GitHub ↗

LoadCreationRuleForFile load the configuration for a given SOPS file from the config file at confPath. A kmsEncryptionContext should be provided for configurations that do not contain key groups, as there's no way to specify context inside a SOPS config file outside of key groups.

(confPath string, filePath string, kmsEncryptionContext map[string]*string)

Source from the content-addressed store, hash-verified

614// should be provided for configurations that do not contain key groups, as there's no way to specify context inside
615// a SOPS config file outside of key groups.
616func LoadCreationRuleForFile(confPath string, filePath string, kmsEncryptionContext map[string]*string) (*Config, error) {
617 conf, err := loadConfigFile(confPath)
618 if err != nil {
619 return nil, err
620 }
621
622 return parseCreationRuleForFile(conf, confPath, filePath, kmsEncryptionContext)
623}
624
625// LoadDestinationRuleForFile works the same as LoadCreationRuleForFile, but gets the "creation_rule" from the matching destination_rule's
626// "recreation_rule".

Callers 2

loadConfigFunction · 0.92
updateFileFunction · 0.92

Calls 2

loadConfigFileFunction · 0.85
parseCreationRuleForFileFunction · 0.85

Tested by

no test coverage detected