arkaan 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan.rb +6 -5
- data/lib/arkaan/account.rb +2 -0
- data/lib/arkaan/authentication.rb +5 -0
- data/lib/arkaan/authentication/session.rb +22 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82ee7964343babf536cf19a69c722969b5d22e10
|
4
|
+
data.tar.gz: 15bc5ff8dfd971385ceb02bc027b1aaad9ee348c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4e968e8158d51290d2e3172b864e5df82d010b34539222080b734ae24cc012fa81039ec7c5ba92812d6861e37d22e4f1322cb66ff687892ec9243d87e4935df
|
7
|
+
data.tar.gz: 124bef470de7ea4010abd02b1d65cff7e930275a61a1a7200d02450a00c86ed76880762c151615ed8484145bea83517c20f03f97a80542285db3746896d98841
|
data/lib/arkaan.rb
CHANGED
@@ -5,9 +5,10 @@ require 'active_support'
|
|
5
5
|
# Main module of the application, holding all the subsequent classes.
|
6
6
|
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
7
7
|
module Arkaan
|
8
|
-
autoload :Account
|
9
|
-
autoload :
|
10
|
-
autoload :Concerns
|
11
|
-
autoload :
|
12
|
-
autoload :
|
8
|
+
autoload :Account , 'arkaan/account'
|
9
|
+
autoload :Authentication, 'arkaan/authentication'
|
10
|
+
autoload :Concerns , 'arkaan/concerns'
|
11
|
+
autoload :Monitoring , 'arkaan/monitoring'
|
12
|
+
autoload :OAuth , 'arkaan/oauth'
|
13
|
+
autoload :Permissions , 'arkaan/permissions'
|
13
14
|
end
|
data/lib/arkaan/account.rb
CHANGED
@@ -44,6 +44,8 @@ module Arkaan
|
|
44
44
|
# @return [Array<Arkaan::Monitoring::Service] the services created by this user.
|
45
45
|
has_many :services, class_name: 'Arkaan::Monitoring::Service', inverse_of: :creator
|
46
46
|
|
47
|
+
has_many :sessions, class_name: 'Arkaan::Authentication::Session', inverse_of: :account
|
48
|
+
|
47
49
|
attr_readonly :password_digest
|
48
50
|
|
49
51
|
validates :username,
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Arkaan
|
2
|
+
module Authentication
|
3
|
+
class Session
|
4
|
+
include Mongoid::Document
|
5
|
+
include Mongoid::Timestamps
|
6
|
+
|
7
|
+
field :token, type: String
|
8
|
+
|
9
|
+
field :expiration, type: Integer, default: 0
|
10
|
+
|
11
|
+
belongs_to :account, class_name: 'Arkaan::Account', inverse_of: :sessions
|
12
|
+
|
13
|
+
validates :token,
|
14
|
+
presence: {message: 'session.token.blank'},
|
15
|
+
uniqueness: {message: 'session.token.uniq', if: :token?},
|
16
|
+
length: {minimum: 10, message: 'session.token.short', if: :token?}
|
17
|
+
|
18
|
+
validates :expiration,
|
19
|
+
presence: {message: 'session.expiration.blank'}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arkaan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -158,6 +158,8 @@ extra_rdoc_files: []
|
|
158
158
|
files:
|
159
159
|
- lib/arkaan.rb
|
160
160
|
- lib/arkaan/account.rb
|
161
|
+
- lib/arkaan/authentication.rb
|
162
|
+
- lib/arkaan/authentication/session.rb
|
161
163
|
- lib/arkaan/concerns.rb
|
162
164
|
- lib/arkaan/concerns/activable.rb
|
163
165
|
- lib/arkaan/concerns/diagnosticable.rb
|