brevio-session 0.2.2 → 0.2.4

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
  SHA256:
3
- metadata.gz: 97d1fd49360aab5a99bd4191bf1504c9c9b001a582284559373550244432d04b
4
- data.tar.gz: 452394130da4b986a42aaf807eb0cb580e7e1ff2f54b79e28224aca4e6915a37
3
+ metadata.gz: e790bcdbd38f455324a5c169dc4e05129d7fa44ffffdbffd8c2e1085ac599151
4
+ data.tar.gz: 44d60e51082901b8d0906c5526cbba2104139d68016bf481c4cb1f11dc46add7
5
5
  SHA512:
6
- metadata.gz: a673c0227a23ccc2c95104932249bed517cabce3b1ab461a12717dbca74f4e755db44d51c6103126679f3988687942919a88715c7940eb18722f7a5d7534e32d
7
- data.tar.gz: b3f17e1adaa4df6f376f0cc20c34ae2332cffe60e0ede1d70d5cf63eb12214f67720e7db981ea901c02f183cb74fbcd00df8d436d84acd59448d5d12f075db89
6
+ metadata.gz: b5169d856c9df239f41bfc8d2e715f4f8cc0411b9d7222e2f2337953d10a9ee4ab8af9ce285aba5016365a77dde7505828196e0a0c21e9fc70a6719304768733
7
+ data.tar.gz: 722060673046b8a899c47048863f64c7b4e8ce589490e3895801d9af3f2984cd095583cfa6c8985371fbd196e6c4b70cc445f7677943cb642683ba3edd51bf82
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.0
1
+ 3.2.2
data/Gemfile.lock CHANGED
@@ -1,58 +1,72 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brevio-session (0.2.1)
5
- actionpack (~> 7.0.3)
6
- redis (~> 5.0)
4
+ brevio-session (0.2.4)
5
+ actionpack (~> 7.1.3)
6
+ redis (~> 4.8)
7
7
  zeitwerk (~> 2.6.7)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (7.0.8)
13
- actionview (= 7.0.8)
14
- activesupport (= 7.0.8)
15
- rack (~> 2.0, >= 2.2.4)
12
+ actionpack (7.1.3.4)
13
+ actionview (= 7.1.3.4)
14
+ activesupport (= 7.1.3.4)
15
+ nokogiri (>= 1.8.5)
16
+ racc
17
+ rack (>= 2.2.4)
18
+ rack-session (>= 1.0.1)
16
19
  rack-test (>= 0.6.3)
17
- rails-dom-testing (~> 2.0)
18
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (7.0.8)
20
- activesupport (= 7.0.8)
20
+ rails-dom-testing (~> 2.2)
21
+ rails-html-sanitizer (~> 1.6)
22
+ actionview (7.1.3.4)
23
+ activesupport (= 7.1.3.4)
21
24
  builder (~> 3.1)
22
- erubi (~> 1.4)
23
- rails-dom-testing (~> 2.0)
24
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activesupport (7.0.8)
25
+ erubi (~> 1.11)
26
+ rails-dom-testing (~> 2.2)
27
+ rails-html-sanitizer (~> 1.6)
28
+ activesupport (7.1.3.4)
29
+ base64
30
+ bigdecimal
26
31
  concurrent-ruby (~> 1.0, >= 1.0.2)
32
+ connection_pool (>= 2.2.5)
33
+ drb
27
34
  i18n (>= 1.6, < 2)
28
35
  minitest (>= 5.1)
36
+ mutex_m
29
37
  tzinfo (~> 2.0)
30
38
  ast (2.4.2)
31
- builder (3.2.4)
32
- concurrent-ruby (1.2.2)
39
+ base64 (0.2.0)
40
+ bigdecimal (3.1.8)
41
+ builder (3.3.0)
42
+ concurrent-ruby (1.3.3)
33
43
  connection_pool (2.4.1)
34
44
  crass (1.0.6)
35
45
  debug (1.5.0)
36
46
  irb (>= 1.3.6)
37
47
  reline (>= 0.2.7)
38
- erubi (1.12.0)
39
- i18n (1.14.1)
48
+ drb (2.2.1)
49
+ erubi (1.13.0)
50
+ i18n (1.14.5)
40
51
  concurrent-ruby (~> 1.0)
41
52
  io-console (0.6.0)
42
53
  irb (1.6.1)
43
54
  reline (>= 0.3.0)
44
55
  json (2.6.2)
45
- loofah (2.21.3)
56
+ loofah (2.22.0)
46
57
  crass (~> 1.0.2)
47
58
  nokogiri (>= 1.12.0)
48
- minitest (5.20.0)
49
- nokogiri (1.15.4-arm64-darwin)
59
+ minitest (5.24.0)
60
+ mutex_m (0.2.0)
61
+ nokogiri (1.16.6-arm64-darwin)
50
62
  racc (~> 1.4)
51
63
  parallel (1.22.1)
52
64
  parser (3.1.2.1)
53
65
  ast (~> 2.4.1)
54
- racc (1.7.1)
55
- rack (2.2.8)
66
+ racc (1.8.0)
67
+ rack (3.1.3)
68
+ rack-session (2.0.0)
69
+ rack (>= 3.0.0)
56
70
  rack-test (2.1.0)
57
71
  rack (>= 1.3)
58
72
  rails-dom-testing (2.2.0)
@@ -63,10 +77,7 @@ GEM
63
77
  loofah (~> 2.21)
64
78
  nokogiri (~> 1.14)
65
79
  rainbow (3.1.1)
66
- redis (5.0.7)
67
- redis-client (>= 0.9.0)
68
- redis-client (0.17.0)
69
- connection_pool
80
+ redis (4.8.1)
70
81
  regexp_parser (2.5.0)
71
82
  reline (0.3.2)
72
83
  io-console (~> 0.5)
@@ -87,10 +98,11 @@ GEM
87
98
  tzinfo (2.0.6)
88
99
  concurrent-ruby (~> 1.0)
89
100
  unicode-display_width (2.2.0)
90
- zeitwerk (2.6.12)
101
+ zeitwerk (2.6.16)
91
102
 
92
103
  PLATFORMS
93
104
  arm64-darwin-21
105
+ arm64-darwin-23
94
106
 
95
107
  DEPENDENCIES
96
108
  brevio-session!
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'brevio-session'
5
- spec.version = '0.2.2'
5
+ spec.version = '0.2.4'
6
6
  spec.authors = ['Brevio AS']
7
7
  spec.email = ['support@brevio.com']
8
8
  spec.files = `git ls-files -z`.split("\0")
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.add_development_dependency 'bundler', '~> 2.1'
17
17
  spec.add_development_dependency 'debug', '~> 1.5.0', '<= 1.6.0'
18
18
  spec.add_development_dependency 'rubocop', '~> 1.35'
19
- spec.add_dependency 'actionpack', '~> 7.0.3'
19
+ spec.add_dependency 'actionpack', '~> 7.1.3'
20
20
  spec.add_dependency 'redis', '~> 4.8'
21
21
  spec.add_dependency 'zeitwerk', '~> 2.6.7'
22
22
  spec.metadata['rubygems_mfa_required'] = 'true'
@@ -15,6 +15,7 @@ module Brevio::Session
15
15
 
16
16
  session_hash = { user_id: user.brevio_id,
17
17
  audit_company_id: user.audit_company.brevio_id,
18
+ user_patch: user.patch,
18
19
  user_stamp: updated_at }
19
20
 
20
21
  Testing.config.logger.info "setting Brevio session to #{session_hash}"
@@ -23,14 +24,17 @@ module Brevio::Session
23
24
  redis_key,
24
25
  session_hash
25
26
  )
27
+
28
+ Testing.config.gem_config.redis.set("brevio-id:audit-company:#{user.audit_company.brevio_id}:patch", user.audit_company.patch)
26
29
  set_cookie(redis_key)
27
30
  end
28
31
 
29
- def brevio_login_new_user(user_brevio_id, audit_company:)
32
+ def brevio_login_new_user(user_brevio_id, patch: nil, audit_company:)
30
33
  redis_key = SecureRandom.hex(6)
31
34
 
32
35
  session_hash = { user_id: user_brevio_id,
33
36
  audit_company_id: audit_company.brevio_id,
37
+ user_patch: patch || SecureRandom.hex(12),
34
38
  user_stamp: Time.current.yesterday }
35
39
 
36
40
  Testing.config.logger.info "setting Brevio session to #{session_hash}"
@@ -38,7 +38,7 @@ module Brevio::Session
38
38
  # Calls the above function, but raises an exception if the session isn't present.
39
39
  def fetch_brevio_session!
40
40
  brevio_session, redis_key = fetch_session
41
- raise NilSession, 'Brevio session was nil' if brevio_session.nil?
41
+ raise NilSession if brevio_session.nil?
42
42
  refresh_session(redis_key) unless params.transform_keys(&:underscore)[:no_session].present?
43
43
  brevio_session
44
44
  end
@@ -14,5 +14,5 @@ require 'action_dispatch'
14
14
  module BrevioSession; end # Necessary for reasons
15
15
 
16
16
  module Brevio::Session
17
- class NilSession < StandardError; end
17
+ class NilSession < RuntimeError; end
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brevio-session
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brevio AS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-03 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 7.0.3
67
+ version: 7.1.3
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 7.0.3
74
+ version: 7.1.3
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: redis
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.4.1
146
+ rubygems_version: 3.4.10
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Brevio session wrapper