normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use a single canonical timezone regardless of how the caller constructed them.
(record refreshableTokenRecord)
| 776 | // normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use |
| 777 | // a single canonical timezone regardless of how the caller constructed them. |
| 778 | func normalizeToUTC(record refreshableTokenRecord) refreshableTokenRecord { |
| 779 | if record.ExpiresAt != nil { |
| 780 | utc := record.ExpiresAt.UTC() |
| 781 | record.ExpiresAt = &utc |
| 782 | } |
| 783 | if record.RefreshTokenExpiresAt != nil { |
| 784 | utc := record.RefreshTokenExpiresAt.UTC() |
| 785 | record.RefreshTokenExpiresAt = &utc |
| 786 | } |
| 787 | return record |
| 788 | } |
| 789 | |
| 790 | func validateRefreshableCredential(credential gh.Credential) error { |
| 791 | if credential.Token == "" { |
no outgoing calls
no test coverage detected