auth_token_store_provider 1.0.1 → 1.1.0

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: 8d9b7f73982b9a9a3ee1f279630add22133eda53
4
- data.tar.gz: 31e1aa63b0792770d5cb802ec2bb203012fe3a35
3
+ metadata.gz: 614b617bfe0780889bfe68b6bb3d7ed19ce49830
4
+ data.tar.gz: 9a7f3000546fac484c423cd42448e7845c330ca9
5
5
  SHA512:
6
- metadata.gz: 924e9a3b0f803482e4b15bcd57b36f5a78d0ef7b532627753ad039279df08067974e323f75d645d929f4d3dc8e45a8e6ee76fc4529503a1fd181ae6a19d10bac
7
- data.tar.gz: a41df3efa695ea28abfb1e6531e796b3bf7a4824107e7cd857980562fcc656cda80942f245d8927237b0ada5da98e1b296ad9cbf48bc42bf3ee653b65e928376
6
+ metadata.gz: 4b442d5637943c7eeee030abebc11e2f7cd4b899b5708b8da0802ebb7ec4de7f8685ca2edbc7b86ac107e50d2f560fbc65af95b275661c2f31779f9788133ed5
7
+ data.tar.gz: 40d6869eaf3eef585e6a8928744868eff5f847780d2e2184bf3b974e245438babd2b1db9b14214e673f9d6003059d277547273367177106e7f554dcc1fd07cc2
@@ -1,11 +1,12 @@
1
1
  module AuthTokenStoreProvider
2
2
  class StubClient
3
+ def store
4
+ @@store ||= []
5
+ end
3
6
 
4
7
  def initialize(configuration = {})
5
- if configuration == {}
6
- @store = []
7
- elsif configuration['stub-data'] != {} || configuration['stub-data'] != nil
8
- @store = configuration['stub-data']
8
+ if configuration['stub-data'] != {} || configuration['stub-data'] != nil
9
+ @@store = configuration['stub-data']
9
10
  end
10
11
  end
11
12
 
@@ -15,7 +16,7 @@ module AuthTokenStoreProvider
15
16
 
16
17
  def add(token_identifier:, authenticated_identifier:, token_issue_time:, token_expiry_time:, flow_identifier: nil)
17
18
  raise RuntimeError, 'Failure accessing store' if @store_failure
18
- @store << { token_identifier: token_identifier,
19
+ store << { token_identifier: token_identifier,
19
20
  authenticated_identifier: authenticated_identifier,
20
21
  token_issue_time: token_issue_time,
21
22
  token_expiry_time: token_expiry_time }
@@ -23,14 +24,14 @@ module AuthTokenStoreProvider
23
24
 
24
25
  def remove(token_identifier:, flow_identifier: nil)
25
26
  raise RuntimeError, 'Failure accessing store' if @store_failure
26
- @store.delete_if { |x| x[:token_identifier] == token_identifier }
27
+ store.delete_if { |x| x[:token_identifier] == token_identifier }
27
28
  true
28
29
  end
29
30
 
30
31
  def token_exist?(token_identifier:, authenticated_identifier:, token_issue_time:, token_expiry_time:, flow_identifier: nil)
31
32
  raise RuntimeError, 'Failure accessing store' if @store_failure
32
33
 
33
- @store.each { |x|
34
+ store.each { |x|
34
35
  if ((x[:token_identifier] == token_identifier) and
35
36
  (x[:authenticated_identifier] == authenticated_identifier) and
36
37
  (x[:token_issue_time] == token_issue_time) and
@@ -43,13 +44,13 @@ module AuthTokenStoreProvider
43
44
 
44
45
  def remove_tokens_for(authenticated_identifier:, flow_identifier: nil)
45
46
  raise RuntimeError, 'Failure accessing store' if @store_failure
46
- @store.delete_if { |x| x[:authenticated_identifier] == authenticated_identifier }
47
+ store.delete_if { |x| x[:authenticated_identifier] == authenticated_identifier }
47
48
  true
48
49
  end
49
50
 
50
51
  def list_tokens_for(authenticated_identifier:, flow_identifier: nil)
51
52
  raise RuntimeError, 'Failure accessing store' if @store_failure
52
- @store.select { |x| x[:authenticated_identifier] == authenticated_identifier}
53
+ store.select { |x| x[:authenticated_identifier] == authenticated_identifier}
53
54
  end
54
55
  end
55
56
  end
@@ -1,3 +1,3 @@
1
1
  module AuthenticationTokenStore
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth_token_store_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-20 00:00:00.000000000 Z
12
+ date: 2017-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: authenticated_client