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

Method UpdateToken

backend/plugins/github/models/connection.go:65–74  ·  view source on GitHub ↗

UpdateToken updates the token and refresh token information

(newToken, newRefreshToken string, expiry, refreshExpiry *time.Time)

Source from the content-addressed store, hash-verified

63
64// UpdateToken updates the token and refresh token information
65func (conn *GithubConn) UpdateToken(newToken, newRefreshToken string, expiry, refreshExpiry *time.Time) {
66 conn.Token = newToken
67 conn.RefreshToken = newRefreshToken
68 conn.TokenExpiresAt = expiry
69 conn.RefreshTokenExpiresAt = refreshExpiry
70
71 // Update the internal tokens slice used by SetupAuthentication
72 conn.tokens = []string{newToken}
73 conn.tokenIndex = 0
74}
75
76// PrepareApiClient splits Token to tokens for SetupAuthentication to utilize
77func (conn *GithubConn) PrepareApiClient(apiClient plugin.ApiClient) errors.Error {

Callers 6

PrepareApiClientMethod · 0.95
refreshTokenMethod · 0.80
fakeRefreshFnFunction · 0.80

Calls

no outgoing calls

Tested by 3

fakeRefreshFnFunction · 0.64