omniauth-humanid 0.0.16 → 0.0.21

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: 5a5ed99c0d238cd9c3afee8189db26ec6456234db59c5dbbd281d465aabe8067
4
- data.tar.gz: 43c4d45f752b92f53336e7738f4d63ada4cffa98e15f3c57c8228dcf302bc0d1
3
+ metadata.gz: 99cf10308b8046dfa79c5e8061af8d86960b370e5960125307e39016c5e26d82
4
+ data.tar.gz: f45ad61e2c22e45e84ac78a21e49237c5e65717b9993cd91843812b332adaa85
5
5
  SHA512:
6
- metadata.gz: 4af2cb6d650f53d5f5f1b483390c2f52e4cdce861f865d5645e92418ec60840b69fc2fb397f4dfae21a3f12c20f710ec3981e2cb8d9c4bdde9b8e260b4f9328e
7
- data.tar.gz: bd0a85c43dd29624fb7fe77c00bb3d2d26131c44801b815dbc1dad413b341729326f6786b9f1589f37dff9f1aec51e57013c2dd9b33b41e2acf0f1863fd056ea
6
+ metadata.gz: ed6685f61278e836f589bcdb7f252b3fb3ca03b250411502c371a0aca2cac5519ea44c7abac701d57590a8a92fe92e7d4e2c78b0422af1747a51a14794b8fcfb
7
+ data.tar.gz: 858b1ba735e0c85dc1ffb07126469a0179a65aa21ad4c9bb6efddbaaff9035fec3b3af27db5393ce00036db0be1e810948dd10f33600048971a9b865dfdeadee
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-humanid (0.0.16)
4
+ omniauth-humanid (0.0.21)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/bin/update CHANGED
@@ -26,8 +26,16 @@ x = x.join("\n")
26
26
  puts x
27
27
  File.write('./omniauth-humanid.gemspec', x)
28
28
  puts "_______________________________________________"
29
+ puts "BUNDLE UPDATE"
30
+ puts `bundle update`
31
+ puts "_______________________________________________"
32
+ puts "GIT ADD"
29
33
  puts `git add *`
30
34
  puts "_______________________________________________"
35
+ puts "GIT COMMIT"
31
36
  puts `git commit -m 'minor changes to version #{version_new}'`
32
37
  puts "_______________________________________________"
33
- puts `bundle exec rake install`
38
+ puts "INSTALL GEM LOCALLY"
39
+ puts `bundle exec rake install`
40
+ puts "_______________________________________________"
41
+ puts "info: write 'bundle exec rake release' to release the current version to the interwebz"
@@ -21,6 +21,8 @@ module OmniAuth
21
21
  option :client_id, nil
22
22
  option :exchange_url, "https://core.human-id.org/[HUMANID_VERSION]/server/users/exchange"
23
23
 
24
+ attr_accessor :raw_info
25
+
24
26
  # def self.humanid_button
25
27
  # #see https://docs.human-id.org/web-sdk-integration-guide
26
28
  # %Q{<a href="#{options.local_sign_up_url}">
@@ -108,6 +110,7 @@ module OmniAuth
108
110
  #get the exchange_token from the humanID callback
109
111
  Rails.logger.info("CALLBACK PHASE")
110
112
  exchange_token = request.params['et']
113
+ Rails.logger.info("EXCHANGE TOKEN: #{exchange_token}")
111
114
 
112
115
  #create the request (as per the humanID docs)
113
116
  uri = get_exchange_uri
@@ -118,31 +121,30 @@ module OmniAuth
118
121
  post_request.body = {"exchangeToken" => exchange_token}.to_json
119
122
  #send the request, get the response.
120
123
  res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true){|http| http.request(post_request)}
124
+ Rails.logger.info("RESPONSE: #{res}")
121
125
  if res.code == "200"
122
- request.env['omniauth.auth'] = JSON.parse(res.body)
126
+ self.raw_info = JSON.parse(res.body)
127
+ Rails.logger.info("raw: #{raw_info}")
128
+ super
123
129
  else
124
- raise StandardError.new("Issue with the callback_phase of humanid omniauth, response from human id has code: #{res.code}, and body: #{res.body}")
130
+ str = "Issue with the callback_phase of humanid omniauth, response from human id has code: #{res.code}, and body: #{res.body}"
131
+ Rails.logger.error str
132
+ raise StandardError.new(str)
125
133
  end
126
134
  end
127
-
135
+
136
+ def info
137
+ raw_info['data']
138
+ end
128
139
  def uid
129
- request.env['omniauth.auth']['data']['userAppId']
140
+ info['userAppId']
130
141
  end
131
- alias userAppId uid
132
-
133
142
  def countryCide
134
- request.env['omniauth.auth']['data']['countryCide']
143
+ info['countryCide']
135
144
  end
145
+ alias userAppId uid
136
146
  alias country_cide countryCide
137
147
  alias country_code countryCide
138
-
139
- def info
140
- request.env['omniauth.auth']['data']
141
- end
142
-
143
- def extra
144
- request.env['omniauth.auth']
145
- end
146
148
  end
147
149
  end
148
150
  end
@@ -1,4 +1,4 @@
1
- version = '0.0.16'
1
+ version = '0.0.21'
2
2
  #version must be on the first line for the update script
3
3
 
4
4
  Gem::Specification.new do |spec|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-humanid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Clancy