credentialFromAccessToken projects an OAuth access token onto gh.Credential, reusing refreshableCredentialFromAccessToken so the expiry mapping lives in one place. requestedAt is the instant the exchange was initiated, used to anchor the token lifetime. The runtime-only Source is left unset; the sto
(token *oauthapi.AccessToken, requestedAt time.Time)
| 104 | // exchange was initiated, used to anchor the token lifetime. The runtime-only Source is left unset; the storage layer |
| 105 | // drops it regardless. |
| 106 | func credentialFromAccessToken(token *oauthapi.AccessToken, requestedAt time.Time) gh.Credential { |
| 107 | rc := refreshableCredentialFromAccessToken(token, requestedAt) |
| 108 | return gh.Credential{ |
| 109 | Token: rc.AccessToken, |
| 110 | RefreshToken: rc.RefreshToken, |
| 111 | ExpiresIn: rc.ExpiresIn, |
| 112 | RefreshTokenExpiresIn: rc.RefreshTokenExpiresIn, |
| 113 | ExpiresAt: rc.ExpiresAt, |
| 114 | RefreshTokenExpiresAt: rc.RefreshTokenExpiresAt, |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | // authResultFromToken projects the OAuth flow's access token and the resolved username onto an AuthResult. A refresh |
| 119 | // token is present only when the server honored the expiring request, so the refreshable credential is gated on it |
no test coverage detected