devise_pam_authenticatable2 9.1.1 → 9.2.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 +2 -0
- data/VERSION +1 -1
- data/devise_pam_authenticatable2.gemspec +4 -4
- data/lib/devise_pam_authenticatable/model.rb +4 -3
- data/lib/devise_pam_authenticatable/strategy.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 043d95236199b167bb0f59c4110965214f39697e0d57a6c58299f4c0f7440fe0
|
4
|
+
data.tar.gz: befe373c3492dee5e3a7c29ffc97cd8ede34916ff9881bc0c23a87cfa3eafe11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d379b100f3d25a1216e0f297d0f41345ff1d1c33e1f9d41b5735c3230cf4ed294be3ad0627561542611567218e4dc78445b37cc0a20ae40e1e4dfa577cb551e6
|
7
|
+
data.tar.gz: 93a94042d83699e91fa40810351a2d3cce1eb3c28e5bc20ad5d0f948cfd357605203fdbd3011145d0bd196b8ec0870fa79bdd82c3bb792991780b66f2655cc59
|
data/README.md
CHANGED
@@ -35,6 +35,8 @@ Version 5-8 change method names. Check if everything is correct. Sorry for the q
|
|
35
35
|
|
36
36
|
In version 9 is_pam_account? is changed to pam_managed_user? because some linters hate the former name.
|
37
37
|
|
38
|
+
In version 9.2 pam_authentication must support a second argument (request). Only relevant if overwritten. Adds feature: pam gets now the remote ip address of the client as RHOST
|
39
|
+
|
38
40
|
Setup
|
39
41
|
-----
|
40
42
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
9.
|
1
|
+
9.2.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 9.
|
5
|
+
# stub: devise_pam_authenticatable2 9.2.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "devise_pam_authenticatable2".freeze
|
9
|
-
s.version = "9.
|
9
|
+
s.version = "9.2.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-
|
14
|
+
s.date = "2018-09-05"
|
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 = [
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
]
|
31
31
|
s.homepage = "http://github.com/devkral/devise_pam_authenticatable2".freeze
|
32
32
|
s.licenses = ["MIT".freeze]
|
33
|
-
s.rubygems_version = "2.7.
|
33
|
+
s.rubygems_version = "2.7.6".freeze
|
34
34
|
s.summary = "Devise PAM authentication module using rpam2".freeze
|
35
35
|
|
36
36
|
if s.respond_to? :specification_version then
|
@@ -53,9 +53,10 @@ module Devise
|
|
53
53
|
end
|
54
54
|
|
55
55
|
# Checks if a resource is valid upon authentication.
|
56
|
-
def pam_authentication(pw)
|
56
|
+
def pam_authentication(pw, request = nil)
|
57
57
|
return nil unless pam_get_name
|
58
|
-
|
58
|
+
rhost = request.remote_ip if request rescue nil
|
59
|
+
Rpam2.auth(find_pam_service, pam_get_name, pw, nil, rhost)
|
59
60
|
end
|
60
61
|
|
61
62
|
module ClassMethods
|
@@ -104,7 +105,7 @@ module Devise
|
|
104
105
|
# potential conflict detected
|
105
106
|
resource = resource.pam_conflict(attributes) if resource.pam_conflict?
|
106
107
|
|
107
|
-
return nil unless resource && resource.try(:pam_authentication, attributes[:password])
|
108
|
+
return nil unless resource && resource.try(:pam_authentication, attributes[:password], attributes[:request])
|
108
109
|
if resource.new_record?
|
109
110
|
resource.pam_setup(attributes)
|
110
111
|
resource.save!
|
@@ -7,7 +7,9 @@ class Devise::Strategies::PamAuthenticatable < Devise::Strategies::Authenticatab
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def authenticate!
|
10
|
-
|
10
|
+
pam_params = params[scope].clone
|
11
|
+
pam_params[:request] = request
|
12
|
+
if (resource = mapping.to.authenticate_with_pam(pam_params))
|
11
13
|
success!(resource)
|
12
14
|
else
|
13
15
|
fail(:invalid)
|
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: 9.
|
4
|
+
version: 9.2.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-
|
12
|
+
date: 2018-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.7.
|
78
|
+
rubygems_version: 2.7.6
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Devise PAM authentication module using rpam2
|