Class: Awskeyring::CredentialProvider

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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 = 
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



15
16
17
# File 'lib/awskeyring/credential_provider.rb', line 15

def 
  @account
end

Instance Method Details

#credentialsObject

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: )
  Aws::Credentials.new(cred[:key],
                       cred[:secret],
                       cred[:token])
end