unidom-visitor 0.5 → 0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 714c4e6a3e454a732640343b4202d6c175c13d77
4
- data.tar.gz: 7a8418e4a465732080e0776e650911142cd0e471
3
+ metadata.gz: 2deb20a10510bafbc43d8daed41bb0f6568f4cd8
4
+ data.tar.gz: 5081d87ec23955780fd9ddc2b053cb457c6671c3
5
5
  SHA512:
6
- metadata.gz: 26cba1129754ecdc5db6e62f6a721b22683810fee6a3dfe1db9b1a6afff387ae03cdd96e497814d516816724e5aa8f72aab284ef5637effe3817b77a618d2a24
7
- data.tar.gz: 5776aa07d31a1a35a9e51041be7700099c8eafbb9300dd6495ee7adaa76008e94c72f3f494b2a19a889e8ba0fdacb4157812aad86c6917bf08874959f54bb592
6
+ metadata.gz: 916792a07078800f18ba7dc49c5b01af83826918925749079d9090dc436e7b05d10d489225366f26b44981ec9880be49927a743f9e2431b9b917c8e9a05b6404
7
+ data.tar.gz: 3b22150addef1f32cb4cfba4df5c0d079f4085151e49f5a8bb678d562b4aa1c08a9f22f9f108ef524a2825869e0ed00c93cdd9a95fda36e8513dca8cb9f8a537
@@ -4,19 +4,22 @@ class Unidom::Visitor::Password < ActiveRecord::Base
4
4
 
5
5
  self.table_name = 'unidom_passwords'
6
6
 
7
- has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential
8
-
9
7
  include Unidom::Common::Concerns::ModelExtension
10
8
 
9
+ validates :clear_text, presence: true, length: { in: 6..200 }
10
+
11
+ has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential
12
+
11
13
  def generate_pepper_content
12
14
  self.pepper_content = self.pepper_content||::SecureRandom.hex(self.class.columns_hash['pepper_content'].limit/2)
13
15
  end
14
16
 
15
17
  def clear_text
16
- ''
18
+ @clear_text
17
19
  end
18
20
 
19
21
  def clear_text=(password)
22
+ @clear_text = password
20
23
  generate_pepper_content
21
24
  self.hashed_content = hash password
22
25
  end
@@ -20,7 +20,7 @@ class Unidom::Visitor::User < ActiveRecord::Base
20
20
  Rails.logger.debug "Signing up user with identity: #{identity.inspect}."
21
21
  return false if identified_by(identity).valid_at.alive.merge(Unidom::Visitor::Identificating.valid_at.alive).count>0
22
22
 
23
- user = self.create! opened_at: opened_at
23
+ user = create! opened_at: opened_at
24
24
  identificating = Unidom::Visitor::Identificating.identificate user, identity
25
25
 
26
26
  Rails.logger.debug "Authenticate user #{user.id} with password: #{password.inspect}."
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Visitor
3
- VERSION = '0.5'.freeze
3
+ VERSION = '0.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-visitor
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common