sync_attr_with_auth0 0.0.16 → 0.0.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 218422160f3d6a380d6f44db0f523bd26d513dbe
4
- data.tar.gz: 0cad0b6561cf3419589672c5ae448c799e86fb7a
3
+ metadata.gz: 7d47864e5208a3f13c3ff36733e1ee8dcac70253
4
+ data.tar.gz: 83cb612d3328cb3edbf86573b81bc1e7aa64cce5
5
5
  SHA512:
6
- metadata.gz: 4b27b11f1409e36f29b278d7a50aa1cd79a1c20048fcc59125dcaa4700ee35c9785f76483e7f9be0545c4f0c3e870fddbf90291929036e49762b801fa2030589
7
- data.tar.gz: c8180144dbf54589510a00c9fad29fb9769285fbffe4107329f4698b9fba07b8545a81a19b5c0aa168fcc2df2dba0c6514a768369253d631aa7873d377d4754a
6
+ metadata.gz: 03e2982ecd4fbea464189dcec8b2f92c0307c702f44e44657f7e0d3bce085c69441ebd7bfe6470dca9b41a5f2ef781710c91d5f7dd4a33c0cb08b96c27c56f54
7
+ data.tar.gz: 9fdfc779cac98b76990d802917661e172cc729a22b5d1f688e47b66255084f53f3a51552a86010396663496018e740bc2a61cd489c4728a0e50cc0fd9a5b908f
@@ -9,6 +9,7 @@ module SyncAttrWithAuth0
9
9
  def sync_attr_with_auth0(options = {})
10
10
  class_attribute :auth0_sync_options
11
11
 
12
+ verify_environment_variables
12
13
  merge_default_options(options)
13
14
 
14
15
  after_validation :validate_email_with_auth0
@@ -18,6 +19,21 @@ module SyncAttrWithAuth0
18
19
 
19
20
  private
20
21
 
22
+ def verify_environment_variables
23
+ env_variables = %w(AUTH0_GLOBAL_CLIENT_ID AUTH0_GLOBAL_CLIENT_SECRET AUTH0_CLIENT_ID AUTH0_CLIENT_SECRET AUTH0_DOMAIN)
24
+ missing_env_variables = []
25
+
26
+ env_variables.each do |env_variable_name|
27
+ unless ENV[env_variable_name]
28
+ missing_env_variables << env_variable_name
29
+ end
30
+ end
31
+
32
+ if missing_env_variables.size > 0
33
+ raise Exception.new("Missing the following required environment variables: #{missing_env_variables.join(',')}")
34
+ end
35
+ end
36
+
21
37
  def merge_default_options(options)
22
38
  self.auth0_sync_options = {
23
39
  uid_att: :uid,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sync_attr_with_auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 2.2.2
169
+ rubygems_version: 2.4.6
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Synchronize attributes on a local ActiveRecord user model with the user metadata