souls 1.20.5 → 1.20.6

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: 9f20859432dd84ab8d0a5db2aa295667e1bb9b3655e7bdce6beb974b67fbb9df
4
- data.tar.gz: 9fb1875d5d7e82e793b07195961d2e3af77bb6c9b9c28c67c57703e6773fbc8b
3
+ metadata.gz: bb1296ed9c656429b40bb07287161bd5dddcfcec40deeaeb72717a572226f3a7
4
+ data.tar.gz: 257349200dd975825e37b26294ce3cdcedb451378a1a1e8f9c45f4ae79414997
5
5
  SHA512:
6
- metadata.gz: ca84e2c3a6cd8de4e9f65adf7769649ee0a0038c00159cc145b712e21bef61b7af50a6bb0ac1a788edf4ed063364266ceed7ccecbf70cc5cf48bf23951207345
7
- data.tar.gz: 7ce9feefa649bf2374d528571ce2946adfa36abb12669258d5b962e9d9e85cf3d168056977823753f2a3f43275c22cb1fa9a71c12571147e928da4f6939f92ba
6
+ metadata.gz: ed6365789bd1ca68d5c1c90a47c30ab089e79a0bce1daa4b35a57a939ab363f25d1a241e299357eb3e9c5785b3161914285f4d937f95094fdcac740635c52b60
7
+ data.tar.gz: 42ce53e3b8a323be05917304bb5ffc3942fb676fefd4a0c3fb25edc070a37251c7fa0df7f44b6f1fddb108662af3741f2cfafb7056aa344ef242f6d0f2462557
@@ -1,6 +1,6 @@
1
1
  module SOULs
2
2
  class SOULsMutation < GraphQL::Schema::RelayClassicMutation
3
- def self.post(url:, payload: {}, content_type: "application/json")
3
+ def post(url:, payload: {}, content_type: "application/json")
4
4
  response = Faraday.post(url, payload.to_json, "Content-Type": content_type)
5
5
  response.body
6
6
  end
@@ -18,7 +18,7 @@ module SOULs
18
18
  end
19
19
  end
20
20
 
21
- def self.souls_check_user_permissions(user, obj, method)
21
+ def souls_check_user_permissions(user, obj, method)
22
22
  raise(StandardError, "Invalid or Missing Token") unless user
23
23
 
24
24
  policy_class = obj.class.name + "Policy"
@@ -27,7 +27,7 @@ module SOULs
27
27
  raise(Pundit::NotAuthorizedError, "permission error!") unless permission
28
28
  end
29
29
 
30
- def self.souls_fb_auth(token:)
30
+ def souls_fb_auth(token:)
31
31
  FirebaseIdToken::Certificates.request!
32
32
  sleep(3) if ENV["RACK_ENV"] == "development"
33
33
  user = FirebaseIdToken::Signature.verify(token)
@@ -36,13 +36,13 @@ module SOULs
36
36
  user
37
37
  end
38
38
 
39
- def self.souls_publish_pubsub_queue(topic_name: "send-mail-job", message: "text!")
39
+ def souls_publish_pubsub_queue(topic_name: "send-mail-job", message: "text!")
40
40
  pubsub = Google::Cloud::Pubsub.new(project: ENV["SOULS_GCP_PROJECT_ID"])
41
41
  topic = pubsub.topic(topic_name)
42
42
  topic.publish(message)
43
43
  end
44
44
 
45
- def self.souls_make_graphql_query(query: "newCommentMailer", args: {})
45
+ def souls_make_graphql_query(query: "newCommentMailer", args: {})
46
46
  if args.blank?
47
47
  query_string = %(query { #{query.to_s.underscore.camelize(:lower)} { response } })
48
48
  else
@@ -60,27 +60,27 @@ module SOULs
60
60
  query_string
61
61
  end
62
62
 
63
- def self.souls_post_to_dev(worker_name: "", query_string: "")
63
+ def souls_post_to_dev(worker_name: "", query_string: "")
64
64
  port = souls_get_worker(worker_name: worker_name)[0][:port]
65
65
  endpoint = SOULs.configuration.endpoint
66
66
  res = Net::HTTP.post_form(URI.parse("http://localhost:#{port}#{endpoint}"), { query: query_string })
67
67
  res.body
68
68
  end
69
69
 
70
- def self.souls_get_worker(worker_name: "")
70
+ def souls_get_worker(worker_name: "")
71
71
  workers = SOULs.configuration.workers
72
72
  workers.filter { |n| n[:name] == worker_name }
73
73
  end
74
74
 
75
- def self.souls_auth_check(context)
75
+ def souls_auth_check(context)
76
76
  raise(GraphQL::ExecutionError, "You need to sign in!!") if context[:user].nil?
77
77
  end
78
78
 
79
- def self.production?
79
+ def production?
80
80
  ENV["RACK_ENV"] == "production"
81
81
  end
82
82
 
83
- def self.get_instance_id
83
+ def get_instance_id
84
84
  `curl http://metadata.google.internal/computeMetadata/v1/instance/id -H Metadata-Flavor:Google`
85
85
  end
86
86
  end
@@ -5,12 +5,12 @@ module SOULs
5
5
  attr_accessor :schedule
6
6
  end
7
7
 
8
- def self.post(url:, payload: {}, content_type: "application/json")
8
+ def post(url:, payload: {}, content_type: "application/json")
9
9
  response = Faraday.post(url, payload.to_json, "Content-Type": content_type)
10
10
  response.body
11
11
  end
12
12
 
13
- def self.check_user_permissions(user, obj, method)
13
+ def check_user_permissions(user, obj, method)
14
14
  raise(StandardError, "Invalid or Missing Token") unless user
15
15
 
16
16
  policy_class = obj.class.name + "Policy"
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "1.20.5".freeze
2
+ VERSION = "1.20.6".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.20.5
1
+ 1.20.6
@@ -1 +1 @@
1
- 1.20.5
1
+ 1.20.6
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.5
4
+ version: 1.20.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI