soar_authentication_token 3.0.0 → 3.0.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23da4fea7363812826b73593843070c18eb1459c
|
4
|
+
data.tar.gz: 181434c48fe12905e1ac5a2abe9300b5cc0f2d8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adfe3f6636c98468a4c01918360eedc300e59bba8aa20091648bab8f51fff54ddcc3de8fbba0a84719aed6129cf002cc3e7d286bd1e0f4c40d5052f1b25e6224
|
7
|
+
data.tar.gz: 5c973a1d349f0cd09c4d4cc0dadf91223587a17f8c2de6884cc3183e09c984dff826967f5463c9c5a56cbd985d8c1d76de2bac2b8dfec7ce397501bad6cb44b7
|
data/docker-compose.yml
CHANGED
@@ -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
|
-
|
102
|
-
|
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')
|
@@ -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
|