redis-client-session-store 0.12

Sign up to get free protection for your applications and to get access to all the features.
data/spec/support.rb ADDED
@@ -0,0 +1,86 @@
1
+ unless defined?(Rack::Session::Abstract::ENV_SESSION_OPTIONS_KEY)
2
+ module Rack
3
+ module Session
4
+ module Abstract
5
+ ENV_SESSION_OPTIONS_KEY = 'rack.session.options'.freeze
6
+ end
7
+ end
8
+ end
9
+ end
10
+ unless defined?(Rack::Session::SessionId)
11
+ module Rack
12
+ module Session
13
+ class SessionId
14
+ ID_VERSION = 2
15
+
16
+ attr_reader :public_id
17
+
18
+ def initialize(public_id)
19
+ @public_id = public_id
20
+ end
21
+
22
+ alias to_s public_id
23
+
24
+ def empty?
25
+ false
26
+ end
27
+
28
+ def inspect
29
+ public_id.inspect
30
+ end
31
+
32
+ def private_id
33
+ "#{ID_VERSION}::#{hash_sid(public_id)}"
34
+ end
35
+
36
+ private
37
+
38
+ def hash_sid(value)
39
+ "test_hash_from:#{value}"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ unless defined?(ActionDispatch::Session::AbstractSecureStore)
47
+ module ActionDispatch
48
+ module Session
49
+ class AbstractSecureStore
50
+ ENV_SESSION_OPTIONS_KEY = 'rack.session.options'.freeze
51
+ DEFAULT_OPTIONS = {
52
+ key: '_session_id',
53
+ path: '/',
54
+ domain: nil,
55
+ expire_after: nil,
56
+ secure: false,
57
+ httponly: true,
58
+ cookie_only: true
59
+ }.freeze
60
+
61
+ def initialize(app, options = {})
62
+ @app = app
63
+ @default_options = DEFAULT_OPTIONS.dup.merge(options)
64
+ @key = @default_options[:key]
65
+ @cookie_only = @default_options[:cookie_only]
66
+ end
67
+
68
+ private
69
+
70
+ def generate_sid
71
+ Rack::Session::SessionId.new(rand(999..9999).to_s(16))
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ unless defined?(Rails)
79
+ require 'logger'
80
+
81
+ module Rails
82
+ def self.logger
83
+ @logger ||= Logger.new('/dev/null')
84
+ end
85
+ end
86
+ end
metadata ADDED
@@ -0,0 +1,186 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: redis-client-session-store
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.12'
5
+ platform: ruby
6
+ authors:
7
+ - Andrey "Zed" Zaikin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-12-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actionpack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 5.2.4.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 5.2.4.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8'
33
+ - !ruby/object:Gem::Dependency
34
+ name: redis-client
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '13'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '13'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubocop
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.25'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.25'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop-rake
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.6'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.6'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rubocop-rspec
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '2.8'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '2.8'
117
+ - !ruby/object:Gem::Dependency
118
+ name: simplecov
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0.21'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '0.21'
131
+ description: Rails session store using low-level redis-client for Redis 6+ For great
132
+ glory!
133
+ email:
134
+ - zed.0xff@gmail.com
135
+ executables: []
136
+ extensions: []
137
+ extra_rdoc_files:
138
+ - LICENSE
139
+ - AUTHORS.md
140
+ - CONTRIBUTING.md
141
+ files:
142
+ - ".github/workflows/ruby.yml"
143
+ - ".gitignore"
144
+ - ".gitmodules"
145
+ - ".rspec"
146
+ - ".rubocop.yml"
147
+ - ".rubocop_todo.yml"
148
+ - ".simplecov"
149
+ - AUTHORS.md
150
+ - CODE_OF_CONDUCT.md
151
+ - CONTRIBUTING.md
152
+ - Gemfile
153
+ - Gemfile.lock
154
+ - LICENSE
155
+ - README.md
156
+ - Rakefile
157
+ - lib/redis-client-session-store.rb
158
+ - redis-client-session-store.gemspec
159
+ - spec/redis_client_session_store_spec.rb
160
+ - spec/spec_helper.rb
161
+ - spec/support.rb
162
+ - spec/support/redis_double.rb
163
+ homepage: https://github.com/zed-0xff/redis-client-session-store
164
+ licenses:
165
+ - MIT
166
+ metadata: {}
167
+ post_install_message:
168
+ rdoc_options: []
169
+ require_paths:
170
+ - lib
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ requirements: []
182
+ rubygems_version: 3.3.7
183
+ signing_key:
184
+ specification_version: 4
185
+ summary: Rails session store using low-level redis-client for Redis 6+
186
+ test_files: []