cleanup temp

This commit is contained in:
jay brown
2025-03-18 16:46:11 -07:00
parent 64141529e8
commit f79912c1a1
4 changed files with 22 additions and 7 deletions
+2 -2
View File
@@ -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)
+14
View File
@@ -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
+2 -1
View File
@@ -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)
+4 -4
View File
@@ -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,