cleanup temp
This commit is contained in:
@@ -96,8 +96,8 @@ func main() {
|
||||
}
|
||||
|
||||
// Both of these operations (InitializeConfig and InitializeAuthProvider)
|
||||
// would be better off in the service.new but there are temporal dependencies
|
||||
// that make this not possible right now without more refactoring.
|
||||
// would be better off in the service.new but there are code dependencies
|
||||
// that make this not possible right now without significant refactoring.
|
||||
|
||||
// This must be done before the rbac.InitializeAuthProvider
|
||||
errInitializingConfig := serviceconfig.InitializeConfig(cfg)
|
||||
|
||||
@@ -88,6 +88,20 @@ func getSlogCustomEchoMiddleware(logger *slog.Logger) echo.MiddlewareFunc {
|
||||
}
|
||||
|
||||
func New(ctx context.Context, cfg Config) (*Server, error) {
|
||||
// Put this in when refactoring is done and remove from main.go
|
||||
|
||||
//// This must be done before the rbac.InitializeAuthProvider then remove from main.go for service.
|
||||
//errInitializingConfig := serviceconfig.InitializeConfig(cfg)
|
||||
//if errInitializingConfig != nil {
|
||||
// return nil, errInitializingConfig
|
||||
//}
|
||||
//
|
||||
//// Initialize the rbac config here since only the API service needs it
|
||||
//errorGettingAuthProvider := rbac.InitializeAuthProvider(cfg.GetAuthConfig())
|
||||
//if errorGettingAuthProvider != nil {
|
||||
// return nil, errorGettingAuthProvider
|
||||
//}
|
||||
|
||||
cleanup, err := server.New(ctx, cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
// that can be embedded in service-specific configs.
|
||||
type BaseConfig struct {
|
||||
// Always place non struct fields at the top of the struct
|
||||
// this is a requirement for the PrintConfig function.
|
||||
// this is a requirement for the PrintAuthConfig function.
|
||||
|
||||
// miscellaneous fields uncategorized
|
||||
// PWD will replace the BASE_PATH env var
|
||||
@@ -56,6 +56,7 @@ type ConfigProvider interface {
|
||||
logger.ConfigProvider
|
||||
aws.ConfigProvider
|
||||
queue.ConfigProvider
|
||||
rbac.ConfigProvider
|
||||
GetBasePath() string
|
||||
SetBasePath(string)
|
||||
SetDBConfig(*database.DBConfig)
|
||||
|
||||
@@ -26,7 +26,7 @@ type AuthConfig struct {
|
||||
type ConfigProvider interface {
|
||||
//Initialize() error
|
||||
GetKeyProvider() rbac.KeyProvider
|
||||
PrintConfig()
|
||||
PrintAuthConfig()
|
||||
}
|
||||
|
||||
// GetKeyProvider returns the configured KeyProvider
|
||||
@@ -58,13 +58,13 @@ func (r *AuthConfig) InitializeAuthProvider() error {
|
||||
default:
|
||||
return fmt.Errorf("unknown RBAC provider type: %s", r.AuthType)
|
||||
}
|
||||
r.PrintConfig()
|
||||
r.PrintAuthConfig()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// PrintConfig logs the current configuration, masking sensitive values
|
||||
func (r *AuthConfig) PrintConfig() {
|
||||
// PrintAuthConfig logs the current configuration, masking sensitive values
|
||||
func (r *AuthConfig) PrintAuthConfig() {
|
||||
slog.Info("RBAC AuthConfig:",
|
||||
"provider_type", r.AuthType,
|
||||
"region", r.CognitoRegion,
|
||||
|
||||
Reference in New Issue
Block a user