Skip to content

Commit

Permalink
fix: configs
Browse files Browse the repository at this point in the history
  • Loading branch information
skynet2 committed Dec 4, 2024
1 parent ca7cf6c commit 4526b43
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions cmd/vc-rest/startcmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,19 @@ func buildEchoHandler(
tlsConfig := &tls.Config{RootCAs: conf.RootCAs, MinVersion: tls.VersionTLS12}
mongoDbNameWithPrefix := conf.StartupParameters.dbParameters.databasePrefix + "vcs_db"

kmsDbName := conf.StartupParameters.kmsParameters.aliasPrefix
if strings.EqualFold(conf.StartupParameters.kmsParameters.kmsSecretsDatabaseType, "mongo") {
kmsDbType := conf.StartupParameters.kmsParameters.kmsSecretsDatabaseType
kmsDbUrl := conf.StartupParameters.kmsParameters.kmsSecretsDatabaseURL
kmsDbName := conf.StartupParameters.kmsParameters.kmsSecretsDatabasePrefix

if kmsDbType == "" {
kmsDbType = conf.StartupParameters.dbParameters.databaseType
}

if strings.EqualFold(kmsDbType, "mongo") {
if kmsDbUrl == "" {
kmsDbUrl = conf.StartupParameters.dbParameters.databaseURL
}

kmsDbName = mongoDbNameWithPrefix
}

Expand All @@ -469,8 +480,8 @@ func buildEchoHandler(
Region: conf.StartupParameters.kmsParameters.kmsRegion,
HTTPClient: http.DefaultClient, // TODO change to custom http client
SecretLockKeyPath: conf.StartupParameters.kmsParameters.secretLockKeyPath,
DBType: conf.StartupParameters.kmsParameters.kmsSecretsDatabaseType,
DBURL: conf.StartupParameters.kmsParameters.kmsSecretsDatabaseURL,
DBType: kmsDbType,
DBURL: kmsDbUrl,
DBName: kmsDbName,
AliasPrefix: conf.StartupParameters.kmsParameters.aliasPrefix,
MasterKey: conf.StartupParameters.kmsParameters.masterKey,
Expand Down

0 comments on commit 4526b43

Please sign in to comment.