fog-aws 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fog/aws/kms.rb +1 -1
- data/lib/fog/aws/requests/sns/add_permission.rb +13 -1
- data/lib/fog/aws/requests/sns/create_topic.rb +1 -0
- data/lib/fog/aws/requests/sns/remove_permission.rb +8 -1
- data/lib/fog/aws/sns.rb +1 -0
- data/lib/fog/aws/version.rb +1 -1
- data/tests/requests/sns/topic_tests.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b755e78b954c63b5857d91ec7054021ad448bf51
|
4
|
+
data.tar.gz: f9f118f04869ec1ec925fda14d3a896a7a48c40f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 824e71f7f75c19fd9e0d0fea083f3538f7f302f763d532eaa92f51d111e9bc4afaa4f406f88e856c19fcdda555ce4bbb5e40c6a8b860996ce1df06ccdc43d7be
|
7
|
+
data.tar.gz: 68e19eed81bd3f187ac2f39cc12b5a8389af3cc077d2ef2459392a6acfa2601b6732c79926392e10fc1cc7ff84d92cdf6ebc03b8613eac94dbe67f9aea0d7fd1
|
data/lib/fog/aws/kms.rb
CHANGED
@@ -14,7 +14,19 @@ module Fog
|
|
14
14
|
|
15
15
|
class Mock
|
16
16
|
def add_permission(options = {})
|
17
|
-
|
17
|
+
topic_arn = options.delete('TopicArn')
|
18
|
+
label = options.delete('Label')
|
19
|
+
actions = Hash[options.select { |k,v| k.match(/^ActionName/) }].values
|
20
|
+
members = Hash[options.select { |k,v| k.match(/^AWSAccountId/) }].values
|
21
|
+
|
22
|
+
self.data[:permissions][topic_arn][label] = {
|
23
|
+
:members => members,
|
24
|
+
:actions => actions,
|
25
|
+
}
|
26
|
+
|
27
|
+
response = Excon::Response.new
|
28
|
+
response.body = {"RequestId" => Fog::AWS::Mock.request_id}
|
29
|
+
response
|
18
30
|
end
|
19
31
|
end
|
20
32
|
end
|
@@ -38,6 +38,7 @@ module Fog
|
|
38
38
|
"EffectiveDeliveryPolicy" => %Q|{"http":{"defaultHealthyRetryPolicy":{"minDelayTarget":20,"maxDelayTarget":20,"numRetries":3,"numMaxDelayRetries":0,"numNoDelayRetries":0,"numMinDelayRetries":0,"backoffFunction":"linear"},"disableSubscriptionOverrides":false}}|,
|
39
39
|
"Policy" => %Q|{"Version":"2008-10-17","Id":"__default_policy_ID","Statement":[{"Sid":"__default_statement_ID","Effect":"Allow","Principal":{"AWS":"*"},"Action":["SNS:Publish","SNS:RemovePermission","SNS:SetTopicAttributes","SNS:DeleteTopic","SNS:ListSubscriptionsByTopic","SNS:GetTopicAttributes","SNS:Receive","SNS:AddPermission","SNS:Subscribe"],"Resource":"arn:aws:sns:us-east-1:990279267269:Smithy","Condition":{"StringEquals":{"AWS:SourceOwner":"990279267269"}}}]}|
|
40
40
|
}
|
41
|
+
self.data[:permissions][topic_arn] = {}
|
41
42
|
response.body = {"TopicArn" => topic_arn, "RequestId" => Fog::AWS::Mock.request_id}
|
42
43
|
response
|
43
44
|
end
|
@@ -14,7 +14,14 @@ module Fog
|
|
14
14
|
|
15
15
|
class Mock
|
16
16
|
def remove_permission(options = {})
|
17
|
-
|
17
|
+
topic_arn = options['TopicArn']
|
18
|
+
label = options['Label']
|
19
|
+
|
20
|
+
self.data[:permissions][topic_arn].delete(label)
|
21
|
+
|
22
|
+
response = Excon::Response.new
|
23
|
+
response.body = {"RequestId" => Fog::AWS::Mock.request_id}
|
24
|
+
response
|
18
25
|
end
|
19
26
|
end
|
20
27
|
end
|
data/lib/fog/aws/sns.rb
CHANGED
data/lib/fog/aws/version.rb
CHANGED
@@ -32,6 +32,14 @@ Shindo.tests('AWS::SNS | topic lifecycle tests', ['aws', 'sns']) do
|
|
32
32
|
Fog::AWS[:sns].get_topic_attributes(@topic_arn).body
|
33
33
|
end
|
34
34
|
|
35
|
+
tests("#add_permission('#{@topic_arn}')").formats(AWS::SNS::Formats::BASIC) do
|
36
|
+
Fog::AWS[:sns].add_permission('TopicArn' => @topic_arn, 'Label' => 'Test', 'ActionName.member.1' => 'Subscribe', 'AWSAccountId.member.1' => '1234567890').body
|
37
|
+
end
|
38
|
+
|
39
|
+
tests("#remove_permission('#{@topic_arn}')").formats(AWS::SNS::Formats::BASIC) do
|
40
|
+
Fog::AWS[:sns].remove_permission('TopicArn' => @topic_arn, 'Label' => 'Test').body
|
41
|
+
end
|
42
|
+
|
35
43
|
tests("#delete_topic('#{@topic_arn}')").formats(AWS::SNS::Formats::BASIC) do
|
36
44
|
Fog::AWS[:sns].delete_topic(@topic_arn).body
|
37
45
|
end
|