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)
| 681 | // normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use |
| 682 | // a single canonical timezone regardless of how the caller constructed them. |
| 683 | func normalizeToUTC(record refreshableTokenRecord) refreshableTokenRecord { |
| 684 | if record.ExpiresAt != nil { |
| 685 | utc := record.ExpiresAt.UTC() |
| 686 | record.ExpiresAt = &utc |
| 687 | } |
| 688 | if record.RefreshTokenExpiresAt != nil { |
| 689 | utc := record.RefreshTokenExpiresAt.UTC() |
| 690 | record.RefreshTokenExpiresAt = &utc |
| 691 | } |
| 692 | return record |
| 693 | } |
| 694 | |
| 695 | func validateRefreshableCredential(credential gh.Credential) error { |
| 696 | if credential.Token == "" { |
no outgoing calls
no test coverage detected