arkaan 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/account.rb +5 -0
- data/lib/arkaan/monitoring.rb +2 -1
- data/lib/arkaan/monitoring/service.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d5bfcbb6a55477730bc17089ae04af810db865e
|
4
|
+
data.tar.gz: 478a4b33dbd76b7094db1ad123cc1557bb908201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1030fcdca64b8db9f3d829abcff756d04927fff76465c800899ec357e47148e7df126b6f13e51ba86cf7824baa46ba1559471a2350f8499bc96c9e678a309e90
|
7
|
+
data.tar.gz: 0bd87c8ee10f222a47674eb55248ec31c3145dfc3e7bf0270b4e160265a3e269e1884f86215daa64a2b6d9407cca90ca5616e65cfedff088c5ebdc7a304d3488
|
data/lib/arkaan/account.rb
CHANGED
@@ -40,6 +40,11 @@ module Arkaan
|
|
40
40
|
# @!attribute [rw] authorizations
|
41
41
|
# @return [Array<Arkaan::OAuth::Authorization>] the authorization issued by this account to third-party applications to access its data.
|
42
42
|
has_many :authorizations, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :account
|
43
|
+
# @!attribute [rw] services
|
44
|
+
# @return [Array<Arkaan::Monitoring::Service] the services created by this user.
|
45
|
+
has_many :services, class_name: 'Arkaan::Monitoring::Service', inverse_of: :creator
|
46
|
+
|
47
|
+
attr_readonly :password_digest
|
43
48
|
|
44
49
|
validates :username,
|
45
50
|
presence: {message: 'account.username.blank'},
|
data/lib/arkaan/monitoring.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Arkaan
|
2
|
+
# The monitoring module holds all the logic about the services so they can be activated or deactivated.
|
3
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
2
4
|
module Monitoring
|
3
5
|
autoload :Service, 'arkaan/monitoring/service'
|
4
|
-
autoload :Route , 'arkaan/monitoring/route'
|
5
6
|
end
|
6
7
|
end
|
@@ -1,14 +1,21 @@
|
|
1
1
|
module Arkaan
|
2
2
|
module Monitoring
|
3
|
+
# A service is the representation of one of the applications composing the API.
|
4
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
3
5
|
class Service
|
4
6
|
include Mongoid::Document
|
5
7
|
include Mongoid::Timestamps
|
6
8
|
|
9
|
+
# @!attribute [rw] key
|
10
|
+
# @return [String] the name, or title of the service, optionally given to identify it more easily.
|
7
11
|
field :key, type: String
|
8
|
-
|
12
|
+
# @!attribute [rw] url
|
13
|
+
# @return [String] the URL of the service, where the requests will be issued.
|
9
14
|
field :url, type: String
|
10
15
|
|
11
|
-
|
16
|
+
# @!attribute [rw] creator
|
17
|
+
# @return [Arkaan::Account] the creator of this service.
|
18
|
+
belongs_to :creator, class_name: 'Arkaan::Account', optional: true, inverse_of: :services
|
12
19
|
|
13
20
|
validates :key, uniqueness: {message: 'service.key.uniq'}
|
14
21
|
|