chainable_temporary_credentials.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930
  1. import {Credentials} from '../credentials';
  2. import {AWSError} from '../error';
  3. import STS = require('../../clients/sts');
  4. export class ChainableTemporaryCredentials extends Credentials {
  5. constructor(options: ChainableTemporaryCredentials.ChainableTemporaryCredentialsOptions);
  6. /**
  7. * Creates a new temporary credentials object.
  8. */
  9. constructor(options?: ChainableTemporaryCredentials.ChainableTemporaryCredentialsOptions);
  10. /**
  11. * Refreshes credentials using AWS.STS.assumeRole() or AWS.STS.getSessionToken(), depending on whether an IAM role ARN was passed to the credentials constructor().
  12. */
  13. refresh(callback: (err: AWSError) => void): void;
  14. /**
  15. * The STS service instance used to get and refresh temporary credentials from AWS STS.
  16. */
  17. readonly service: STS
  18. }
  19. // Needed to expose interfaces on the class
  20. declare namespace ChainableTemporaryCredentials {
  21. export type ChainableTemporaryCredentialsOptions = {
  22. params?: STS.Types.AssumeRoleRequest|STS.Types.GetSessionTokenRequest,
  23. masterCredentials?: Credentials,
  24. stsConfig?: STS.Types.ClientConfiguration,
  25. tokenCodeFn?: (serialNumber: string, callback: (err?: Error, token?: string) => void) => void
  26. }
  27. }