arkaan 0.8.11 → 0.8.12
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 +9 -9
- data/lib/arkaan/authentication/session.rb +3 -3
- data/lib/arkaan/campaign.rb +3 -3
- data/lib/arkaan/campaigns/tag.rb +2 -2
- data/lib/arkaan/concerns/diagnosticable.rb +3 -3
- data/lib/arkaan/concerns/sluggable.rb +4 -4
- data/lib/arkaan/monitoring/gateway.rb +4 -8
- data/lib/arkaan/monitoring/instance.rb +2 -2
- data/lib/arkaan/monitoring/route.rb +2 -2
- data/lib/arkaan/monitoring/service.rb +2 -2
- data/lib/arkaan/oauth/access_token.rb +3 -1
- data/lib/arkaan/oauth/application.rb +7 -2
- data/lib/arkaan/oauth/authorization.rb +3 -1
- 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: 274d18d1f23d156f2665a5bd1359fe482a0736cd
|
4
|
+
data.tar.gz: 0db5765f3a5aec00ea6cbcd9e3f23828ee3a8eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d8915708a7e1a471ae84c6e8d7201ae742aaa1b524b59d67a7beb9f9b0baa4d4510fc8fbb2d8f4291d9d685c12976138c55c6e1f7be68f97444fd58637018ec
|
7
|
+
data.tar.gz: a435fab17ee5dca22cf9a3de9c80b5c825f9aeda6e989cb060183e31c9c5c884d37844e445fb5726ab102c8dd88f14e2ed5ca72eb7b51cd4aeab2ad3a286ac6d
|
data/lib/arkaan/account.rb
CHANGED
@@ -58,20 +58,20 @@ module Arkaan
|
|
58
58
|
has_many :created_invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :creator
|
59
59
|
|
60
60
|
validates :username,
|
61
|
-
presence: {message: '
|
62
|
-
length: {minimum: 6, message: '
|
63
|
-
uniqueness: {message: '
|
61
|
+
presence: {message: 'required'},
|
62
|
+
length: {minimum: 6, message: 'minlength', if: :username?},
|
63
|
+
uniqueness: {message: 'uniq', if: :username?}
|
64
64
|
|
65
65
|
validates :email,
|
66
|
-
presence: {message: '
|
67
|
-
format: {with: /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\z/, message: '
|
68
|
-
uniqueness: {message: '
|
66
|
+
presence: {message: 'required'},
|
67
|
+
format: {with: /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\z/, message: 'pattern', if: :email?},
|
68
|
+
uniqueness: {message: 'uniq', if: :email?}
|
69
69
|
|
70
70
|
validates :password,
|
71
|
-
presence: {message: '
|
72
|
-
confirmation: {message: '
|
71
|
+
presence: {message: 'required', if: ->{ !persisted? || password_digest_changed? }},
|
72
|
+
confirmation: {message: 'confirmation', if: :password_digest_changed?}
|
73
73
|
|
74
74
|
validates :password_confirmation,
|
75
|
-
presence: {message: '
|
75
|
+
presence: {message: 'required', if: :password_digest_changed?}
|
76
76
|
end
|
77
77
|
end
|
@@ -17,9 +17,9 @@ module Arkaan
|
|
17
17
|
belongs_to :account, class_name: 'Arkaan::Account', inverse_of: :sessions
|
18
18
|
|
19
19
|
validates :token,
|
20
|
-
presence: {message: '
|
21
|
-
uniqueness: {message: '
|
22
|
-
length: {minimum: 10, message: '
|
20
|
+
presence: {message: 'required'},
|
21
|
+
uniqueness: {message: 'uniq', if: :token?},
|
22
|
+
length: {minimum: 10, message: 'minlength', if: :token?}
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/arkaan/campaign.rb
CHANGED
@@ -27,15 +27,15 @@ module Arkaan
|
|
27
27
|
has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :campaign
|
28
28
|
|
29
29
|
validates :title,
|
30
|
-
presence: {message: '
|
31
|
-
length: {minimum: 4, message: '
|
30
|
+
presence: {message: 'required'},
|
31
|
+
length: {minimum: 4, message: 'minlength', if: :title?}
|
32
32
|
|
33
33
|
validate :title_unicity
|
34
34
|
|
35
35
|
# Adds an error message if the account creating this campaign already has a campaign with the very same name.
|
36
36
|
def title_unicity
|
37
37
|
if creator? && title? && creator.campaigns.where(title: title, :id.ne => _id).exists?
|
38
|
-
errors.add(:title, '
|
38
|
+
errors.add(:title, 'uniq')
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/arkaan/campaigns/tag.rb
CHANGED
@@ -14,8 +14,8 @@ module Arkaan
|
|
14
14
|
field :count, type: Integer, default: 1
|
15
15
|
|
16
16
|
validates :content,
|
17
|
-
presence: {message: '
|
18
|
-
uniqueness: {message: '
|
17
|
+
presence: {message: 'required'},
|
18
|
+
uniqueness: {message: 'uniq'}
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -16,9 +16,9 @@ module Arkaan
|
|
16
16
|
field :diagnostic, type: String, default: '/status'
|
17
17
|
|
18
18
|
validates :diagnostic,
|
19
|
-
presence: {message: "
|
20
|
-
length: {minimum: 4, message: "
|
21
|
-
format: {with: /\A(\/[a-z]+)+\z/, message: "
|
19
|
+
presence: {message: "required"},
|
20
|
+
length: {minimum: 4, message: "minlength"},
|
21
|
+
format: {with: /\A(\/[a-z]+)+\z/, message: "pattern"}
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -16,10 +16,10 @@ module Arkaan
|
|
16
16
|
field :slug, type: String
|
17
17
|
|
18
18
|
validates :slug,
|
19
|
-
length: {minimum: 4, message:
|
20
|
-
format: {with: /\A[a-z]+(_[a-z]+)*\z/, message:
|
21
|
-
uniqueness: {message:
|
22
|
-
presence: {message:
|
19
|
+
length: {minimum: 4, message: 'minlength', if: :slug?},
|
20
|
+
format: {with: /\A[a-z]+(_[a-z]+)*\z/, message: 'pattern', if: :slug?},
|
21
|
+
uniqueness: {message: 'uniq', if: :slug?},
|
22
|
+
presence: {message: 'required'}
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -23,16 +23,12 @@ module Arkaan
|
|
23
23
|
make_diagnosticable 'gateway'
|
24
24
|
|
25
25
|
validates :url,
|
26
|
-
presence: {message: '
|
27
|
-
format: {
|
28
|
-
with: /\A(https?:\/\/)((localhost:[0-9]+)|(([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*))\/?\z/,
|
29
|
-
message: 'gateway.url.format',
|
30
|
-
if: :url?
|
31
|
-
}
|
26
|
+
presence: {message: 'required'},
|
27
|
+
format: {with: /\A(https?:\/\/)((localhost:[0-9]+)|(([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*))\/?\z/, message: 'pattern', if: :url?}
|
32
28
|
|
33
29
|
validates :token,
|
34
|
-
presence: {message: '
|
35
|
-
uniqueness: {message: '
|
30
|
+
presence: {message: 'required'},
|
31
|
+
uniqueness: {message: 'uniq'}
|
36
32
|
end
|
37
33
|
end
|
38
34
|
end
|
@@ -21,8 +21,8 @@ module Arkaan
|
|
21
21
|
embedded_in :service, class_name: 'Arkaan::Monitoring::Service', inverse_of: :instances
|
22
22
|
|
23
23
|
validates :url,
|
24
|
-
presence: {message: '
|
25
|
-
format: {with: /\A(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\z/, message: '
|
24
|
+
presence: {message: 'required'},
|
25
|
+
format: {with: /\A(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\z/, message: 'pattern', if: :url?}
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -27,10 +27,10 @@ module Arkaan
|
|
27
27
|
has_and_belongs_to_many :groups, class_name: 'Arkaan::Permissions::Group', inverse_of: :groups
|
28
28
|
|
29
29
|
validates :path,
|
30
|
-
format: {with: /\A(\/|((\/:?[a-zA-Z0-9]+)+))\z/, message: '
|
30
|
+
format: {with: /\A(\/|((\/:?[a-zA-Z0-9]+)+))\z/, message: 'pattern', if: :path?}
|
31
31
|
|
32
32
|
validates :verb,
|
33
|
-
inclusion: {message: '
|
33
|
+
inclusion: {message: 'unknown', in: ['get', 'post', 'put', 'delete', 'patch', 'option']}
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -28,9 +28,9 @@ module Arkaan
|
|
28
28
|
# @return [Array<Arkaan::Monitoring::Route>] the routes associated to this service, accessible from the gateway.
|
29
29
|
has_many :routes, class_name: 'Arkaan::Monitoring::Route', inverse_of: :service
|
30
30
|
|
31
|
-
validates :key, uniqueness: {message: '
|
31
|
+
validates :key, uniqueness: {message: 'uniq'}
|
32
32
|
|
33
|
-
validates :path, format: {with: /\A(\/:?[a-z]+)+\z/, message: '
|
33
|
+
validates :path, format: {with: /\A(\/:?[a-z]+)+\z/, message: 'pattern'}
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -17,7 +17,9 @@ module Arkaan
|
|
17
17
|
# @return [Arkaan::OAuth::Authorization] the authorization code that issued this token to the application for this user.
|
18
18
|
belongs_to :authorization, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :access_token
|
19
19
|
|
20
|
-
validates :value,
|
20
|
+
validates :value,
|
21
|
+
presence: {message: 'required'},
|
22
|
+
uniqueness: {message: 'uniq'}
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -23,9 +23,14 @@ module Arkaan
|
|
23
23
|
# @return [Array<Arkaan::OAuth::Authorization>] the authorizations linked to the accounts this application can get the data from.
|
24
24
|
has_many :authorizations, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :application
|
25
25
|
|
26
|
-
validates :name,
|
26
|
+
validates :name,
|
27
|
+
presence: {message: 'required'},
|
28
|
+
length: {minimum: 6, message: 'minlength'},
|
29
|
+
uniqueness: {message: 'uniq'}
|
27
30
|
|
28
|
-
validates :key,
|
31
|
+
validates :key,
|
32
|
+
presence: {message: 'required'},
|
33
|
+
uniqueness: {message: 'uniq'}
|
29
34
|
end
|
30
35
|
end
|
31
36
|
end
|
@@ -20,7 +20,9 @@ module Arkaan
|
|
20
20
|
# @return [Arkaan::OAuth::AccessToken] the access token used further in the application process to access private data of the account.
|
21
21
|
has_one :token, class_name: 'Arkaan::OAuth::AccessToken', inverse_of: :authorization
|
22
22
|
|
23
|
-
validates :code,
|
23
|
+
validates :code,
|
24
|
+
presence: {message: 'required'},
|
25
|
+
uniqueness: {message: 'uniq'}
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|