soar_authentication_token 3.0.0 → 3.0.1

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: c1a6ee48994978d49a24f51df0e4a0fa78e9b48c
4
- data.tar.gz: 40f3341de578f6cff681c5478e2a90b74bc9bdbb
3
+ metadata.gz: 23da4fea7363812826b73593843070c18eb1459c
4
+ data.tar.gz: 181434c48fe12905e1ac5a2abe9300b5cc0f2d8f
5
5
  SHA512:
6
- metadata.gz: e9226cada6118f03955459088df8fdf03a51601fd42b1faab5e1eaff53312331259347c7f39969c03fa9eb71b3a30b884cb89c4f4807b7d3d5e31c25040c66bc
7
- data.tar.gz: c56869b6c2a76520e64524513913598282883715a54a0d8686bdbdc2b1ee13cae8c34969f489891b13ac3da2ec0a577274dc51d34367b48d237149a156a479c9
6
+ metadata.gz: adfe3f6636c98468a4c01918360eedc300e59bba8aa20091648bab8f51fff54ddcc3de8fbba0a84719aed6129cf002cc3e7d286bd1e0f4c40d5052f1b25e6224
7
+ data.tar.gz: 5c973a1d349f0cd09c4d4cc0dadf91223587a17f8c2de6884cc3183e09c984dff826967f5463c9c5a56cbd985d8c1d76de2bac2b8dfec7ce397501bad6cb44b7
data/docker-compose.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  version: '2.0'
2
2
  services:
3
3
  soar-authentication-token:
4
- command: /bin/bash -c 'bundle exec rspec -cfd spec'
4
+ command: /bin/bash -c 'sleep 5; bundle exec rspec -cfd spec'
5
5
  build: .
6
6
  image: soar-authentication-token
7
7
  volumes:
@@ -97,9 +97,14 @@ module SoarAuthenticationToken
97
97
  def validate_and_extract_information_from_response(response)
98
98
  raise "Failure validating token with token validation service. Code #{response.code} received" if '200' != response.code
99
99
  body = JSON.parse(response.body)
100
- if 'success' == body['status']
101
- raise 'Token validation service did not provide authenticated_identifier' if body['data'].nil? or body['data']['authenticated_identifier'].nil?
102
- return success_result(token_meta: body['data'])
100
+ if ('success' == body['status']) and body['data']
101
+ token_validity = body['data']['token_validity']
102
+ token_meta = body['data']['token_meta']
103
+ message = body['data']['message']
104
+ raise 'Token validation service did not provide token_validity' if token_validity.nil?
105
+ raise 'Token validation service did not provide token_meta' if token_validity and token_meta.nil?
106
+ raise 'Token validation service did not provide message' if message.nil?
107
+ return [token_validity, token_meta, message]
103
108
  end
104
109
  if 'fail' == body['status']
105
110
  return rejection_result(reason: 'remote validation failed')
@@ -1,3 +1,3 @@
1
1
  module SoarAuthenticationToken
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
@@ -58,10 +58,11 @@ describe SoarAuthenticationToken::TokenGenerator do
58
58
 
59
59
  @validator = SoarAuthenticationToken::TokenValidator.new(@configuration_remote)
60
60
  @iut.inject_store_provider(@test_store)
61
- token_validity, token_validator_meta = @validator.validate(authentication_token: token, flow_identifier: 'test-flow-id')
61
+ token_validity, token_validator_meta, messages = @validator.validate(authentication_token: token, flow_identifier: 'test-flow-id')
62
62
 
63
63
  expect(token_validity).to eq(true)
64
64
  expect(token_validator_meta['authenticated_identifier']).to eq(@test_authenticated_identifier)
65
+ expect(messages).to match(/Valid token/)
65
66
  end
66
67
  end
67
68
  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.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers