Class: Awskeyring::CredentialProvider
- Inherits:
-
Object
- Object
- Awskeyring::CredentialProvider
- Includes:
- Aws::CredentialProvider
- Defined in:
- lib/awskeyring/credential_provider.rb
Overview
Provide a credential provider for use as a library, eg.
require 'awskeyring/credential_provider'
client = Aws::STS::Client.new(
credentials: Awskeyring::CredentialProvider.new("company-acc")
)
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
Instance Method Summary collapse
-
#credentials ⇒ Object
returns a new Aws::Credentials object.
-
#initialize(account) ⇒ CredentialProvider
constructor
A new instance of CredentialProvider.
Constructor Details
#initialize(account) ⇒ CredentialProvider
Returns a new instance of CredentialProvider.
17 18 19 |
# File 'lib/awskeyring/credential_provider.rb', line 17 def initialize(account) @account = account end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
15 16 17 |
# File 'lib/awskeyring/credential_provider.rb', line 15 def account @account end |
Instance Method Details
#credentials ⇒ Object
returns a new Aws::Credentials object
22 23 24 25 26 27 |
# File 'lib/awskeyring/credential_provider.rb', line 22 def credentials cred = Awskeyring.get_valid_creds(account: account) Aws::Credentials.new(cred[:key], cred[:secret], cred[:token]) end |