-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Shadow the password on cache and session config on admin panel #7300
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7300 +/- ##
==========================================
+ Coverage 41.2% 41.23% +0.03%
==========================================
Files 464 464
Lines 62788 62832 +44
==========================================
+ Hits 25873 25911 +38
- Misses 33524 33529 +5
- Partials 3391 3392 +1
Continue to review full report at Codecov.
|
routers/admin/admin.go
Outdated
@@ -202,6 +202,17 @@ func SendTestMail(ctx *context.Context) { | |||
ctx.Redirect(setting.AppSubURL + "/admin/config") | |||
} | |||
|
|||
func shadowPassword(cfgItem string) string { | |||
fields := strings.Split(cfgItem, ",") |
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.
I think there need to be more than one check, since the config strings can be different for MySQL and redis. This seems to fix for redis, but not MySQL. In the example from #7147, the session provider connection string is:
someclient:somepassword@tcp(srv-mysql:3306)/someclient
This format uses DSN, so the password is optional: https://github.com/go-sql-driver/mysql
Maybe it you can also pass in the adapter/provider to shadowPassword and then know if it is Redis/MySQL and check based on that.
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.
OK. Will fix that.
@mrsdizzie done with test. |
…tea#7300) * shadow the password on cache and session config on admin panel * add shadow password of mysql/postgres/couchbase * fix log import
Although go-gitea#7300 properly shadows the password from the virtual session provider, the template displaying the provider config still presumed that the config was JSON. This PR updates the template and properly hides the Virtual Session provider. Fixes go-gitea#7127
* Properly fix #7127 Although #7300 properly shadows the password from the virtual session provider, the template displaying the provider config still presumed that the config was JSON. This PR updates the template and properly hides the Virtual Session provider. Fixes #7127 * update per @silverwind's suggestion
…itea#9137) * Properly fix go-gitea#7127 Although go-gitea#7300 properly shadows the password from the virtual session provider, the template displaying the provider config still presumed that the config was JSON. This PR updates the template and properly hides the Virtual Session provider. Fixes go-gitea#7127 * update per @silverwind's suggestion
… (#9203) * Properly fix #7147 Although #7300 properly shadows the password from the virtual session provider, the template displaying the provider config still presumed that the config was JSON. This PR updates the template and properly hides the Virtual Session provider. Fixes #7147 * update per @silverwind's suggestion
will fix #7147