web_identity_credentials.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930
  1. import {Credentials} from '../credentials';
  2. import {AWSError} from '../error';
  3. import {ConfigurationOptions} from '../config-base';
  4. import STS = require('../../clients/sts');
  5. export class WebIdentityCredentials extends Credentials {
  6. /**
  7. * Creates a new credentials object with optional configuraion.
  8. * @param {Object} options - a map of options that are passed to the AWS.STS.assumeRole() or AWS.STS.getSessionToken() operations. If a RoleArn parameter is passed in, credentials will be based on the IAM role.
  9. * @param {Object} clientConfig - a map of configuration options to pass to the underlying STS client.
  10. */
  11. constructor(options: WebIdentityCredentials.WebIdentityCredentialsOptions, clientConfig?: ConfigurationOptions);
  12. /**
  13. * Creates a new credentials object.
  14. * @param {string} options - a map of options that are passed to the AWS.STS.assumeRole() or AWS.STS.getSessionToken() operations. If a RoleArn parameter is passed in, credentials will be based on the IAM role.
  15. */
  16. constructor(options?: WebIdentityCredentials.WebIdentityCredentialsOptions);
  17. /**
  18. * Refreshes credentials using AWS.STS.assumeRoleWithWebIdentity().
  19. */
  20. refresh(callback: (err?: AWSError) => void): void;
  21. data: STS.Types.AssumeRoleWithWebIdentityResponse;
  22. params: STS.Types.AssumeRoleWithWebIdentityRequest
  23. }
  24. // Needed to expose interfaces on the class
  25. declare namespace WebIdentityCredentials {
  26. export type ClientConfiguration = ConfigurationOptions;
  27. export type WebIdentityCredentialsOptions = STS.AssumeRoleWithWebIdentityRequest;
  28. }