Goes through the credentials chain, returning the first ``Credentials`` that could be loaded.
(self)
| 2223 | raise UnknownCredentialError(name=name) |
| 2224 | |
| 2225 | def load_credentials(self): |
| 2226 | """ |
| 2227 | Goes through the credentials chain, returning the first ``Credentials`` |
| 2228 | that could be loaded. |
| 2229 | """ |
| 2230 | # First provider to return a non-None response wins. |
| 2231 | for provider in self.providers: |
| 2232 | logger.debug("Looking for credentials via: %s", provider.METHOD) |
| 2233 | creds = provider.load() |
| 2234 | if creds is not None: |
| 2235 | return creds |
| 2236 | |
| 2237 | # If we got here, no credentials could be found. |
| 2238 | # This feels like it should be an exception, but historically, ``None`` |
| 2239 | # is returned. |
| 2240 | # |
| 2241 | # +1 |
| 2242 | # -js |
| 2243 | return None |
| 2244 | |
| 2245 | |
| 2246 | class SSOCredentialFetcher(CachedCredentialFetcher): |