| 293 | } |
| 294 | |
| 295 | func (conn *GithubConn) SanitizeSecret() GithubConn { |
| 296 | if conn.SecretKey == "" { |
| 297 | return *conn |
| 298 | } |
| 299 | secretKey := conn.SecretKey |
| 300 | showPrefixLen, showSuffixLen := 50, 50 |
| 301 | hiddenLen := len(secretKey) - showSuffixLen - showSuffixLen |
| 302 | secret := strings.Repeat("*", hiddenLen) |
| 303 | conn.SecretKey = strings.Replace(secretKey, conn.SecretKey[showPrefixLen:showPrefixLen+hiddenLen], secret, -1) |
| 304 | return *conn |
| 305 | } |
| 306 | |
| 307 | func (conn *GithubConn) SanitizeToken(token string) string { |
| 308 | if token == "" { |