Class: Aws::ProcessCredentials
- Inherits:
-
Object
- Object
- Aws::ProcessCredentials
- Includes:
- CredentialProvider
- Defined in:
- gems/aws-sdk-core/lib/aws-sdk-core/process_credentials.rb
Overview
A credential provider that executes a given process and attempts to read its stdout to receive a JSON payload containing the credentials.
credentials = Aws::ProcessCredentials.new(['/usr/bin/credential_proc'])
ec2 = Aws::EC2::Client.new(credentials: credentials)
Arguments should be provided as strings in the array, for example:
process = ['/usr/bin/credential_proc', 'arg1', 'arg2']
credentials = Aws::ProcessCredentials.new(process)
ec2 = Aws::EC2::Client.new(credentials: credentials)
Automatically handles refreshing credentials if an Expiration time is provided in the credentials payload.
Instance Attribute Summary
Attributes included from CredentialProvider
Instance Method Summary collapse
-
#initialize(process) ⇒ ProcessCredentials
constructor
Creates a new ProcessCredentials object, which allows an external process to be used as a credential provider.
Methods included from CredentialProvider
Constructor Details
#initialize(process) ⇒ ProcessCredentials
Creates a new ProcessCredentials object, which allows an external process to be used as a credential provider.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'gems/aws-sdk-core/lib/aws-sdk-core/process_credentials.rb', line 31 def initialize(process) if process.is_a?(String) warn('Passing a single string to Aws::ProcessCredentials.new '\ 'is insecure, please use use an array of system arguments instead') end @process = process @credentials = credentials_from_process @async_refresh = false super end |