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

Method optionalTimestamp

internal/config/refreshable.go:303–316  ·  view source on GitHub ↗
(path []string)

Source from the content-addressed store, hash-verified

301}
302
303func (c *AuthConfig) optionalTimestamp(path []string) (*time.Time, error) {
304 value, err := c.cfg.Get(path)
305 if isKeyNotFound(err) {
306 return nil, nil
307 }
308 if err != nil {
309 return nil, err
310 }
311 timestamp, err := time.Parse(time.RFC3339Nano, value)
312 if err != nil {
313 return nil, errors.New("invalid refreshable credential expiration timestamp")
314 }
315 return &timestamp, nil
316}
317
318func refreshableFromKeyring(hostname, username string) (gh.Credential, error) {
319 data, err := keyring.Get(refreshableServiceName(hostname), username)

Callers 1

refreshableFromConfigMethod · 0.95

Calls 2

isKeyNotFoundFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected