static_token_provider.js 791 B

123456789101112131415161718192021222324252627
  1. var AWS = require('../core');
  2. /**
  3. * Represents the simplest token provider. It returns a static token string
  4. * and has an optional expireTime.
  5. */
  6. AWS.StaticTokenProvider = AWS.util.inherit(AWS.Token, {
  7. /**
  8. * Creates a new StaticTokenProvider class with a given {token} and
  9. * optional {expireTime}.
  10. *
  11. * ```javascript
  12. * var staticTokenProvider = new AWS.StaticTokenProvider({
  13. * token: 'token'
  14. * });
  15. * staticTokenProvider.token == 'token' // from constructor
  16. * ```
  17. *
  18. * @option options token [String] represents the literal token string.
  19. * @option options expireTime [Date] optional field representing the time at which
  20. * the token expires.
  21. */
  22. constructor: function StaticTokenProvider(options) {
  23. AWS.Token.call(this, options);
  24. }
  25. });