MCPcopy Create free account
hub / github.com/cli/cli / normalizeToUTC

Function normalizeToUTC

internal/config/refreshable.go:683–693  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
683func 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
695func validateRefreshableCredential(credential gh.Credential) error {
696 if credential.Token == "" {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected