-
Notifications
You must be signed in to change notification settings - Fork 0
feat: added user 'foo' as test user to allow for local debugging #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,7 @@ import ( | |||||||
| "encoding/json" | ||||||||
| "fmt" | ||||||||
| "io" | ||||||||
| "log" | ||||||||
| "net/http" | ||||||||
|
|
||||||||
| serviceconfig "github.com/SnackLog/service-config-lib" | ||||||||
|
|
@@ -14,7 +15,17 @@ type authServiceResponse struct { | |||||||
| Username string `json:"username"` | ||||||||
| } | ||||||||
|
|
||||||||
| func bypassLogic(c *gin.Context) { | ||||||||
| log.Println("\033[1;31mWARNING: DEBUG_BYPASS_AUTH_MIDDLEWARE is enabled, bypassing authentication and setting user to 'foo'!\033[0m") | ||||||||
| c.Set("username", "foo") | ||||||||
|
||||||||
| c.Set("username", "foo") | |
| c.Set("username", "foo") | |
| c.Next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is logged on every authenticated request when debug bypass is enabled. This could generate excessive log output and make debugging more difficult. Consider logging this warning only once at application startup or middleware initialization instead of on every request.