@@ -17,61 +17,66 @@ class CredentialsConfiguration < Seahorse::Client::Plugin
17
17
option ( :profile ,
18
18
doc_default : 'default' ,
19
19
doc_type : String ,
20
- docstring : <<- DOCS )
21
- Used when loading credentials from the shared credentials file
22
- at HOME/.aws/credentials. When not specified, 'default' is used.
20
+ docstring : <<~ DOCS )
21
+ Used when loading credentials from the shared credentials file at `HOME/.aws/credentials`.
22
+ When not specified, 'default' is used.
23
23
DOCS
24
24
25
25
option ( :credentials ,
26
26
required : true ,
27
27
doc_type : 'Aws::CredentialProvider' ,
28
28
rbs_type : 'untyped' ,
29
- docstring : <<-DOCS
30
- Your AWS credentials. This can be an instance of any one of the
31
- following classes:
32
-
33
- * `Aws::Credentials` - Used for configuring static, non-refreshing
34
- credentials.
35
-
36
- * `Aws::SharedCredentials` - Used for loading static credentials from a
37
- shared file, such as `~/.aws/config`.
38
-
39
- * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
40
-
41
- * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
42
- assume a role after providing credentials via the web.
43
-
44
- * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
45
- access token generated from `aws login`.
46
-
47
- * `Aws::ProcessCredentials` - Used for loading credentials from a
48
- process that outputs to stdout.
49
-
50
- * `Aws::InstanceProfileCredentials` - Used for loading credentials
51
- from an EC2 IMDS on an EC2 instance.
52
-
53
- * `Aws::ECSCredentials` - Used for loading credentials from
54
- instances running in ECS.
55
-
56
- * `Aws::CognitoIdentityCredentials` - Used for loading credentials
57
- from the Cognito Identity service.
58
-
59
- When `:credentials` are not configured directly, the following
60
- locations will be searched for credentials:
61
-
62
- * `Aws.config[:credentials]`
63
- * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
64
- `:account_id` options.
65
- * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
66
- ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
67
- * `~/.aws/credentials`
68
- * `~/.aws/config`
69
- * EC2/ECS IMDS instance profile - When used by default, the timeouts
70
- are very aggressive. Construct and pass an instance of
71
- `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
72
- enable retries and extended timeouts. Instance profile credential
73
- fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
74
- to true.
29
+ docstring : <<~DOCS
30
+ Your AWS credentials used for authentication. This can be an instance of any one of the
31
+ following classes:
32
+
33
+ * `Aws::Credentials` - Used for configuring static, non-refreshing
34
+ credentials.
35
+
36
+ * `Aws::SharedCredentials` - Used for loading static credentials from a
37
+ shared file, such as `~/.aws/config`.
38
+
39
+ * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
40
+
41
+ * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
42
+ assume a role after providing credentials via the web.
43
+
44
+ * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
45
+ access token generated from `aws login`.
46
+
47
+ * `Aws::ProcessCredentials` - Used for loading credentials from a
48
+ process that outputs to stdout.
49
+
50
+ * `Aws::InstanceProfileCredentials` - Used for loading credentials
51
+ from an EC2 IMDS on an EC2 instance.
52
+
53
+ * `Aws::ECSCredentials` - Used for loading credentials from
54
+ instances running in ECS.
55
+
56
+ * `Aws::CognitoIdentityCredentials` - Used for loading credentials
57
+ from the Cognito Identity service.
58
+
59
+ When `:credentials` are not configured directly, the following
60
+ locations will be searched for credentials:
61
+
62
+ * `Aws.config[:credentials]`
63
+
64
+ * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
65
+ `:account_id` options.
66
+
67
+ * `ENV['AWS_ACCESS_KEY_ID']`, `ENV['AWS_SECRET_ACCESS_KEY']`,
68
+ `ENV['AWS_SESSION_TOKEN']`, and `ENV['AWS_ACCOUNT_ID']`.
69
+
70
+ * `~/.aws/credentials`
71
+
72
+ * `~/.aws/config`
73
+
74
+ * EC2/ECS IMDS instance profile - When used by default, the timeouts
75
+ are very aggressive. Construct and pass an instance of
76
+ `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
77
+ enable retries and extended timeouts. Instance profile credential
78
+ fetching can be disabled by setting `ENV['AWS_EC2_METADATA_DISABLED']`
79
+ to `true`.
75
80
DOCS
76
81
) do |config |
77
82
CredentialProviderChain . new ( config ) . resolve
@@ -82,25 +87,40 @@ class CredentialsConfiguration < Seahorse::Client::Plugin
82
87
option ( :instance_profile_credentials_timeout , 1 )
83
88
84
89
option ( :token_provider ,
85
- required : false ,
86
- doc_type : 'Aws::TokenProvider' ,
87
- rbs_type : 'untyped' ,
88
- docstring : <<-DOCS
89
- A Bearer Token Provider. This can be an instance of any one of the
90
- following classes:
91
-
92
- * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
93
- tokens.
94
-
95
- * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
96
- access token generated from `aws login`.
97
-
98
- When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
99
- will be used to search for tokens configured for your profile in shared configuration files.
100
- DOCS
90
+ doc_type : 'Aws::TokenProvider' ,
91
+ rbs_type : 'untyped' ,
92
+ docstring : <<~DOCS
93
+ Your Bearer token used for authentication. This can be an instance of any one of the
94
+ following classes:
95
+
96
+ * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
97
+ tokens.
98
+
99
+ * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
100
+ access token generated from `aws login`.
101
+
102
+ When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
103
+ will be used to search for tokens configured for your profile in shared configuration files.
104
+ DOCS
101
105
) do |config |
102
106
TokenProviderChain . new ( config ) . resolve
103
107
end
108
+
109
+ option ( :auth_scheme_preference ,
110
+ doc_type : 'Array<String>' ,
111
+ rbs_type : 'Array[String]' ,
112
+ docstring : <<~DOCS
113
+ A list of preferred authentication schemes to use when making a request. Supported values are:
114
+ `sigv4`, `sigv4a`, `httpBearerAuth`, and `noAuth`. When set using `ENV['AWS_AUTH_SCHEME_PREFERENCE']` or in
115
+ shared config as `auth_scheme_preference`, the value should be a comma-separated list.
116
+ DOCS
117
+ ) do |config |
118
+ value =
119
+ ENV [ 'AWS_AUTH_SCHEME_PREFERENCE' ] ||
120
+ Aws . shared_config . auth_scheme_preference ( profile : config . profile ) ||
121
+ ''
122
+ value . gsub ( ' ' , '' ) . gsub ( "\t " , '' ) . split ( ',' )
123
+ end
104
124
end
105
125
end
106
126
end
0 commit comments