Class: AWS::Core::CredentialProviders::FakeProvider

Inherits:
StaticProvider
  • Object
show all
Defined in:
lib/aws/core/credential_providers.rb

Overview

Returns a set of fake credentials, should only be used for testing.

Constant Summary

Constants included from Provider

Provider::KEYS

Instance Method Summary collapse

Methods included from Provider

#access_key_id, #credentials, #refresh, #secret_access_key, #session_token

Constructor Details

#initialize(options = {}) ⇒ FakeProvider

Returns a new instance of FakeProvider.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :with_session_token (Boolean) — default: false

    When true a fake session token will also be provided.



429
430
431
432
433
434
435
436
# File 'lib/aws/core/credential_providers.rb', line 429

def initialize options = {}
  options[:access_key_id] ||= fake_access_key_id
  options[:secret_access_key] ||= fake_secret_access_key
  if options.delete(:with_session_token)
    options[:session_token] ||= fake_session_token
  end
  super
end