devise_pam_authenticatable2 4.0.0 → 5.0.0
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/MIT-LICENSE +1 -1
- data/README.md +8 -2
- data/VERSION +1 -1
- data/devise_pam_authenticatable2.gemspec +3 -3
- data/lib/devise_pam_authenticatable/model.rb +13 -4
- 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: 5347bab4c20cffd89d87fecb5d7242d9d157fa20
|
4
|
+
data.tar.gz: 152e411c4a5fcfeba64fc9aff53433554f4e62e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7230c55e58db7b42d852d1f08b3aa25ab67041cce5ddafbd759243f7685906a70e79cce9f258fbe918355f45235456cef2889c23f939506e9bb5f85a349ba6b7
|
7
|
+
data.tar.gz: 077c2fbe42c87b3a4bd5e6eacd437e70432b9aab4c7fb40078ecc8d92d5fa1e0daf1780416761495b7ae55b29ec8ad2381df8288e253a80c50708ecd25f42211
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -23,6 +23,14 @@ Or, to use the latest from github:
|
|
23
23
|
|
24
24
|
gem "devise_pam_authenticatable2", :git => "git://github.com/devkral/devise_pam_authenticatable2.git"
|
25
25
|
|
26
|
+
Important changes
|
27
|
+
-----------------
|
28
|
+
|
29
|
+
Versions before 4.0.0 are limitted compatible with database_authenticatable.
|
30
|
+
Some removed code may can clash in earlier versions.
|
31
|
+
|
32
|
+
Version 5.0.0 change method names. Check if everything is correct.
|
33
|
+
|
26
34
|
Setup
|
27
35
|
-----
|
28
36
|
|
@@ -61,5 +69,3 @@ References
|
|
61
69
|
|
62
70
|
|
63
71
|
Released under the MIT license
|
64
|
-
|
65
|
-
Copyright (c) 2011 James Wilson, LithiumCorp Pty Ltd
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
5.0.0
|
@@ -2,16 +2,16 @@
|
|
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 5.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 = "5.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]
|
13
13
|
s.authors = ["James Wilson".freeze, "Alexander Kaftan".freeze]
|
14
|
-
s.date = "2018-01-
|
14
|
+
s.date = "2018-01-17"
|
15
15
|
s.description = "For authenticating against PAM (Pluggable Authentication Modules)".freeze
|
16
16
|
s.email = "devkral@web.de".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -14,13 +14,22 @@ module Devise
|
|
14
14
|
::Devise.pam_default_suffix
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
# use blank password as discriminator between traditional login and pam login?
|
17
|
+
def on_pam_conflict(_attributes)
|
19
18
|
# to disable login with pam return nil elsewise return a (different?) user object
|
20
|
-
# as default assume there is
|
19
|
+
# as default assume there is never a conflict and return user object
|
21
20
|
self
|
22
21
|
end
|
23
22
|
|
23
|
+
def is_pam_conflict
|
24
|
+
# use blank password as discriminator between traditional login and pam login?
|
25
|
+
is_pam_account && resource.respond_to?('password') && resource.password.present?
|
26
|
+
end
|
27
|
+
|
28
|
+
def is_pam_account
|
29
|
+
return false unless get_pam_name
|
30
|
+
Rpam2.account(get_service, get_pam_name)
|
31
|
+
end
|
32
|
+
|
24
33
|
def pam_setup(attributes)
|
25
34
|
return unless ::Devise.emailfield && ::Devise.usernamefield
|
26
35
|
self[::Devise.emailfield] = Rpam2.getenv(get_service, get_pam_name, attributes[:password], 'email', false)
|
@@ -78,7 +87,7 @@ module Devise
|
|
78
87
|
end
|
79
88
|
|
80
89
|
# potential conflict detected
|
81
|
-
resource = resource.
|
90
|
+
resource = resource.on_pam_conflict(attributes) if resource.is_pam_conflict
|
82
91
|
|
83
92
|
return nil unless resource && resource.try(:valid_pam_authentication?, attributes[:password])
|
84
93
|
if resource.new_record?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_pam_authenticatable2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Wilson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-01-
|
12
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|