Class: Aws::Credentials
- Inherits:
-
Object
- Object
- Aws::Credentials
- Defined in:
- lib/aws-sdk-core/credentials.rb
Instance Attribute Summary collapse
- #access_key_id ⇒ String readonly
- #account_id ⇒ String? readonly
-
#metrics ⇒ Object
private
Returns the credentials source.
- #secret_access_key ⇒ String readonly
- #session_token ⇒ String? readonly
Instance Method Summary collapse
- #credentials ⇒ Credentials
-
#initialize(access_key_id, secret_access_key, session_token = nil, **kwargs) ⇒ Credentials
constructor
A new instance of Credentials.
-
#inspect ⇒ Object
private
Removing the secret access key from the default inspect string.
-
#set? ⇒ Boolean
Returns ‘true` if the access key id and secret access key are both set.
Constructor Details
#initialize(access_key_id, secret_access_key, session_token = nil, **kwargs) ⇒ Credentials
Returns a new instance of Credentials.
11 12 13 14 15 16 17 18 |
# File 'lib/aws-sdk-core/credentials.rb', line 11 def initialize(access_key_id, secret_access_key, session_token = nil, **kwargs) @access_key_id = access_key_id @secret_access_key = secret_access_key @session_token = session_token @account_id = kwargs[:account_id] @metrics = ['CREDENTIALS_CODE'] end |
Instance Attribute Details
#access_key_id ⇒ String (readonly)
21 22 23 |
# File 'lib/aws-sdk-core/credentials.rb', line 21 def access_key_id @access_key_id end |
#account_id ⇒ String? (readonly)
30 31 32 |
# File 'lib/aws-sdk-core/credentials.rb', line 30 def account_id @account_id end |
#metrics ⇒ 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.
Returns the credentials source. Used for tracking credentials related UserAgent metrics.
35 36 37 |
# File 'lib/aws-sdk-core/credentials.rb', line 35 def metrics @metrics end |
#secret_access_key ⇒ String (readonly)
24 25 26 |
# File 'lib/aws-sdk-core/credentials.rb', line 24 def secret_access_key @secret_access_key end |
#session_token ⇒ String? (readonly)
27 28 29 |
# File 'lib/aws-sdk-core/credentials.rb', line 27 def session_token @session_token end |
Instance Method Details
#credentials ⇒ Credentials
38 39 40 |
# File 'lib/aws-sdk-core/credentials.rb', line 38 def credentials self end |
#inspect ⇒ 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.
Removing the secret access key from the default inspect string.
53 54 55 |
# File 'lib/aws-sdk-core/credentials.rb', line 53 def inspect "#<#{self.class.name} access_key_id=#{access_key_id.inspect}>" end |
#set? ⇒ Boolean
Returns ‘true` if the access key id and secret access key are both set.
44 45 46 47 48 49 |
# File 'lib/aws-sdk-core/credentials.rb', line 44 def set? !access_key_id.nil? && !access_key_id.empty? && !secret_access_key.nil? && !secret_access_key.empty? end |