Module: Aws::RefreshingCredentials Private

Included in:
AssumeRoleCredentials, ECSCredentials, InstanceProfileCredentials
Defined in:
lib/aws-sdk-core/refreshing_credentials.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Base class used credential classes that can be refreshed. This provides basic refresh logic in a thread-safe manor. Classes mixing in this module are expected to implement a #refresh method that populates the following instance variables:

  • ‘@access_key_id`

  • ‘@secret_access_key`

  • ‘@session_token`

  • ‘@expiration`

API:

  • private

Instance Method Summary collapse

Instance Method Details

#credentialsCredentials

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

API:

  • private



24
25
26
27
# File 'lib/aws-sdk-core/refreshing_credentials.rb', line 24

def credentials
  refresh_if_near_expiration
  @credentials
end

#expirationTime?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

API:

  • private



30
31
32
33
# File 'lib/aws-sdk-core/refreshing_credentials.rb', line 30

def expiration
  refresh_if_near_expiration
  @expiration
end

#initialize(options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



18
19
20
21
# File 'lib/aws-sdk-core/refreshing_credentials.rb', line 18

def initialize(options = {})
  @mutex = Mutex.new
  refresh
end

#refresh!void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Refresh credentials.

API:

  • private



37
38
39
# File 'lib/aws-sdk-core/refreshing_credentials.rb', line 37

def refresh!
  @mutex.synchronize { refresh }
end