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

Function TestDestinationValidationSingleGCSDestination

config/config_test.go:865–878  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

863}
864
865func TestDestinationValidationSingleGCSDestination(t *testing.T) {
866 validGCSConfig := []byte(`
867destination_rules:
868 - path_regex: '^test/.*'
869 gcs_bucket: 'my-gcs-bucket'
870 gcs_prefix: 'sops/'
871 recreation_rule:
872 kms: 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012'
873`)
874 conf, err := parseDestinationRuleForFile(parseConfigFile(validGCSConfig, t), "test/secrets.yaml", nil)
875 assert.Nil(t, err)
876 assert.NotNil(t, conf.Destination)
877 assert.Contains(t, conf.Destination.Path("secrets.yaml"), "gcs://my-gcs-bucket/sops/secrets.yaml")
878}
879
880func TestDestinationValidationSingleVaultDestination(t *testing.T) {
881 validVaultConfig := []byte(`

Callers

nothing calls this directly

Calls 3

parseConfigFileFunction · 0.85
PathMethod · 0.65

Tested by

no test coverage detected