soar_authentication_token 3.0.7 → 3.0.8

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: eb42b35627e86d7a1e8df7e39f06a93c4dbf8fd9
4
- data.tar.gz: a3210766f01a7e57d41c93135cd88bd1918011bc
3
+ metadata.gz: d92b72f475f8d676977e197b3f972cd23911f49e
4
+ data.tar.gz: f91bdc891e6026758e6ffa79ad15b456f7271de4
5
5
  SHA512:
6
- metadata.gz: d7abe0de344067ed732f8971785ca1ecb4bdba9e23c06e7cdcbdc6193e21aa236260ad978300eb924ac7004c00005e222f806188b0d406eb60cde2112fa67297
7
- data.tar.gz: f2bb4649f738bf662e87aaaa411839000fe24db5a9f5fdf5b12e0f4f30cfee7c962d91ef7d6cd29429de47c7ba3bb951f04f1dd1401782527343c763cf0a4b4d
6
+ metadata.gz: c3b023843023fb0a7c255689c299ca245b5d95ea7908c8ac91d63201782926d51e69741cb904dac4eeb95bae8f17e181a27075ea783773b51f694a9b1c6ba4e2
7
+ data.tar.gz: bff752a0fb859ee6bc4ccc44adf11e1b0304b1f77e5e35ce52d2bef09b099548f937270a356440b574950c10a8ba6921ed60f7364d15ba385dd41b735c32bce0
@@ -20,7 +20,7 @@ module SoarAuthenticationToken
20
20
  end
21
21
 
22
22
  def validate(authentication_token:,flow_identifier: nil)
23
- return validate_locally(authentication_token) if 'local' == @configuration['mode']
23
+ return validate_locally(authentication_token,flow_identifier) if 'local' == @configuration['mode']
24
24
  return validate_statically(authentication_token) if 'static' == @configuration['mode']
25
25
  return validate_remotely(authentication_token,flow_identifier) if 'remote' == @configuration['mode']
26
26
  raise 'invalid validation mode configured'
@@ -48,10 +48,10 @@ module SoarAuthenticationToken
48
48
  nil
49
49
  end
50
50
 
51
- def validate_locally(authentication_token)
51
+ def validate_locally(authentication_token,flow_identifier)
52
52
  meta = decode_token_meta(authentication_token)
53
53
  return rejection_result(reason: "Expired token <#{meta['token_expiry_time']}> for <#{meta['authenticated_identifier']}>") if token_expired?(meta)
54
- return rejection_result(reason: "Unknown token for <#{meta['authenticated_identifier']}>") unless token_exist_in_store?(meta)
54
+ return rejection_result(reason: "Unknown token for <#{meta['authenticated_identifier']}>") unless token_exist_in_store?(meta,flow_identifier)
55
55
  success_result(token_meta: meta)
56
56
  rescue JWT::VerificationError, JWT::DecodeError
57
57
  rejection_result(reason: 'Token decode/verification failure')
@@ -147,12 +147,13 @@ module SoarAuthenticationToken
147
147
  Time.parse(meta['token_expiry_time'].to_s) < Time.now
148
148
  end
149
149
 
150
- def token_exist_in_store?(meta)
150
+ def token_exist_in_store?(meta,flow_identifier)
151
151
  @store_provider.token_exist?(
152
152
  token_identifier: meta['token_identifier'],
153
153
  authenticated_identifier: meta['authenticated_identifier'],
154
154
  token_issue_time: meta['token_issue_time'],
155
- token_expiry_time: meta['token_expiry_time'])
155
+ token_expiry_time: meta['token_expiry_time'],
156
+ flow_identifier: flow_identifier)
156
157
  end
157
158
 
158
159
  def rejection_result(reason:)
@@ -1,3 +1,3 @@
1
1
  module SoarAuthenticationToken
2
- VERSION = '3.0.7'
2
+ VERSION = '3.0.8'
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.7
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers