riddl 0.108 → 0.113

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  <description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
2
2
 
3
3
  <message name="event">
4
- <parameter name="key" type="string"/>
4
+ <parameter name="type" fixed="event"/>
5
5
  <parameter name="topic" type="string">
6
6
  <param name="pattern">[\w_/]+</param>
7
7
  </parameter>
@@ -12,9 +12,6 @@
12
12
  <parameter name="notification" type="string"/>
13
13
  <parameter name="notification" mimetype="application/json"/>
14
14
  </choice>
15
- <optional>
16
- <parameter name="fingerprint-with-consumer-secret" type="string"/>
17
- </optional>
18
15
  </message>
19
16
 
20
17
  <message name="vote">
@@ -96,7 +96,26 @@
96
96
  </parameter>
97
97
  </message>
98
98
 
99
- <message name="subscribe">
99
+ <message name="create_subscription">
100
+ <optional>
101
+ <parameter name="id" type="string"/>
102
+ </optional>
103
+ <optional>
104
+ <parameter name="url" type="string"/>
105
+ </optional>
106
+ <oneOrMore>
107
+ <parameter name="topic" type="string"/>
108
+ <choice>
109
+ <parameter name="votes" type="string">
110
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
111
+ </parameter>
112
+ <parameter name="events" type="string">
113
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
114
+ </parameter>
115
+ </choice>
116
+ </oneOrMore>
117
+ </message>
118
+ <message name="change_subscription">
100
119
  <optional>
101
120
  <parameter name="url" type="string"/>
102
121
  </optional>
@@ -141,10 +160,10 @@
141
160
  </resource>
142
161
  <resource relative="subscriptions">
143
162
  <get in="*" out="subscriptions"/>
144
- <post in="subscribe" out="acknowledgment"/>
163
+ <post in="create_subscription" out="acknowledgment"/>
145
164
  <resource>
146
165
  <get out="subscription"/>
147
- <put in="subscribe"/>
166
+ <put in="change_subscription"/>
148
167
  <delete/>
149
168
  <resource relative="sse">
150
169
  <sse/>
@@ -33,7 +33,7 @@ module Riddl
33
33
  end
34
34
  end
35
35
 
36
- def trigger_on_open(); @closed = false; @app.onopen; end
36
+ def trigger_on_open(); @closed = false; res = @app.onopen; res ? true : false; end
37
37
  def trigger_on_close; @closed = true; @app.onclose; end
38
38
 
39
39
  def initialize(app, env)
@@ -233,7 +233,7 @@ module Riddl
233
233
  @riddl_res = Rack::Response.new
234
234
  @riddl_status = 404
235
235
 
236
- @riddl_pinfo = @riddl_env["PATH_INFO"].gsub(/\/+/,'/')
236
+ @riddl_pinfo = Riddl::Protocols::Utils::unescape(@riddl_env["PATH_INFO"].gsub(/\/+/,'/'))
237
237
  @riddl_matching_path = @riddl_paths.find{ |e| @riddl_pinfo.match(e[1]).to_s.length == @riddl_pinfo.length }
238
238
 
239
239
  if @riddl_matching_path
@@ -55,9 +55,11 @@ module Riddl
55
55
 
56
56
  if b.class == Riddl::Parameter::Simple && (a.attributes['fixed'] || a.attributes['type'])
57
57
  b.name = a.attributes['name'] if @numparams == 1
58
- if (b.name == a.attributes['name'] || a.attributes['name'] == '*')
58
+ if (b.name == a.attributes['name'] || a.attributes['name'] == '*') && match_simple(a,b.value)
59
59
  @mistp += 1
60
- return match_simple(a,b.value)
60
+ return true
61
+ else
62
+ return false
61
63
  end
62
64
  end
63
65
  if b.class == Riddl::Parameter::Complex && a.attributes['mimetype']
@@ -1,7 +1,7 @@
1
1
  <description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
2
2
 
3
3
  <message name="event">
4
- <parameter name="key" type="string"/>
4
+ <parameter name="type" fixed="event"/>
5
5
  <parameter name="topic" type="string">
6
6
  <param name="pattern">[\w_/]+</param>
7
7
  </parameter>
@@ -12,9 +12,6 @@
12
12
  <parameter name="notification" type="string"/>
13
13
  <parameter name="notification" mimetype="application/json"/>
14
14
  </choice>
15
- <optional>
16
- <parameter name="fingerprint-with-consumer-secret" type="string"/>
17
- </optional>
18
15
  </message>
19
16
 
20
17
  <message name="vote">
@@ -96,7 +96,26 @@
96
96
  </parameter>
97
97
  </message>
98
98
 
99
- <message name="subscribe">
99
+ <message name="create_subscription">
100
+ <optional>
101
+ <parameter name="id" type="string"/>
102
+ </optional>
103
+ <optional>
104
+ <parameter name="url" type="string"/>
105
+ </optional>
106
+ <oneOrMore>
107
+ <parameter name="topic" type="string"/>
108
+ <choice>
109
+ <parameter name="votes" type="string">
110
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
111
+ </parameter>
112
+ <parameter name="events" type="string">
113
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
114
+ </parameter>
115
+ </choice>
116
+ </oneOrMore>
117
+ </message>
118
+ <message name="change_subscription">
100
119
  <optional>
101
120
  <parameter name="url" type="string"/>
102
121
  </optional>
@@ -141,10 +160,10 @@
141
160
  </resource>
142
161
  <resource relative="subscriptions">
143
162
  <get in="*" out="subscriptions"/>
144
- <post in="subscribe" out="acknowledgment"/>
163
+ <post in="create_subscription" out="acknowledgment"/>
145
164
  <resource>
146
165
  <get out="subscription"/>
147
- <put in="subscribe"/>
166
+ <put in="change_subscription"/>
148
167
  <delete/>
149
168
  <resource relative="sse">
150
169
  <sse/>
data/riddl.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.108"
3
+ s.version = "0.113"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "restful interface description and declaration language: tools and client/server libs"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riddl
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.108'
4
+ version: '0.113'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen 'eTM' Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2020-10-23 00:00:00.000000000 Z
13
+ date: 2021-06-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemonite
@@ -548,7 +548,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
548
548
  - !ruby/object:Gem::Version
549
549
  version: '0'
550
550
  requirements: []
551
- rubygems_version: 3.1.4
551
+ rubygems_version: 3.1.6
552
552
  signing_key:
553
553
  specification_version: 4
554
554
  summary: 'restful interface description and declaration language: tools and client/server