MCPcopy Index your code
hub / github.com/apache/devlake / SanitizeSecret

Method SanitizeSecret

backend/plugins/github/models/connection.go:295–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293}
294
295func (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
307func (conn *GithubConn) SanitizeToken(token string) string {
308 if token == "" {

Callers 2

SanitizeMethod · 0.95
MergeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected