authlogic 3.4.1 → 3.4.2
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 +27 -32
- data/authlogic.gemspec +8 -8
- data/lib/authlogic.rb +1 -7
- data/lib/authlogic/acts_as_authentic/password.rb +5 -1
- data/lib/authlogic/acts_as_authentic/restful_authentication.rb +7 -7
- data/lib/authlogic/crypto_providers.rb +11 -0
- data/lib/authlogic/regex.rb +5 -5
- data/test/test_helper.rb +1 -1
- metadata +23 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3c45b3e20668e033c6495eead74fffb26f49e2d
|
4
|
+
data.tar.gz: 5874acbfdecb0756c3832cf7529be7096dc5285a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd5a1c9152c9b908e19788a93e5b6c81c6e445a16518278114e52110243acec868beacb1e2a901b5c9a6267ce15e2c58fafca16e788e49cb8d6ae6d0593ebd3
|
7
|
+
data.tar.gz: 6b59e97756f951c24bd0b7a79830bab6f1ab4f23e21446c6c49b90128d6aee29daa05d3a047a741d856810930591ef0dbee6d1a31a8b18c5591b0dbd3edc0a38
|
data/Gemfile.lock
CHANGED
@@ -1,61 +1,56 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
authlogic (3.4.
|
4
|
+
authlogic (3.4.2)
|
5
5
|
activerecord (>= 3.2)
|
6
6
|
activesupport (>= 3.2)
|
7
|
-
request_store (~> 1.0
|
7
|
+
request_store (~> 1.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (4.0
|
13
|
-
activesupport (= 4.0
|
14
|
-
builder (~> 3.1
|
15
|
-
activerecord (4.0
|
16
|
-
activemodel (= 4.0
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
minitest (~> 4.2)
|
24
|
-
multi_json (~> 1.3)
|
12
|
+
activemodel (4.1.0)
|
13
|
+
activesupport (= 4.1.0)
|
14
|
+
builder (~> 3.1)
|
15
|
+
activerecord (4.1.0)
|
16
|
+
activemodel (= 4.1.0)
|
17
|
+
activesupport (= 4.1.0)
|
18
|
+
arel (~> 5.0.0)
|
19
|
+
activesupport (4.1.0)
|
20
|
+
i18n (~> 0.6, >= 0.6.9)
|
21
|
+
json (~> 1.7, >= 1.7.7)
|
22
|
+
minitest (~> 5.1)
|
25
23
|
thread_safe (~> 0.1)
|
26
|
-
tzinfo (~>
|
27
|
-
arel (
|
28
|
-
atomic (1.1.15)
|
24
|
+
tzinfo (~> 1.1)
|
25
|
+
arel (5.0.1.20140414130214)
|
29
26
|
bcrypt (3.1.7)
|
30
27
|
bcrypt-ruby (3.1.5)
|
31
28
|
bcrypt (>= 3.1.3)
|
32
|
-
builder (3.
|
29
|
+
builder (3.2.2)
|
33
30
|
ffi (1.9.3)
|
34
31
|
ffi-compiler (0.1.3)
|
35
32
|
ffi (>= 1.0.0)
|
36
33
|
rake
|
37
34
|
i18n (0.6.9)
|
38
|
-
|
39
|
-
|
40
|
-
rake (10.
|
35
|
+
json (1.8.1)
|
36
|
+
minitest (5.3.3)
|
37
|
+
rake (10.3.1)
|
41
38
|
request_store (1.0.5)
|
42
|
-
scrypt (1.2.
|
39
|
+
scrypt (1.2.1)
|
43
40
|
ffi-compiler (>= 0.0.2)
|
44
41
|
rake
|
45
42
|
sqlite3 (1.3.9)
|
46
|
-
thread_safe (0.
|
47
|
-
atomic (>= 1.1.7, < 2)
|
43
|
+
thread_safe (0.3.3)
|
48
44
|
timecop (0.7.1)
|
49
|
-
tzinfo (
|
45
|
+
tzinfo (1.1.0)
|
46
|
+
thread_safe (~> 0.1)
|
50
47
|
|
51
48
|
PLATFORMS
|
52
49
|
ruby
|
53
50
|
|
54
51
|
DEPENDENCIES
|
55
52
|
authlogic!
|
56
|
-
bcrypt-ruby (
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
sqlite3 (>= 1.3.9)
|
61
|
-
timecop (>= 0.7.1)
|
53
|
+
bcrypt-ruby (~> 3.1)
|
54
|
+
scrypt (~> 1.2)
|
55
|
+
sqlite3 (~> 1.3)
|
56
|
+
timecop (~> 0.7)
|
data/authlogic.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "authlogic"
|
6
|
-
s.version = "3.4.
|
6
|
+
s.version = "3.4.2"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Ben Johnson"]
|
9
9
|
s.email = ["bjohnson@binarylogic.com"]
|
@@ -11,15 +11,15 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = %q{A clean, simple, and unobtrusive ruby authentication solution.}
|
12
12
|
s.description = %q{A clean, simple, and unobtrusive ruby authentication solution.}
|
13
13
|
|
14
|
+
s.license = 'MIT'
|
15
|
+
|
14
16
|
s.add_dependency 'activerecord', '>= 3.2'
|
15
17
|
s.add_dependency 'activesupport', '>= 3.2'
|
16
|
-
s.add_dependency 'request_store', '~>1.0
|
17
|
-
s.add_development_dependency '
|
18
|
-
s.add_development_dependency '
|
19
|
-
s.add_development_dependency '
|
20
|
-
s.add_development_dependency '
|
21
|
-
s.add_development_dependency 'timecop', '>= 0.7.1'
|
22
|
-
s.add_development_dependency 'i18n', '>= 0.6.9'
|
18
|
+
s.add_dependency 'request_store', '~> 1.0'
|
19
|
+
s.add_development_dependency 'bcrypt-ruby', '~> 3.1'
|
20
|
+
s.add_development_dependency 'scrypt', '~> 1.2'
|
21
|
+
s.add_development_dependency 'sqlite3', '~> 1.3'
|
22
|
+
s.add_development_dependency 'timecop', '~> 0.7'
|
23
23
|
|
24
24
|
s.files = `git ls-files`.split("\n")
|
25
25
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/authlogic.rb
CHANGED
@@ -9,13 +9,7 @@ path = File.dirname(__FILE__) + "/authlogic/"
|
|
9
9
|
|
10
10
|
"controller_adapters/abstract_adapter",
|
11
11
|
|
12
|
-
"crypto_providers
|
13
|
-
"crypto_providers/sha1",
|
14
|
-
"crypto_providers/sha256",
|
15
|
-
"crypto_providers/sha512",
|
16
|
-
"crypto_providers/bcrypt",
|
17
|
-
"crypto_providers/aes256",
|
18
|
-
"crypto_providers/scrypt",
|
12
|
+
"crypto_providers",
|
19
13
|
|
20
14
|
"authenticates_many/base",
|
21
15
|
"authenticates_many/association",
|
@@ -149,7 +149,11 @@ module Authlogic
|
|
149
149
|
# * <tt>Default:</tt> CryptoProviders::SCrypt
|
150
150
|
# * <tt>Accepts:</tt> Class
|
151
151
|
def crypto_provider(value = nil)
|
152
|
-
|
152
|
+
if value.nil? and !acts_as_authentic_config.include?(:crypto_provider)
|
153
|
+
rw_config(:crypto_provider, CryptoProviders::SCrypt)
|
154
|
+
else
|
155
|
+
rw_config(:crypto_provider, value)
|
156
|
+
end
|
153
157
|
end
|
154
158
|
alias_method :crypto_provider=, :crypto_provider
|
155
159
|
|
@@ -8,7 +8,7 @@ module Authlogic
|
|
8
8
|
include InstanceMethods
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
module Config
|
13
13
|
# Switching an existing app to Authlogic from restful_authentication? No problem, just set this true and your users won't know
|
14
14
|
# anything changed. From your database perspective nothing will change at all. Authlogic will continue to encrypt passwords
|
@@ -23,18 +23,18 @@ module Authlogic
|
|
23
23
|
r
|
24
24
|
end
|
25
25
|
alias_method :act_like_restful_authentication=, :act_like_restful_authentication
|
26
|
-
|
26
|
+
|
27
27
|
# This works just like act_like_restful_authentication except that it will start transitioning your users to the algorithm you
|
28
28
|
# specify with the crypto provider option. The next time they log in it will resave their password with the new algorithm
|
29
29
|
# and any new record will use the new algorithm as well. Make sure to update your users table if you are using the default
|
30
|
-
# migration since it will set crypted_password and salt columns to a maximum width of 40 characters which is not enough.
|
30
|
+
# migration since it will set crypted_password and salt columns to a maximum width of 40 characters which is not enough.
|
31
31
|
def transition_from_restful_authentication(value = nil)
|
32
32
|
r = rw_config(:transition_from_restful_authentication, value, false)
|
33
33
|
set_restful_authentication_config if value
|
34
34
|
r
|
35
35
|
end
|
36
36
|
alias_method :transition_from_restful_authentication=, :transition_from_restful_authentication
|
37
|
-
|
37
|
+
|
38
38
|
private
|
39
39
|
def set_restful_authentication_config
|
40
40
|
crypto_provider_key = act_like_restful_authentication ? :crypto_provider : :transition_from_crypto_providers
|
@@ -45,17 +45,17 @@ module Authlogic
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
module InstanceMethods
|
50
50
|
private
|
51
51
|
def act_like_restful_authentication?
|
52
52
|
self.class.act_like_restful_authentication == true
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
def transition_from_restful_authentication?
|
56
56
|
self.class.transition_from_restful_authentication == true
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
61
|
-
end
|
61
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Authlogic
|
2
|
+
module CryptoProviders
|
3
|
+
autoload :MD5, "authlogic/crypto_providers/md5"
|
4
|
+
autoload :Sha1, "authlogic/crypto_providers/sha1"
|
5
|
+
autoload :Sha256, "authlogic/crypto_providers/sha256"
|
6
|
+
autoload :Sha512, "authlogic/crypto_providers/sha512"
|
7
|
+
autoload :BCrypt, "authlogic/crypto_providers/bcrypt"
|
8
|
+
autoload :AES256, "authlogic/crypto_providers/aes256"
|
9
|
+
autoload :SCrypt, "authlogic/crypto_providers/scrypt"
|
10
|
+
end
|
11
|
+
end
|
data/lib/authlogic/regex.rb
CHANGED
@@ -5,15 +5,15 @@ module Authlogic
|
|
5
5
|
#
|
6
6
|
# validates_format_of :my_email_field, :with => Authlogic::Regex.email
|
7
7
|
module Regex
|
8
|
-
# A general email regular expression. It allows top level domains (TLD) to be from 2 -
|
9
|
-
#
|
10
|
-
# by reading this website: http://www.regular-expressions.info/email.html,
|
11
|
-
# for regular expressions.
|
8
|
+
# A general email regular expression. It allows top level domains (TLD) to be from 2 - 13 in length.
|
9
|
+
# The decisions behind this regular expression were made by analyzing the list of top-level domains
|
10
|
+
# maintained by IANA and by reading this website: http://www.regular-expressions.info/email.html,
|
11
|
+
# which is an excellent resource for regular expressions.
|
12
12
|
def self.email
|
13
13
|
@email_regex ||= begin
|
14
14
|
email_name_regex = '[A-Z0-9_\.%\+\-\']+'
|
15
15
|
domain_head_regex = '(?:[A-Z0-9\-]+\.)+'
|
16
|
-
domain_tld_regex = '(?:[A-Z]{2,
|
16
|
+
domain_tld_regex = '(?:[A-Z]{2,13})'
|
17
17
|
/\A#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}\z/i
|
18
18
|
end
|
19
19
|
end
|
data/test/test_helper.rb
CHANGED
@@ -14,7 +14,7 @@ logger = Logger.new(STDOUT)
|
|
14
14
|
logger.level= Logger::FATAL
|
15
15
|
ActiveRecord::Base.logger = logger
|
16
16
|
|
17
|
-
ActiveRecord::Base.configurations = true
|
17
|
+
#ActiveRecord::Base.configurations = true
|
18
18
|
ActiveRecord::Base.default_timezone = :local
|
19
19
|
ActiveRecord::Schema.define(:version => 1) do
|
20
20
|
create_table :companies do |t|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -44,98 +44,70 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 10.1.1
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 10.1.1
|
54
|
+
version: '1.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: bcrypt-ruby
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.1
|
61
|
+
version: '3.1'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - "
|
66
|
+
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.1
|
68
|
+
version: '3.1'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: scrypt
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
73
|
+
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.2
|
75
|
+
version: '1.2'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.2
|
82
|
+
version: '1.2'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: sqlite3
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- - "
|
87
|
+
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.3
|
89
|
+
version: '1.3'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- - "
|
94
|
+
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.3
|
96
|
+
version: '1.3'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: timecop
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- - "
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.7.1
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 0.7.1
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: i18n
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
101
|
+
- - "~>"
|
130
102
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
103
|
+
version: '0.7'
|
132
104
|
type: :development
|
133
105
|
prerelease: false
|
134
106
|
version_requirements: !ruby/object:Gem::Requirement
|
135
107
|
requirements:
|
136
|
-
- - "
|
108
|
+
- - "~>"
|
137
109
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
110
|
+
version: '0.7'
|
139
111
|
description: A clean, simple, and unobtrusive ruby authentication solution.
|
140
112
|
email:
|
141
113
|
- bjohnson@binarylogic.com
|
@@ -172,6 +144,7 @@ files:
|
|
172
144
|
- lib/authlogic/controller_adapters/rack_adapter.rb
|
173
145
|
- lib/authlogic/controller_adapters/rails_adapter.rb
|
174
146
|
- lib/authlogic/controller_adapters/sinatra_adapter.rb
|
147
|
+
- lib/authlogic/crypto_providers.rb
|
175
148
|
- lib/authlogic/crypto_providers/aes256.rb
|
176
149
|
- lib/authlogic/crypto_providers/bcrypt.rb
|
177
150
|
- lib/authlogic/crypto_providers/md5.rb
|
@@ -273,7 +246,8 @@ files:
|
|
273
246
|
- test/session_test/validation_test.rb
|
274
247
|
- test/test_helper.rb
|
275
248
|
homepage: http://github.com/binarylogic/authlogic
|
276
|
-
licenses:
|
249
|
+
licenses:
|
250
|
+
- MIT
|
277
251
|
metadata: {}
|
278
252
|
post_install_message:
|
279
253
|
rdoc_options: []
|