@@ -29,80 +29,80 @@ type SopsFile struct {
2929 // in the SOPS file by checking for nil. This way we can show the user a
3030 // helpful error message indicating that the metadata wasn't found, instead
3131 // of showing a cryptic parsing error
32- Metadata * Metadata `yaml:"sops" json:"sops" ini:"sops"`
32+ Metadata * Metadata `toml:"sops" yaml:"sops" json:"sops" ini:"sops"`
3333}
3434
3535// Metadata is stored in SOPS encrypted files, and it contains the information necessary to decrypt the file.
3636// This struct is just used for serialization, and SOPS uses another struct internally, sops.Metadata. It exists
3737// in order to allow the binary format to stay backwards compatible over time, but at the same time allow the internal
3838// representation SOPS uses to change over time.
3939type Metadata struct {
40- ShamirThreshold int `yaml:"shamir_threshold,omitempty" json:"shamir_threshold,omitempty"`
41- KeyGroups []keygroup `yaml:"key_groups,omitempty" json:"key_groups,omitempty"`
42- KMSKeys []kmskey `yaml:"kms" json:"kms"`
43- GCPKMSKeys []gcpkmskey `yaml:"gcp_kms" json:"gcp_kms"`
44- AzureKeyVaultKeys []azkvkey `yaml:"azure_kv" json:"azure_kv"`
45- VaultKeys []vaultkey `yaml:"hc_vault" json:"hc_vault"`
46- AgeKeys []agekey `yaml:"age" json:"age"`
47- LastModified string `yaml:"lastmodified" json:"lastmodified"`
48- MessageAuthenticationCode string `yaml:"mac" json:"mac"`
49- PGPKeys []pgpkey `yaml:"pgp" json:"pgp"`
50- UnencryptedSuffix string `yaml:"unencrypted_suffix,omitempty" json:"unencrypted_suffix,omitempty"`
51- EncryptedSuffix string `yaml:"encrypted_suffix,omitempty" json:"encrypted_suffix,omitempty"`
52- UnencryptedRegex string `yaml:"unencrypted_regex,omitempty" json:"unencrypted_regex,omitempty"`
53- EncryptedRegex string `yaml:"encrypted_regex,omitempty" json:"encrypted_regex,omitempty"`
54- Version string `yaml:"version" json:"version"`
40+ ShamirThreshold int `toml:"shamir_threshold,omitempty" yaml:"shamir_threshold,omitempty" json:"shamir_threshold,omitempty"`
41+ KeyGroups []keygroup `toml:"key_groups,omitempty" yaml:"key_groups,omitempty" json:"key_groups,omitempty"`
42+ KMSKeys []kmskey `toml:"kms" yaml:"kms" json:"kms"`
43+ GCPKMSKeys []gcpkmskey `toml:"gcp_kms" yaml:"gcp_kms" json:"gcp_kms"`
44+ AzureKeyVaultKeys []azkvkey `toml:"azure_kv" yaml:"azure_kv" json:"azure_kv"`
45+ VaultKeys []vaultkey `toml:"hc_vault" yaml:"hc_vault" json:"hc_vault"`
46+ AgeKeys []agekey `toml:"age" yaml:"age" json:"age"`
47+ LastModified string `toml:"lastmodified" yaml:"lastmodified" json:"lastmodified"`
48+ MessageAuthenticationCode string `toml:"mac" yaml:"mac" json:"mac"`
49+ PGPKeys []pgpkey `toml:"pgp" yaml:"pgp" json:"pgp"`
50+ UnencryptedSuffix string `toml:"unencrypted_suffix,omitempty" yaml:"unencrypted_suffix,omitempty" json:"unencrypted_suffix,omitempty"`
51+ EncryptedSuffix string `toml:"encrypted_suffix,omitempty" yaml:"encrypted_suffix,omitempty" json:"encrypted_suffix,omitempty"`
52+ UnencryptedRegex string `toml:"unencrypted_regex,omitempty" yaml:"unencrypted_regex,omitempty" json:"unencrypted_regex,omitempty"`
53+ EncryptedRegex string `toml:"encrypted_regex,omitempty" yaml:"encrypted_regex,omitempty" json:"encrypted_regex,omitempty"`
54+ Version string `toml:"version" yaml:"version" json:"version"`
5555}
5656
5757type keygroup struct {
58- PGPKeys []pgpkey `yaml:"pgp,omitempty" json:"pgp,omitempty"`
59- KMSKeys []kmskey `yaml:"kms,omitempty" json:"kms,omitempty"`
60- GCPKMSKeys []gcpkmskey `yaml:"gcp_kms,omitempty" json:"gcp_kms,omitempty"`
61- AzureKeyVaultKeys []azkvkey `yaml:"azure_kv,omitempty" json:"azure_kv,omitempty"`
62- VaultKeys []vaultkey `yaml:"hc_vault" json:"hc_vault"`
63- AgeKeys []agekey `yaml:"age" json:"age"`
58+ PGPKeys []pgpkey `toml:"pgp,omitempty" yaml:"pgp,omitempty" json:"pgp,omitempty"`
59+ KMSKeys []kmskey `toml:"kms,omitempty" yaml:"kms,omitempty" json:"kms,omitempty"`
60+ GCPKMSKeys []gcpkmskey `toml:"gcp_kms,omitempty" yaml:"gcp_kms,omitempty" json:"gcp_kms,omitempty"`
61+ AzureKeyVaultKeys []azkvkey `toml:"azure_kv,omitempty" yaml:"azure_kv,omitempty" json:"azure_kv,omitempty"`
62+ VaultKeys []vaultkey `toml:"hc_vault" yaml:"hc_vault" json:"hc_vault"`
63+ AgeKeys []agekey `toml:"age" yaml:"age" json:"age"`
6464}
6565
6666type pgpkey struct {
67- CreatedAt string `yaml:"created_at" json:"created_at"`
68- EncryptedDataKey string `yaml:"enc" json:"enc"`
69- Fingerprint string `yaml:"fp" json:"fp"`
67+ CreatedAt string `toml:"created_at" yaml:"created_at" json:"created_at"`
68+ EncryptedDataKey string `toml:"enc" yaml:"enc" json:"enc"`
69+ Fingerprint string `toml:"fp" yaml:"fp" json:"fp"`
7070}
7171
7272type kmskey struct {
73- Arn string `yaml:"arn" json:"arn"`
74- Role string `yaml:"role,omitempty" json:"role,omitempty"`
75- Context map [string ]* string `yaml:"context,omitempty" json:"context,omitempty"`
76- CreatedAt string `yaml:"created_at" json:"created_at"`
77- EncryptedDataKey string `yaml:"enc" json:"enc"`
78- AwsProfile string `yaml:"aws_profile" json:"aws_profile"`
73+ Arn string `toml:"arn" yaml:"arn" json:"arn"`
74+ Role string `toml:"role,omitempty" yaml:"role,omitempty" json:"role,omitempty"`
75+ Context map [string ]* string `toml:"context,omitempty" yaml:"context,omitempty" json:"context,omitempty"`
76+ CreatedAt string `toml:"created_at" yaml:"created_at" json:"created_at"`
77+ EncryptedDataKey string `toml:"enc" yaml:"enc" json:"enc"`
78+ AwsProfile string `toml:"aws_profile" yaml:"aws_profile" json:"aws_profile"`
7979}
8080
8181type gcpkmskey struct {
82- ResourceID string `yaml:"resource_id" json:"resource_id"`
83- CreatedAt string `yaml:"created_at" json:"created_at"`
84- EncryptedDataKey string `yaml:"enc" json:"enc"`
82+ ResourceID string `toml:"resource_id" yaml:"resource_id" json:"resource_id"`
83+ CreatedAt string `toml:"created_at" yaml:"created_at" json:"created_at"`
84+ EncryptedDataKey string `toml:"enc" yaml:"enc" json:"enc"`
8585}
8686
8787type vaultkey struct {
88- VaultAddress string `yaml:"vault_address" json:"vault_address"`
89- EnginePath string `yaml:"engine_path" json:"engine_path"`
90- KeyName string `yaml:"key_name" json:"key_name"`
91- CreatedAt string `yaml:"created_at" json:"created_at"`
92- EncryptedDataKey string `yaml:"enc" json:"enc"`
88+ VaultAddress string `toml:"vault_address" yaml:"vault_address" json:"vault_address"`
89+ EnginePath string `toml:"engine_path" yaml:"engine_path" json:"engine_path"`
90+ KeyName string `toml:"key_name" yaml:"key_name" json:"key_name"`
91+ CreatedAt string `toml:"created_at" yaml:"created_at" json:"created_at"`
92+ EncryptedDataKey string `toml:"enc" yaml:"enc" json:"enc"`
9393}
9494
9595type azkvkey struct {
96- VaultURL string `yaml:"vault_url" json:"vault_url"`
97- Name string `yaml:"name" json:"name"`
98- Version string `yaml:"version" json:"version"`
99- CreatedAt string `yaml:"created_at" json:"created_at"`
100- EncryptedDataKey string `yaml:"enc" json:"enc"`
96+ VaultURL string `toml:"vault_url" yaml:"vault_url" json:"vault_url"`
97+ Name string `toml:"name" yaml:"name" json:"name"`
98+ Version string `toml:"version" yaml:"version" json:"version"`
99+ CreatedAt string `toml:"created_at" yaml:"created_at" json:"created_at"`
100+ EncryptedDataKey string `toml:"enc" yaml:"enc" json:"enc"`
101101}
102102
103103type agekey struct {
104- Recipient string `yaml:"recipient" json:"recipient"`
105- EncryptedDataKey string `yaml:"enc" json:"enc"`
104+ Recipient string `toml:"recipient" yaml:"recipient" json:"recipient"`
105+ EncryptedDataKey string `toml:"enc" yaml:"enc" json:"enc"`
106106}
107107
108108// MetadataFromInternal converts an internal SOPS metadata representation to a representation appropriate for storage
0 commit comments