CARVIEW |
Select Language
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 3214
Connection: keep-alive
Date: Wed, 23 Jul 2025 15:49:21 GMT
Server: Server
Cache-Control: no-store, no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=47304000; includeSubDomains
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: upgrade-insecure-requests; script-src 'self' 'unsafe-inline' *.awsstatic.com *.cdn.uis.awsstatic.com *.cdn.console.awsstatic.com d2c.aws.amazon.com a0.awsstatic.com *.feedback.console.aws.dev insights.docs.aws.com wss://insights.docs.aws.com/prod; object-src 'none';
Last-Modified: Wed, 21 May 2025 18:05:24 GMT
ETag: "VkrzE93zdkgBfPJ9LgTsWnclkh0=-gzip"
Accept-Ranges: bytes
Content-Encoding: gzip
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
X-Cache: Miss from cloudfront
Via: 1.1 d8a08c73e57442ba7d4fdf708da56e92.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: BOM78-P5
X-Amz-Cf-Id: b63G0398-vdF3v76fMDAjCedm1XRlUPNvDIIyAtHZCvmuo_84xx3TQ==
Class: Aws::SharedCredentials
— AWS SDK for Ruby V2
You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::SharedCredentials
- Inherits:
-
Object
- Object
- Aws::SharedCredentials
- Includes:
- CredentialProvider
- Defined in:
- aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Credentials
readonly
-
#path ⇒ String
readonly
-
#profile_name ⇒ String
readonly
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SharedCredentials
constructor
Constructs a new SharedCredentials object.
-
#loadable? ⇒ Boolean
deprecated
Deprecated.
This method is no longer used.
Methods included from CredentialProvider
#access_key_id, #secret_access_key, #session_token, #set?
Constructor Details
#initialize(options = {}) ⇒ SharedCredentials
Constructs a new SharedCredentials object. This will load AWS access
credentials from an ini file, which supports profiles. The default
profile name is 'default'. You can specify the profile name with the
ENV['AWS_PROFILE']
or with the :profile_name
option.
Parameters:
-
[String]
(Hash)
—
a customizable set of options
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb', line 24 def initialize(options = {}) shared_config = Aws.shared_config @path = options[:path] @path ||= shared_config.credentials_path @profile_name = options[:profile_name] @profile_name ||= ENV['AWS_PROFILE'] @profile_name ||= shared_config.profile_name if @path && @path == shared_config.credentials_path @credentials = shared_config.credentials(profile: @profile_name) else config = SharedConfig.new( credentials_path: @path, profile_name: @profile_name ) @credentials = config.credentials(profile: @profile_name) end end |
Instance Attribute Details
#credentials ⇒ Credentials (readonly)
Returns:
49 50 51 |
# File 'aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb', line 49 def credentials @credentials end |
#path ⇒ String (readonly)
Returns:
- (String)
43 44 45 |
# File 'aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb', line 43 def path @path end |
#profile_name ⇒ String (readonly)
Returns:
- (String)
46 47 48 |
# File 'aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb', line 46 def profile_name @profile_name end |
Instance Method Details
#loadable? ⇒ Boolean
Returns:
-
(Boolean)
—
Returns
true
if a credential file exists and has appropriate read permissions at #path.
66 67 68 |
# File 'aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb', line 66 def loadable? !path.nil? && File.exist?(path) && File.readable?(path) end |
Generated on Fri Feb 21 17:25:47 2025 by
yard
0.9.34 (ruby-2.7.8).