mirror of
https://github.com/komari-monitor/komari.git
synced 2026-11-20 14:51:16 +00:00
feat: 添加数据掩码功能以保护敏感信息
This commit is contained in:
1 parent
0f0e359c63
commit
b616eeb2d4
3 files changed
+155
-4
No files matched your search
@@ -71,7 +71,7 @@ func (g *Github) OnCallback(ctx *gin.Context, state string, query map[string]str
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
return factory.OidcCallback{}, fmt.Errorf("failed to get access token: %v", err)
|
||||
return factory.OidcCallback{}, fmt.Errorf("failed to get access token: %s", utils.DataMasking(err.Error(), []string{g.Addition.ClientSecret, g.Addition.ClientId}))
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
@@ -82,7 +82,7 @@ func (g *Github) OnCallback(ctx *gin.Context, state string, query map[string]str
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&tokenResp); err != nil {
|
||||
return factory.OidcCallback{}, fmt.Errorf("failed to parse access token response: %v", err)
|
||||
return factory.OidcCallback{}, fmt.Errorf("failed to parse access token response: %s", utils.DataMasking(err.Error(), []string{g.Addition.ClientSecret, g.Addition.ClientId}))
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
|
||||
Reference in new issue
Block a user