1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Add configuration for stores

this will allow for setting of parameters specific to each store, such
as indentation level for YAML

Co-authored-by: Bastien Wermeille <bastien.wermeille@gmail.com>
Signed-off-by: James J. Goodhouse <jgoodhouse@newrelic.com>
This commit is contained in:
James J. Goodhouse
2021-09-02 16:13:03 -07:00
committed by Bastien Wermeille
parent 2443097073
commit e9e2346fdd
8 changed files with 122 additions and 21 deletions

View File

@@ -8,16 +8,27 @@ import (
"io"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/config"
"github.com/getsops/sops/v3/stores"
)
// Store handles storage of JSON data.
type Store struct {
config config.JSONStoreConfig
}
func NewStore(c *config.JSONStoreConfig) *Store {
return &Store{config: *c}
}
// BinaryStore handles storage of binary data in a JSON envelope.
type BinaryStore struct {
store Store
store Store
config config.JSONBinaryStoreConfig
}
func NewBinaryStore(c *config.JSONBinaryStoreConfig) *BinaryStore {
return &BinaryStore{config: *c}
}
// LoadEncryptedFile loads an encrypted json file onto a sops.Tree object
@@ -337,3 +348,9 @@ func (store *Store) EmitExample() []byte {
}
return bytes
}
func (store *Store) Configure(c *config.Config) {
}
func (store *BinaryStore) Configure(c *config.Config) {
}