arkaan 2.1.0 → 2.3.0
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 +4 -4
- data/lib/arkaan/oauth/application.rb +20 -0
- data/lib/arkaan/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3b465b5fc4b05bb9c7418535aad8e08604e5a31a9ced1f59c35b1b9e034564a
|
4
|
+
data.tar.gz: f4b606b42e585e3f76fb67822438e45c3db8e992d0e147a6aa862269b2542ba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d10d9f661bd8a6a2355e1e9f5d3d8facda27b109c0573a95a0a36a99298b286b4e5aa232f0d43b5a57fe9428f320abe1fff64a1b29ba1262eb7132102a757d07
|
7
|
+
data.tar.gz: 01405711bc3616838a2dfa1ba589b19f1ed747c0ad1357f556f350cd5525779fb662231f6dbe2eebc169d6d8f7c93b6c5537e61877d8ed24c8127355715654e9
|
@@ -15,6 +15,9 @@ module Arkaan
|
|
15
15
|
# @!attribute [rw] premium
|
16
16
|
# @return [Boolean] a value indicating whether the application should automatically receive a token when an account is created, or not.
|
17
17
|
field :premium, type: Boolean, default: false
|
18
|
+
# @!attirbute [rw] redirect_uris
|
19
|
+
# @return [Array<String>] the redirection URIs used for this application.
|
20
|
+
field :redirect_uris, type: Array, default: []
|
18
21
|
|
19
22
|
# @!attribute [rw] creator
|
20
23
|
# @return [Arkaan::Account] the account that has created this application, considered its owner.
|
@@ -31,6 +34,23 @@ module Arkaan
|
|
31
34
|
validates :key,
|
32
35
|
presence: {message: 'required'},
|
33
36
|
uniqueness: {message: 'uniq'}
|
37
|
+
|
38
|
+
validate :redirect_uris_values
|
39
|
+
|
40
|
+
# Checks the URIs to get sure they are correct, a URI is correct if :
|
41
|
+
# - it is a string
|
42
|
+
# - it has a correct URL format.
|
43
|
+
def redirect_uris_values
|
44
|
+
redirect_uris.each do |uri|
|
45
|
+
if !uri.is_a? String
|
46
|
+
errors.add(:redirect_uris, 'type')
|
47
|
+
break
|
48
|
+
elsif uri.match(/\A(https?:\/\/)((([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*)|(localhost:[0-9]{2,4})\/?)\z/).nil?
|
49
|
+
errors.add(:redirect_uris, 'format')
|
50
|
+
break
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
34
54
|
end
|
35
55
|
end
|
36
56
|
end
|
data/lib/arkaan/version.rb
CHANGED
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: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|