pr cleanup
This commit is contained in:
@@ -144,27 +144,31 @@ func InitializeConfig(baseURL string, logger *slog.Logger) *CognitoConfig {
|
||||
}
|
||||
|
||||
func (c *CognitoConfig) PrettyPrintDebugOnly() {
|
||||
if os.Getenv("DEBUG") == "true" {
|
||||
fmt.Printf("CognitoConfig (debug on):\n")
|
||||
fmt.Printf(" AuthClientID: %s\n", c.AuthClientID)
|
||||
fmt.Printf(" AuthClientSecret: %s\n", c.AuthClientSecret)
|
||||
fmt.Printf(" AuthRedirectURI: %s\n", c.AuthRedirectURI)
|
||||
fmt.Printf(" AuthTokenURL: %s\n", c.AuthTokenURL)
|
||||
fmt.Printf(" AuthURL: %s\n", c.AuthURL)
|
||||
fmt.Printf(" AuthJwksURL: %s\n", c.AuthJwksURL)
|
||||
fmt.Printf(" AuthUserPoolID: %s\n", c.AuthUserPoolID)
|
||||
fmt.Printf(" AuthRegion: %s\n", c.AuthRegion)
|
||||
fmt.Printf(" AuthLoginPath: %s\n", c.AuthLoginPath)
|
||||
fmt.Printf(" AuthCallbackPath: %s\n", c.AuthCallbackPath)
|
||||
fmt.Printf(" AuthHomePath: %s\n", c.AuthHomePath)
|
||||
fmt.Printf(" AuthLogoutPath: %s\n", c.AuthLogoutPath)
|
||||
fmt.Printf(" DisableAuth: %s\n", c.DisableAuth)
|
||||
fmt.Printf(" AuthDomain: %s\n", c.AuthDomain)
|
||||
logger := c.AuthLogger
|
||||
if logger != nil {
|
||||
logger.Debug("CognitoConfig details",
|
||||
"AuthClientID", c.AuthClientID,
|
||||
"AuthClientSecret", c.AuthClientSecret,
|
||||
"AuthRedirectURI", c.AuthRedirectURI,
|
||||
"AuthTokenURL", c.AuthTokenURL,
|
||||
"AuthURL", c.AuthURL,
|
||||
"AuthJwksURL", c.AuthJwksURL,
|
||||
"AuthUserPoolID", c.AuthUserPoolID,
|
||||
"AuthRegion", c.AuthRegion,
|
||||
"AuthLoginPath", c.AuthLoginPath,
|
||||
"AuthCallbackPath", c.AuthCallbackPath,
|
||||
"AuthHomePath", c.AuthHomePath,
|
||||
"AuthLogoutPath", c.AuthLogoutPath,
|
||||
"DisableAuth", c.DisableAuth,
|
||||
"AuthDomain", c.AuthDomain)
|
||||
|
||||
// pretty print the route permissions map
|
||||
for route, permissions := range c.AuthRoutePermissions {
|
||||
fmt.Printf(" Route: %s, Permissions: %v\n", route, permissions)
|
||||
logger.Debug("Route permission",
|
||||
"route", route,
|
||||
"permissions", permissions)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ type BaseConfig struct {
|
||||
// this is a requirement for the PrintAuthConfig function.
|
||||
|
||||
// These are the fields that are common to all services.
|
||||
//Pwd string `env:"PWD,required,notEmpty"`
|
||||
Port int `env:"PORT" envDefault:"8080"`
|
||||
BaseURL string `env:"BASE_URL" envDefault:"http://localhost"`
|
||||
auth.CognitoConfig
|
||||
|
||||
Reference in New Issue
Block a user