authie 4.1.6 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authie/config.rb +12 -6
- data/lib/authie/session_model.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: ddad916da209c54dc53bf2aabe2b0f94c5b15b1941dd1cab7cb1ec10b9aec590
|
4
|
+
data.tar.gz: 77bcb911fbdc14073ccde156fec9b7cc8ed5af6412145a3b75c4ab71ad4ec433
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41b27e2c0682660062723bef2c165848a338e8214f6620b50fc8e3d0f15ceed1568aec6864320a72c57d4f50900f6385820b2ca84a7a28eb17685d29ce18b53b
|
7
|
+
data.tar.gz: 93c84d1152582d08bcb6f3aa758d9de99565e123484203cb1bd2e51ca26fe668e37ea50688763fc7394c4bf07e2a3783ad58ec6477c46683df9bc855e1493197
|
data/lib/authie/config.rb
CHANGED
@@ -9,8 +9,19 @@ module Authie
|
|
9
9
|
attr_accessor :session_token_length
|
10
10
|
attr_accessor :extend_session_expiry_on_touch
|
11
11
|
attr_accessor :lookup_ip_country_backend
|
12
|
+
attr_accessor :serialize_coder
|
12
13
|
|
13
14
|
def initialize
|
15
|
+
set_defaults
|
16
|
+
end
|
17
|
+
|
18
|
+
def lookup_ip_country(ip)
|
19
|
+
return nil if @lookup_ip_country_backend.nil?
|
20
|
+
|
21
|
+
@lookup_ip_country_backend.call(ip)
|
22
|
+
end
|
23
|
+
|
24
|
+
def set_defaults
|
14
25
|
@session_inactivity_timeout = 12.hours
|
15
26
|
@persistent_session_length = 2.months
|
16
27
|
@sudo_session_timeout = 10.minutes
|
@@ -18,12 +29,7 @@ module Authie
|
|
18
29
|
@session_token_length = 64
|
19
30
|
@extend_session_expiry_on_touch = false
|
20
31
|
@lookup_ip_country_backend = nil
|
21
|
-
|
22
|
-
|
23
|
-
def lookup_ip_country(ip)
|
24
|
-
return nil if @lookup_ip_country_backend.nil?
|
25
|
-
|
26
|
-
@lookup_ip_country_backend.call(ip)
|
32
|
+
@serialize_coder = ActiveRecord::Coders::YAMLColumn
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
data/lib/authie/session_model.rb
CHANGED
@@ -17,7 +17,7 @@ module Authie
|
|
17
17
|
scope :for_user, ->(user) { where(user_type: user.class.name, user_id: user.id) }
|
18
18
|
|
19
19
|
# Attributes
|
20
|
-
serialize :data, type: Hash
|
20
|
+
serialize :data, type: Hash, coder: Authie.config.serialize_coder
|
21
21
|
|
22
22
|
before_validation :shorten_strings
|
23
23
|
before_create :set_new_token
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|