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

Method optionalTimestamp

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

Source from the content-addressed store, hash-verified

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