firebug 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/action_dispatch/session/code_igniter_store.rb +2 -2
- data/lib/firebug/configuration.rb +14 -4
- data/lib/firebug/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 714b21952917ec17c9c58516e64193dcc2994d51b43edc7c6a4f7f97f1c93663
|
4
|
+
data.tar.gz: e2aed63c7816a652d3eb847e5559e0edeba49c3012745ccfe1b4f462d8e82381
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3be45116cb8571164994368e7e14b49eed6c7680133b35efdb42d77c83ee0a2dc40b5b0c233626718fa36870c372930eff36376127cd87f8441bfe0f98849bf4
|
7
|
+
data.tar.gz: bfbe17e9d5c2deaabecc71fa1a167e3f9da84fd686a26ea659ba7aee38de1b4b7c8763431a5a0625e5c072e69084158312093a878d26bdbaba60882abab89508
|
@@ -158,8 +158,8 @@ module ActionDispatch # :nodoc:
|
|
158
158
|
# @return [Hash]
|
159
159
|
def find_by_params(req, sid)
|
160
160
|
params = { session_id: sid }
|
161
|
-
params[:ip_address] = req.remote_ip if Firebug.config.match_ip_address
|
162
|
-
if Firebug.config.match_user_agent
|
161
|
+
params[:ip_address] = req.remote_ip if Firebug.config.match_ip_address.call(req)
|
162
|
+
if Firebug.config.match_user_agent.call(req)
|
163
163
|
params[:user_agent] = Firebug.config.truncate_user_agent ? req.user_agent&.slice(0...120) : req.user_agent
|
164
164
|
end
|
165
165
|
params
|
@@ -9,9 +9,9 @@ module Firebug
|
|
9
9
|
# The name of the sessions table.
|
10
10
|
# @attr [Boolean] truncate_user_agent
|
11
11
|
# Truncate the user-agent to 120 characters.
|
12
|
-
# @attr [
|
12
|
+
# @attr [Proc] match_user_agent
|
13
13
|
# Use the user-agent in addition to the session ID.
|
14
|
-
# @attr [
|
14
|
+
# @attr [Proc] match_ip_address
|
15
15
|
# Use the remote ip address in addition to the session ID.
|
16
16
|
# @attr [Boolean] silence_logger
|
17
17
|
# Silence ActiveRecord logs.
|
@@ -20,11 +20,11 @@ module Firebug
|
|
20
20
|
# @see ActionDispatch::Session::CodeIgniterStore#commit_session?
|
21
21
|
class Configuration
|
22
22
|
attr_reader :table_name
|
23
|
+
attr_reader :match_user_agent
|
24
|
+
attr_reader :match_ip_address
|
23
25
|
|
24
26
|
attr_accessor :key
|
25
27
|
attr_accessor :truncate_user_agent
|
26
|
-
attr_accessor :match_user_agent
|
27
|
-
attr_accessor :match_ip_address
|
28
28
|
attr_accessor :session_filter
|
29
29
|
attr_accessor :silence_logger
|
30
30
|
|
@@ -37,6 +37,16 @@ module Firebug
|
|
37
37
|
self.session_filter = ->(_) { true }
|
38
38
|
end
|
39
39
|
|
40
|
+
# @param [Proc,Boolean] value
|
41
|
+
def match_user_agent=(value)
|
42
|
+
@match_user_agent = value.respond_to?(:call) ? value : ->(_) { value }
|
43
|
+
end
|
44
|
+
|
45
|
+
# @param [Proc,Boolean] value
|
46
|
+
def match_ip_address=(value)
|
47
|
+
@match_ip_address = value.respond_to?(:call) ? value : ->(_) { value }
|
48
|
+
end
|
49
|
+
|
40
50
|
# Sets the table name for (see Firebug::Session)
|
41
51
|
#
|
42
52
|
# @param [String] value
|
data/lib/firebug/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Frase
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|