(path []string)
| 300 | } |
| 301 | |
| 302 | func (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 ×tamp, nil |
| 315 | } |
| 316 | |
| 317 | func refreshableFromKeyring(hostname, username string) (gh.Credential, error) { |
| 318 | data, err := keyring.Get(refreshableServiceName(hostname), username) |
no test coverage detected