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

Function normalizeToUTC

internal/config/refreshable.go:604–614  ·  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

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.
604func 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
616func validateRefreshableCredential(credential gh.Credential) error {
617 if credential.Token == "" {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected