soar_authentication_token 3.0.8 → 3.0.9

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: d92b72f475f8d676977e197b3f972cd23911f49e
4
- data.tar.gz: f91bdc891e6026758e6ffa79ad15b456f7271de4
3
+ metadata.gz: 943763e03572585973f8183ec30b991724885a5b
4
+ data.tar.gz: bc1494d9165b7b8fb09a16707be3c799afa562ed
5
5
  SHA512:
6
- metadata.gz: c3b023843023fb0a7c255689c299ca245b5d95ea7908c8ac91d63201782926d51e69741cb904dac4eeb95bae8f17e181a27075ea783773b51f694a9b1c6ba4e2
7
- data.tar.gz: bff752a0fb859ee6bc4ccc44adf11e1b0304b1f77e5e35ce52d2bef09b099548f937270a356440b574950c10a8ba6921ed60f7364d15ba385dd41b735c32bce0
6
+ metadata.gz: 7de47b8886a50cb1b39710af98a80ea8f1e748aa6ba233f2859cbd30dccf8065b341c633f60f8bbd81e9ede872854be13e725d8b5559059e20d78df06cdd6041
7
+ data.tar.gz: 768f6724ca6f208abd04af1d27ff3918b3ed668e623e32505a2099e09d1b4c15a368207a389572f5cdd11e31c6d01dce23709f823ec2c1b8415983a70329fe29
@@ -83,16 +83,18 @@ module SoarAuthenticationToken
83
83
  end
84
84
 
85
85
  def validate_remotely(authentication_token,flow_identifier)
86
- uri = URI.parse(@configuration['validator-url'])
86
+ response = send_request(authentication_token,flow_identifier)
87
+ validate_and_extract_information_from_response(response)
88
+ end
87
89
 
88
- request = Net::HTTP::Post.new uri
89
- request.set_form_data({'flow_identifier' => flow_identifier})
90
+ def send_request(authentication_token,flow_identifier)
91
+ uri = URI.parse(@configuration['validator-url'])
92
+ uri.query = URI.encode_www_form( {'flow_identifier' => flow_identifier} )
93
+ http = Net::HTTP.new(uri.host, uri.port)
94
+ http.use_ssl = true if uri.is_a?(URI::HTTPS)
95
+ request = Net::HTTP::Post.new(uri.request_uri)
90
96
  request.body = { 'authentication_token' => authentication_token }.to_json
91
- response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') { |http|
92
- http.request request
93
- }
94
-
95
- validate_and_extract_information_from_response(response)
97
+ http.request(request)
96
98
  end
97
99
 
98
100
  def validate_and_extract_information_from_response(response)
@@ -1,3 +1,3 @@
1
1
  module SoarAuthenticationToken
2
- VERSION = '3.0.8'
2
+ VERSION = '3.0.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_authentication_token
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers