credential projects the stored record onto the universal gh.Credential shape, tagging it with the given source (the access token becomes Token). Refresh metadata is carried verbatim, cloning the timestamps so the result never aliases the record's *time.Time values.
(source string)
| 565 | // (the access token becomes Token). Refresh metadata is carried verbatim, cloning the timestamps so the result never |
| 566 | // aliases the record's *time.Time values. |
| 567 | func (r refreshableTokenRecord) credential(source string) gh.Credential { |
| 568 | return gh.Credential{ |
| 569 | Source: source, |
| 570 | Token: r.AccessToken, |
| 571 | RefreshToken: r.RefreshToken, |
| 572 | ExpiresIn: r.ExpiresIn, |
| 573 | RefreshTokenExpiresIn: r.RefreshTokenExpiresIn, |
| 574 | ExpiresAt: cloneTime(r.ExpiresAt), |
| 575 | RefreshTokenExpiresAt: cloneTime(r.RefreshTokenExpiresAt), |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | // recordFromCredential projects a gh.Credential onto the persisted record shape, dropping the runtime-only Source and |
| 580 | // carrying the access token as AccessToken. It clones the timestamps so the record never aliases the credential's |
no test coverage detected