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)
| 602 | // normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use |
| 603 | // a single canonical timezone regardless of how the caller constructed them. |
| 604 | func normalizeToUTC(record refreshableTokenRecord) refreshableTokenRecord { |
| 605 | if record.ExpiresAt != nil { |
| 606 | utc := record.ExpiresAt.UTC() |
| 607 | record.ExpiresAt = &utc |
| 608 | } |
| 609 | if record.RefreshTokenExpiresAt != nil { |
| 610 | utc := record.RefreshTokenExpiresAt.UTC() |
| 611 | record.RefreshTokenExpiresAt = &utc |
| 612 | } |
| 613 | return record |
| 614 | } |
| 615 | |
| 616 | func validateRefreshableCredential(credential gh.Credential) error { |
| 617 | if credential.Token == "" { |
no outgoing calls
no test coverage detected