discourse_subscription_client 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfa8eae85ceafc3eed01ca40cddaa4569bd0c93bc2293823351c42fa66df5bad
|
4
|
+
data.tar.gz: 66dde7bd6855900991d24869c2a3c75147f3995621cbfb82b49f532ec2c0b9fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37fdeaff464660bc50bc01488817df7ebc26152ec03af6439c3b71eb37c7c2506d8aa7c0ba5ce0fa2f8e913b2f2ed05b6466c590a5d36d0e3afb9877e4bbb87b
|
7
|
+
data.tar.gz: 65da8d91da25b4f43f3233d6740fb2bf1c284741db0c3dfc2b3810622b8de68b5f70b4fc578d27b2aa890ec152fd5d8d24ccba9f1ae1ba320b6531c7027f7ead
|
@@ -7,13 +7,6 @@ class SubscriptionClientResource < ActiveRecord::Base
|
|
7
7
|
has_many :notices, class_name: "SubscriptionClientNotice", as: :notice_subject, dependent: :destroy
|
8
8
|
has_many :subscriptions, foreign_key: "resource_id", class_name: "SubscriptionClientSubscription", dependent: :destroy
|
9
9
|
|
10
|
-
def get_source_url(bucket)
|
11
|
-
return nil unless access_key_id && secret_access_key && s3_client
|
12
|
-
return nil unless can_access_bucket?(bucket)
|
13
|
-
|
14
|
-
"s3://#{CGI.escapeURIComponent(access_key_id)}:#{CGI.escapeURIComponent(secret_access_key)}@#{bucket}"
|
15
|
-
end
|
16
|
-
|
17
10
|
def can_access_bucket?(bucket)
|
18
11
|
s3_client.head_bucket(bucket: bucket)
|
19
12
|
true
|
@@ -28,12 +21,16 @@ class SubscriptionClientResource < ActiveRecord::Base
|
|
28
21
|
return nil unless access_key_id && secret_access_key
|
29
22
|
|
30
23
|
Aws::S3::Client.new(
|
31
|
-
region:
|
24
|
+
region: region,
|
32
25
|
access_key_id: access_key_id,
|
33
26
|
secret_access_key: secret_access_key
|
34
27
|
)
|
35
28
|
end
|
36
29
|
end
|
30
|
+
|
31
|
+
def region
|
32
|
+
"us-east-1"
|
33
|
+
end
|
37
34
|
end
|
38
35
|
|
39
36
|
# == Schema Information
|