Skip to content

Commit

Permalink
feat: encryption passwords as YAML in config file (#1036)
Browse files Browse the repository at this point in the history
* feat: encryption passwords as YAML in config file

When encryption passwords are specified in a YAML config file rather than
environment variables, they can now be specified as YAML rather than
having to specify them as a string that is then separately parsed as
JSON.

* Update internal/encryption/passwordparser/parser.go

Co-authored-by: Andrea Zucchini <[email protected]>

---------

Co-authored-by: Andrea Zucchini <[email protected]>
  • Loading branch information
blgm and zucchinidev authored Jun 13, 2024
1 parent ed11932 commit c51137e
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func serveDocs() {
}

func setupDBEncryption(db *gorm.DB, logger lager.Logger) storage.Encryptor {
config, err := encryption.ParseConfiguration(db, viper.GetBool(encryptionEnabled), viper.GetString(encryptionPasswords))
config, err := encryption.ParseConfiguration(db, viper.GetBool(encryptionEnabled), viper.Get(encryptionPasswords))
if err != nil {
logger.Fatal("Error parsing encryption configuration", err)
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.22.4

require (
code.cloudfoundry.org/credhub-cli v0.0.0-20220620130410-645eee56ecdb
code.cloudfoundry.org/jsonry v1.1.4
code.cloudfoundry.org/lager/v3 v3.0.3
github.com/go-sql-driver/mysql v1.8.1
github.com/google/gops v0.3.28
Expand Down
Loading

0 comments on commit c51137e

Please sign in to comment.