devise_pam_authenticatable2 5.0.1 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/devise_pam_authenticatable2.gemspec +2 -2
- data/lib/devise_pam_authenticatable/model.rb +8 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9612c985b409e41235b25bff4a0c9110aab3f632
|
4
|
+
data.tar.gz: 9e2a2918a8de29a63d495efb211ce46074086767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ec5e1245044b87712279ce487134b5d17e71efe802f6f30301b067e997a2674b520fc6d7391bec42e4cb0246a194bd008ce01c3f3b6ca08684c708018cd6c7
|
7
|
+
data.tar.gz: 7df42cbbc2df9263b44c829f784a4c6f5aa177841b5d8bd0b7014e9574db1583a1dc8b4eaf0cfd6d41a46db020f39351110262566f64475b10f97164b8b766e2
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ Important changes
|
|
29
29
|
Versions before 4.0.0 are limitted compatible with database_authenticatable.
|
30
30
|
Some removed code may can clash in earlier versions.
|
31
31
|
|
32
|
-
Version 5.0.0 change method names. Check if everything is correct.
|
32
|
+
Version 6.0.0 (and 5.0.0) change method names. Check if everything is correct.
|
33
33
|
|
34
34
|
Setup
|
35
35
|
-----
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6.0.0
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: devise_pam_authenticatable2
|
5
|
+
# stub: devise_pam_authenticatable2 6.0.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "devise_pam_authenticatable2".freeze
|
9
|
-
s.version = "
|
9
|
+
s.version = "6.0.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
@@ -14,18 +14,20 @@ module Devise
|
|
14
14
|
::Devise.pam_default_suffix
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def pam_conflict(_attributes)
|
18
|
+
# solve conflict between other and pam related user accounts
|
18
19
|
# to disable login with pam return nil elsewise return a (different?) user object
|
19
|
-
# as default assume there is never a conflict and return user object
|
20
|
+
# as default assume there is never a conflict and return user object unchanged
|
20
21
|
self
|
21
22
|
end
|
22
23
|
|
23
|
-
def
|
24
|
+
def pam_conflict?
|
25
|
+
# detect a conflict
|
24
26
|
# use blank password as discriminator between traditional login and pam login
|
25
|
-
resource.respond_to?('password') && resource.password.present? && is_pam_account
|
27
|
+
resource.respond_to?('password') && resource.password.present? && is_pam_account?
|
26
28
|
end
|
27
29
|
|
28
|
-
def is_pam_account
|
30
|
+
def is_pam_account?
|
29
31
|
return false unless get_pam_name
|
30
32
|
Rpam2.account(get_service, get_pam_name)
|
31
33
|
end
|
@@ -87,7 +89,7 @@ module Devise
|
|
87
89
|
end
|
88
90
|
|
89
91
|
# potential conflict detected
|
90
|
-
resource = resource.
|
92
|
+
resource = resource.pam_conflict(attributes) if resource.pam_conflict?
|
91
93
|
|
92
94
|
return nil unless resource && resource.try(:valid_pam_authentication?, attributes[:password])
|
93
95
|
if resource.new_record?
|