()
| 249 | } |
| 250 | |
| 251 | func (a *Authenticator) getCreds() (*credentials, error) { |
| 252 | a.mu.Lock() |
| 253 | defer a.mu.Unlock() |
| 254 | if a.cachedCreds != nil && !a.credsExpired() { |
| 255 | return a.cachedCreds, nil |
| 256 | } |
| 257 | |
| 258 | if err := a.refreshCredsLocked(nil); err != nil { |
| 259 | return nil, err |
| 260 | } |
| 261 | return a.cachedCreds, nil |
| 262 | } |
| 263 | |
| 264 | // maybeRefreshCreds executes the plugin to force a rotation of the |
| 265 | // credentials, unless they were rotated already. |
no test coverage detected