aws-sdk 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aws.rb +1 -1
- data/lib/aws/api_config/STS-2011-06-15.yml +56 -0
- data/lib/aws/authorize_with_session_token.rb +29 -0
- data/lib/aws/base_client.rb +35 -77
- data/lib/aws/client_logging.rb +117 -0
- data/lib/aws/configuration.rb +14 -1
- data/lib/aws/default_signer.rb +11 -1
- data/lib/aws/ec2/request.rb +2 -0
- data/lib/aws/option_grammar.rb +22 -1
- data/lib/aws/policy.rb +6 -4
- data/lib/aws/response.rb +9 -2
- data/lib/aws/s3/client.rb +6 -1
- data/lib/aws/s3/object_metadata.rb +33 -2
- data/lib/aws/s3/request.rb +4 -0
- data/lib/aws/s3/s3_object.rb +71 -20
- data/lib/aws/sns/request.rb +2 -0
- data/lib/aws/sqs/request.rb +3 -1
- data/lib/aws/sts.rb +143 -0
- data/lib/aws/sts/client.rb +38 -0
- data/lib/aws/sts/client/xml.rb +38 -0
- data/lib/aws/sts/errors.rb +29 -0
- data/lib/aws/sts/federated_session.rb +58 -0
- data/lib/aws/sts/policy.rb +32 -0
- data/lib/aws/sts/request.rb +27 -0
- data/lib/aws/sts/session.rb +48 -0
- metadata +62 -83
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'aws/base_client'
|
15
|
+
require 'aws/configured_client_methods'
|
16
|
+
require 'aws/sts/request'
|
17
|
+
require 'aws/sts/client/xml'
|
18
|
+
require 'aws/sts/errors'
|
19
|
+
|
20
|
+
module AWS
|
21
|
+
class STS
|
22
|
+
|
23
|
+
# @private
|
24
|
+
class Client < BaseClient
|
25
|
+
|
26
|
+
include ConfiguredClientMethods
|
27
|
+
|
28
|
+
API_VERSION = '2011-06-15'
|
29
|
+
|
30
|
+
REGION_US_E1 = 'sts.amazonaws.com'
|
31
|
+
|
32
|
+
REQUEST_CLASS = STS::Request
|
33
|
+
|
34
|
+
configure_client
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'aws/configured_xml_grammars'
|
15
|
+
require 'aws/ignore_result_element'
|
16
|
+
require 'aws/xml_grammar'
|
17
|
+
|
18
|
+
module AWS
|
19
|
+
class STS
|
20
|
+
class Client < BaseClient
|
21
|
+
|
22
|
+
# @private
|
23
|
+
module XML
|
24
|
+
|
25
|
+
include ConfiguredXmlGrammars
|
26
|
+
|
27
|
+
extend IgnoreResultElement
|
28
|
+
|
29
|
+
BaseError = XmlGrammar.customize do
|
30
|
+
element("Error") { ignore }
|
31
|
+
end
|
32
|
+
|
33
|
+
define_configured_grammars
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'aws/lazy_error_classes'
|
15
|
+
require 'aws/sts/client/xml'
|
16
|
+
|
17
|
+
module AWS
|
18
|
+
class STS
|
19
|
+
|
20
|
+
# @private
|
21
|
+
module Errors
|
22
|
+
|
23
|
+
BASE_ERROR_GRAMMAR = Client::XML::BaseError
|
24
|
+
|
25
|
+
include LazyErrorClasses
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'aws/sts/session'
|
15
|
+
|
16
|
+
module AWS
|
17
|
+
class STS
|
18
|
+
|
19
|
+
# Represents a federated session using temporary AWS credentials.
|
20
|
+
# Use {STS#new_federated_session} to get an instance of this
|
21
|
+
# class.
|
22
|
+
class FederatedSession < Session
|
23
|
+
|
24
|
+
# The string identifying the federated user associated with the
|
25
|
+
# session, similar to the UserId of an IAM user.
|
26
|
+
#
|
27
|
+
# @return [String]
|
28
|
+
attr_reader :user_id
|
29
|
+
|
30
|
+
# The ARN specifying the federated user associated with the
|
31
|
+
# session. For more information about ARNs and how to use them
|
32
|
+
# in policies, see
|
33
|
+
# {http://docs.amazonwebservices.com/IAM/latest/UserGuide/index.html?Using_Identifiers.html
|
34
|
+
# Identifiers for IAM Entities} in <i>Using AWS Identity and
|
35
|
+
# Access Management</i>.
|
36
|
+
#
|
37
|
+
# @return [String]
|
38
|
+
attr_reader :user_arn
|
39
|
+
|
40
|
+
# A percentage value indicating the size of the policy in packed
|
41
|
+
# form. Policies for which the packed size is greater than 100%
|
42
|
+
# of the allowed value are rejected by the service.
|
43
|
+
#
|
44
|
+
# @return [Integer]
|
45
|
+
attr_reader :packed_policy_size
|
46
|
+
|
47
|
+
# @private
|
48
|
+
def initialize(opts = {})
|
49
|
+
@user_id = opts[:user_id]
|
50
|
+
@user_arn = opts[:user_arn]
|
51
|
+
@packed_policy_size = opts[:packed_policy_size]
|
52
|
+
super
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'aws/policy'
|
15
|
+
|
16
|
+
module AWS
|
17
|
+
class STS
|
18
|
+
|
19
|
+
# (see AWS::Policy)
|
20
|
+
class Policy < AWS::Policy
|
21
|
+
|
22
|
+
# (see AWS::Policy#to_h)
|
23
|
+
def to_h
|
24
|
+
h = super
|
25
|
+
h.delete("Id")
|
26
|
+
h
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'aws/http/request'
|
15
|
+
require 'aws/authorize_v3'
|
16
|
+
|
17
|
+
module AWS
|
18
|
+
class STS
|
19
|
+
|
20
|
+
# @private
|
21
|
+
class Request < AWS::Http::Request
|
22
|
+
|
23
|
+
include AuthorizeV2
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
module AWS
|
15
|
+
class STS
|
16
|
+
|
17
|
+
# Represents a session using temporary AWS credentials. Use
|
18
|
+
# {STS#new_session} or {STS#new_federated_session} to get a new
|
19
|
+
# set of temporary credentials.
|
20
|
+
class Session
|
21
|
+
|
22
|
+
# A hash containing the following keys:
|
23
|
+
#
|
24
|
+
# * +:access_key_id+
|
25
|
+
# * +:secret_access_key+
|
26
|
+
# * +:session_token+
|
27
|
+
#
|
28
|
+
# This hash may be passed as-is to {AWS.config} or to the
|
29
|
+
# constructor of any service interface that supports temporary
|
30
|
+
# security credentials from the AWS Security Token Service.
|
31
|
+
#
|
32
|
+
# @return [Hash]
|
33
|
+
attr_reader :credentials
|
34
|
+
|
35
|
+
# The date on which these credentials expire.
|
36
|
+
#
|
37
|
+
# @return [Time]
|
38
|
+
attr_reader :expires_at
|
39
|
+
|
40
|
+
# @private
|
41
|
+
def initialize(opts = {})
|
42
|
+
@credentials = opts[:credentials]
|
43
|
+
@expires_at = opts[:expires_at]
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,93 +1,67 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 1.0.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Amazon Web Services
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2011-07-29 00:00:00 -07:00
|
12
|
+
date: 2011-08-03 00:00:00.000000000 -07:00
|
19
13
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
requirement: &
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: uuidtools
|
17
|
+
requirement: &2163569700 !ruby/object:Gem::Requirement
|
24
18
|
none: false
|
25
|
-
requirements:
|
19
|
+
requirements:
|
26
20
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 1
|
32
|
-
version: "2.1"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.1'
|
33
23
|
type: :runtime
|
34
|
-
name: uuidtools
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
24
|
prerelease: false
|
38
|
-
|
25
|
+
version_requirements: *2163569700
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: httparty
|
28
|
+
requirement: &2163568860 !ruby/object:Gem::Requirement
|
39
29
|
none: false
|
40
|
-
requirements:
|
30
|
+
requirements:
|
41
31
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
- 7
|
47
|
-
version: "0.7"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.7'
|
48
34
|
type: :runtime
|
49
|
-
name: httparty
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
35
|
prerelease: false
|
53
|
-
|
36
|
+
version_requirements: *2163568860
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: nokogiri
|
39
|
+
requirement: &2163568040 !ruby/object:Gem::Requirement
|
54
40
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 15
|
59
|
-
segments:
|
60
|
-
- 1
|
61
|
-
- 4
|
62
|
-
- 4
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
63
44
|
version: 1.4.4
|
64
45
|
type: :runtime
|
65
|
-
name: nokogiri
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
46
|
prerelease: false
|
69
|
-
|
47
|
+
version_requirements: *2163568040
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: json
|
50
|
+
requirement: &2163567300 !ruby/object:Gem::Requirement
|
70
51
|
none: false
|
71
|
-
requirements:
|
52
|
+
requirements:
|
72
53
|
- - ~>
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
segments:
|
76
|
-
- 1
|
77
|
-
- 4
|
78
|
-
version: "1.4"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.4'
|
79
56
|
type: :runtime
|
80
|
-
|
81
|
-
version_requirements: *
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *2163567300
|
82
59
|
description: AWS SDK for Ruby
|
83
60
|
email:
|
84
61
|
executables: []
|
85
|
-
|
86
62
|
extensions: []
|
87
|
-
|
88
63
|
extra_rdoc_files: []
|
89
|
-
|
90
|
-
files:
|
64
|
+
files:
|
91
65
|
- ca-bundle.crt
|
92
66
|
- rails/init.rb
|
93
67
|
- lib/aws/api_config.rb
|
@@ -95,8 +69,10 @@ files:
|
|
95
69
|
- lib/aws/async_handle.rb
|
96
70
|
- lib/aws/authorize_v2.rb
|
97
71
|
- lib/aws/authorize_v3.rb
|
72
|
+
- lib/aws/authorize_with_session_token.rb
|
98
73
|
- lib/aws/base_client.rb
|
99
74
|
- lib/aws/cacheable.rb
|
75
|
+
- lib/aws/client_logging.rb
|
100
76
|
- lib/aws/common.rb
|
101
77
|
- lib/aws/configurable.rb
|
102
78
|
- lib/aws/configuration.rb
|
@@ -281,6 +257,14 @@ files:
|
|
281
257
|
- lib/aws/sqs/received_sns_message.rb
|
282
258
|
- lib/aws/sqs/request.rb
|
283
259
|
- lib/aws/sqs.rb
|
260
|
+
- lib/aws/sts/client/xml.rb
|
261
|
+
- lib/aws/sts/client.rb
|
262
|
+
- lib/aws/sts/errors.rb
|
263
|
+
- lib/aws/sts/federated_session.rb
|
264
|
+
- lib/aws/sts/policy.rb
|
265
|
+
- lib/aws/sts/request.rb
|
266
|
+
- lib/aws/sts/session.rb
|
267
|
+
- lib/aws/sts.rb
|
284
268
|
- lib/aws/uri_escape.rb
|
285
269
|
- lib/aws/xml_grammar.rb
|
286
270
|
- lib/aws-sdk.rb
|
@@ -290,6 +274,7 @@ files:
|
|
290
274
|
- lib/aws/api_config/SimpleEmailService-2010-12-01.yml
|
291
275
|
- lib/aws/api_config/SNS-2010-03-31.yml
|
292
276
|
- lib/aws/api_config/SQS-2009-02-01.yml
|
277
|
+
- lib/aws/api_config/STS-2011-06-15.yml
|
293
278
|
- lib/aws/api_config/.document
|
294
279
|
- .yardopts
|
295
280
|
- README.rdoc
|
@@ -297,37 +282,31 @@ files:
|
|
297
282
|
- LICENSE.txt
|
298
283
|
has_rdoc: true
|
299
284
|
homepage: http://aws.amazon.com/sdkforruby
|
300
|
-
licenses:
|
285
|
+
licenses:
|
301
286
|
- Apache 2.0
|
302
287
|
post_install_message:
|
303
288
|
rdoc_options: []
|
304
|
-
|
305
|
-
require_paths:
|
289
|
+
require_paths:
|
306
290
|
- lib
|
307
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
291
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
308
292
|
none: false
|
309
|
-
requirements:
|
310
|
-
- -
|
311
|
-
- !ruby/object:Gem::Version
|
312
|
-
|
313
|
-
segments:
|
293
|
+
requirements:
|
294
|
+
- - ! '>='
|
295
|
+
- !ruby/object:Gem::Version
|
296
|
+
version: '0'
|
297
|
+
segments:
|
314
298
|
- 0
|
315
|
-
|
316
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
299
|
+
hash: -4467582824639949942
|
300
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
317
301
|
none: false
|
318
|
-
requirements:
|
319
|
-
- -
|
320
|
-
- !ruby/object:Gem::Version
|
321
|
-
|
322
|
-
segments:
|
323
|
-
- 0
|
324
|
-
version: "0"
|
302
|
+
requirements:
|
303
|
+
- - ! '>='
|
304
|
+
- !ruby/object:Gem::Version
|
305
|
+
version: '0'
|
325
306
|
requirements: []
|
326
|
-
|
327
307
|
rubyforge_project:
|
328
|
-
rubygems_version: 1.6.
|
308
|
+
rubygems_version: 1.6.1
|
329
309
|
signing_key:
|
330
310
|
specification_version: 3
|
331
311
|
summary: AWS SDK for Ruby
|
332
312
|
test_files: []
|
333
|
-
|