riddl 0.111 → 0.117

Sign up to get free protection for your applications and to get access to all the features.
@@ -355,6 +355,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
355
355
  :headers => headers,
356
356
  :body => tmp.read,
357
357
  :ssl_verifypeer => false
358
+ #:followlocation => true
358
359
  }
359
360
  if url.user && url.password
360
361
  opts[:username] = Protocols::Utils::unescape(url.user)
@@ -67,6 +67,9 @@
67
67
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="http://riddl.org/ns/common-patterns/notifications-producer/2.0">
68
68
  <start>
69
69
  <element name="subscription">
70
+ <attribute name="id">
71
+ <data type="string"/>
72
+ </attribute>
70
73
  <optional>
71
74
  <attribute name="url">
72
75
  <data type="string"/>
@@ -96,7 +99,26 @@
96
99
  </parameter>
97
100
  </message>
98
101
 
99
- <message name="subscribe">
102
+ <message name="create_subscription">
103
+ <optional>
104
+ <parameter name="id" type="string"/>
105
+ </optional>
106
+ <optional>
107
+ <parameter name="url" type="string"/>
108
+ </optional>
109
+ <oneOrMore>
110
+ <parameter name="topic" type="string"/>
111
+ <choice>
112
+ <parameter name="votes" type="string">
113
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
114
+ </parameter>
115
+ <parameter name="events" type="string">
116
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
117
+ </parameter>
118
+ </choice>
119
+ </oneOrMore>
120
+ </message>
121
+ <message name="change_subscription">
100
122
  <optional>
101
123
  <parameter name="url" type="string"/>
102
124
  </optional>
@@ -141,10 +163,10 @@
141
163
  </resource>
142
164
  <resource relative="subscriptions">
143
165
  <get in="*" out="subscriptions"/>
144
- <post in="subscribe" out="acknowledgment"/>
166
+ <post in="create_subscription" out="acknowledgment"/>
145
167
  <resource>
146
168
  <get out="subscription"/>
147
- <put in="subscribe"/>
169
+ <put in="change_subscription"/>
148
170
  <delete/>
149
171
  <resource relative="sse">
150
172
  <sse/>
@@ -178,7 +178,7 @@ module Riddl
178
178
  @riddl_res['Content-Length'] = '0'
179
179
  @riddl_status = 200
180
180
  else
181
- @riddl_log.write "501: the #{@riddl_method} parameters are not matching anything in the description.\n"
181
+ @riddl_log.write "501: a #{@riddl_method} with the these parameters is not part in the description (xml).\n"
182
182
  @riddl_status = 501 # not implemented?!
183
183
  end
184
184
  else
@@ -253,6 +253,9 @@ module Riddl
253
253
  @riddl_env['HTTP_CONTENT_ID'],
254
254
  @riddl_env['HTTP_RIDDL_TYPE']
255
255
  ).params
256
+ if @riddl_opts[:http_debug]
257
+ pp @riddl_parameters
258
+ end
256
259
 
257
260
  @riddl_method = @riddl_env['REQUEST_METHOD'].downcase
258
261
  @riddl_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']
@@ -67,6 +67,9 @@
67
67
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="http://riddl.org/ns/common-patterns/notifications-producer/2.0">
68
68
  <start>
69
69
  <element name="subscription">
70
+ <attribute name="id">
71
+ <data type="string"/>
72
+ </attribute>
70
73
  <optional>
71
74
  <attribute name="url">
72
75
  <data type="string"/>
@@ -96,7 +99,26 @@
96
99
  </parameter>
97
100
  </message>
98
101
 
99
- <message name="subscribe">
102
+ <message name="create_subscription">
103
+ <optional>
104
+ <parameter name="id" type="string"/>
105
+ </optional>
106
+ <optional>
107
+ <parameter name="url" type="string"/>
108
+ </optional>
109
+ <oneOrMore>
110
+ <parameter name="topic" type="string"/>
111
+ <choice>
112
+ <parameter name="votes" type="string">
113
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
114
+ </parameter>
115
+ <parameter name="events" type="string">
116
+ <param name="pattern">([\w-_]+,)*([\w-_]+)</param>
117
+ </parameter>
118
+ </choice>
119
+ </oneOrMore>
120
+ </message>
121
+ <message name="change_subscription">
100
122
  <optional>
101
123
  <parameter name="url" type="string"/>
102
124
  </optional>
@@ -141,10 +163,10 @@
141
163
  </resource>
142
164
  <resource relative="subscriptions">
143
165
  <get in="*" out="subscriptions"/>
144
- <post in="subscribe" out="acknowledgment"/>
166
+ <post in="create_subscription" out="acknowledgment"/>
145
167
  <resource>
146
168
  <get out="subscription"/>
147
- <put in="subscribe"/>
169
+ <put in="change_subscription"/>
148
170
  <delete/>
149
171
  <resource relative="sse">
150
172
  <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.111"
3
+ s.version = "0.117"
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.111'
4
+ version: '0.117'
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-11-12 00:00:00.000000000 Z
13
+ date: 2021-10-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemonite
@@ -548,18 +548,18 @@ 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.2.22
552
552
  signing_key:
553
553
  specification_version: 4
554
554
  summary: 'restful interface description and declaration language: tools and client/server
555
555
  libs'
556
556
  test_files:
557
- - test/tc_properties.rb
557
+ - test/tc_declaration-distributed.rb
558
558
  - test/tc_declaration-hybrid.rb
559
559
  - test/tc_declaration-local.rb
560
560
  - test/tc_helloworld.rb
561
561
  - test/tc_library.rb
562
- - test/tc_declaration-distributed.rb
563
- - test/tc_websocket.rb
564
562
  - test/tc_producer.rb
563
+ - test/tc_properties.rb
564
+ - test/tc_websocket.rb
565
565
  - test/smartrunner.rb