firebug 0.1.0 → 0.1.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/action_dispatch/session/code_igniter_store.rb +6 -3
- data/lib/firebug/configuration.rb +12 -0
- data/lib/firebug/session.rb +1 -1
- data/lib/firebug/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45efa98f665949bc503297c7f4f8c46ff43d60fc
|
4
|
+
data.tar.gz: 4a93d2a74d29ded79c048796d04ebd38c8ef11ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8820e847d97883e5ed050d7195c0a48bd0e32ba586af32bbeb2c146325659eee6102fec7d305d9df3d7372c6dcc654c6975607b94a5b1416b90813ee55e2786
|
7
|
+
data.tar.gz: 2f66962cda34ed35ca59255af7338c5fb7318d43cc3aa0939ce33260a61dbbbae7764dde927b8ba0aded2f813c8192d96903db4089d23c4fa9495d1b3350c6ad
|
data/Gemfile.lock
CHANGED
@@ -34,7 +34,7 @@ module ActionDispatch
|
|
34
34
|
model_params = {
|
35
35
|
session_id: model.session_id,
|
36
36
|
user_agent: req.user_agent || '', # user_agent can't be null
|
37
|
-
ip_address: req.
|
37
|
+
ip_address: req.ip || '', # ip_address can't be null
|
38
38
|
user_data: session
|
39
39
|
}
|
40
40
|
# Returning false will cause Rack to output a warning.
|
@@ -76,7 +76,10 @@ module ActionDispatch
|
|
76
76
|
# @return [Firebug::Session]
|
77
77
|
def find_session_model(req, sid=nil)
|
78
78
|
if sid
|
79
|
-
|
79
|
+
p = { session_id: sid }
|
80
|
+
p[:ip_address] = req.ip if Firebug.configuration.match_ip
|
81
|
+
p[:user_agent] = req.user_agent if Firebug.configuration.match_useragent
|
82
|
+
model = Firebug::Session.find_by(p)
|
80
83
|
return model if model
|
81
84
|
end
|
82
85
|
|
@@ -84,7 +87,7 @@ module ActionDispatch
|
|
84
87
|
session_id: sid || generate_sid,
|
85
88
|
last_activity: Time.current.to_i,
|
86
89
|
user_agent: req.user_agent,
|
87
|
-
ip_address: req.
|
90
|
+
ip_address: req.ip
|
88
91
|
)
|
89
92
|
end
|
90
93
|
end
|
@@ -5,10 +5,22 @@ module Firebug
|
|
5
5
|
#
|
6
6
|
# @attr [String] key the encryption key used to encrypt and decrypt cookies.
|
7
7
|
# @attr [String] table_name the name of the sessions table.
|
8
|
+
# @attr [Boolean] truncate_useragent
|
9
|
+
# @attr [Boolean] match_useragent
|
10
|
+
# @attr [Boolean] match_ip
|
8
11
|
class Configuration
|
9
12
|
attr_reader :table_name
|
10
13
|
|
11
14
|
attr_accessor :key
|
15
|
+
attr_accessor :truncate_useragent
|
16
|
+
attr_accessor :match_useragent
|
17
|
+
attr_accessor :match_ip
|
18
|
+
|
19
|
+
# def initialize
|
20
|
+
# @truncate_useragent = false
|
21
|
+
# @match_useragent = false
|
22
|
+
# @match_ip = false
|
23
|
+
# end
|
12
24
|
|
13
25
|
# Sets the table name for +Firebug::Session+
|
14
26
|
#
|
data/lib/firebug/session.rb
CHANGED
@@ -21,7 +21,7 @@ module Firebug
|
|
21
21
|
def user_agent=(value)
|
22
22
|
# Pyro seems to truncate the value and since it also uses this value when finding the session, it's important
|
23
23
|
# we do the same.
|
24
|
-
super(value[0...120])
|
24
|
+
super(Firebug.configuration.truncate_useragent ? value[0...120] : value)
|
25
25
|
end
|
26
26
|
|
27
27
|
# @return [String]
|
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: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Frase
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|