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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22c9c86b812e73b5efe16be144551c4f34dba934
4
- data.tar.gz: 03b52c2e065b3fe66560f94f37b05748663ba141
3
+ metadata.gz: 9612c985b409e41235b25bff4a0c9110aab3f632
4
+ data.tar.gz: 9e2a2918a8de29a63d495efb211ce46074086767
5
5
  SHA512:
6
- metadata.gz: 2773b5e5274c948b1b561cf12bf17de1ea6a3ec7c73d2ddaa72d3ef71404ca9ce193933a5351788db4808541c0786ac726f3b9963813073bf6aee84ddcbb21fd
7
- data.tar.gz: 812642d18bee988da2ff95ae5ef26b1aecebf0cfae123dafde6e819e96b55b130e3673ba65e7623717493ad8d0dbed3c931019b83286cd5764b672bc05583426
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
- 5.0.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.0.1 ruby lib
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 = "5.0.1"
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 on_pam_conflict(_attributes)
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 is_pam_conflict
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.on_pam_conflict(attributes) if resource.is_pam_conflict
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?
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: 5.0.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Wilson