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

Method SanitizeTokens

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

Source from the content-addressed store, hash-verified

329}
330
331func (conn *GithubConn) SanitizeTokens() GithubConn {
332 if conn.Token == "" {
333 return *conn
334 }
335 tokens := strings.Split(conn.Token, ",")
336 var sanitizedTokens []string
337 for _, token := range tokens {
338 if token == "" {
339 continue
340 }
341 sanitizedToken := conn.SanitizeToken(token)
342 sanitizedTokens = append(sanitizedTokens, sanitizedToken)
343 }
344
345 if len(sanitizedTokens) > 0 {
346 conn.Token = strings.Join(sanitizedTokens, ",")
347 } else {
348 conn.Token = ""
349 }
350 return *conn
351}
352
353// Using GithubUserOfToken because it requires authentication, and it is public information anyway.
354type GithubUserOfToken struct {

Callers 1

SanitizeMethod · 0.95

Calls 1

SanitizeTokenMethod · 0.95

Tested by

no test coverage detected