pr cleanup
config consolidation
This commit is contained in:
@@ -94,9 +94,9 @@ func main() {
|
||||
return swagger, nil
|
||||
}
|
||||
|
||||
// Both of these operations (InitializeConfig and InitializeAuthProvider)
|
||||
// would be better off in the service.new but there are code dependencies
|
||||
// that make this not possible right now without significant refactoring.
|
||||
// Both of these operations (InitializeConfig and InitializeAuthConfig)
|
||||
// would be better off in one function but since there are services
|
||||
// that need the config but do not use auth we will keep them separate for now.
|
||||
|
||||
// This must be done before the rbac.InitializeAuthProvider
|
||||
errInitializingConfig := serviceconfig.InitializeConfig(cfg)
|
||||
@@ -106,10 +106,9 @@ func main() {
|
||||
}
|
||||
|
||||
// Authentication specific config.
|
||||
// This may move to another function after refactoring is done.
|
||||
// replace the path here with value from ENV
|
||||
baseUrl := "http://localhost:8080"
|
||||
errorInitializingAuthConfig := cfg.InitializeAuthConfig(baseUrl, cfg.GetLogger())
|
||||
cfg.BaseURL = fmt.Sprintf("%s:%d", cfg.BaseURL, cfg.Port)
|
||||
errorInitializingAuthConfig := cfg.InitializeAuthConfig(cfg.BaseURL, cfg.GetLogger())
|
||||
fmt.Printf("base url after InitializeAuthConfig: %s\n", cfg.BaseURL)
|
||||
// join initErr with errorInitializingAuthConfig
|
||||
if errorInitializingAuthConfig != nil {
|
||||
slog.Error(errorInitializingAuthConfig.Error())
|
||||
|
||||
Reference in New Issue
Block a user