credential_provider_chain.d.ts 1023 B

123456789101112131415161718192021222324
  1. import {Credentials} from '../credentials';
  2. import {AWSError} from '../error';
  3. export class CredentialProviderChain {
  4. /**
  5. * Creates a new CredentialProviderChain with a default set of providers specified by defaultProviders.
  6. */
  7. constructor(providers?: provider[])
  8. /**
  9. * Resolves the provider chain by searching for the first set of credentials in providers.
  10. */
  11. resolve(callback:(err: AWSError|null, credentials?: Credentials) => void): CredentialProviderChain;
  12. /**
  13. * Return a Promise on resolve() function
  14. */
  15. resolvePromise(): Promise<Credentials>;
  16. /**
  17. * Returns a list of credentials objects or functions that return credentials objects. If the provider is a function, the function will be executed lazily when the provider needs to be checked for valid credentials. By default, this object will be set to the defaultProviders.
  18. */
  19. providers: Array<Credentials|provider>;
  20. static defaultProviders: provider[]
  21. }
  22. type provider = () => Credentials;