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

Function normalizeToUTC

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

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.
778func 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
790func validateRefreshableCredential(credential gh.Credential) error {
791 if credential.Token == "" {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected