riddl 0.99.162 → 0.99.163

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38ae68d222d023f4e61265f9d75e4bb1c79a737d
4
- data.tar.gz: d640c1f61bc732d1a1fc3f84d2dc4456af1c436f
3
+ metadata.gz: 18b85503beb0c20754c0c07bd158b5ded0760fb1
4
+ data.tar.gz: afcd7fd93113b1f6a5ca754dd5c34720aea2c2a9
5
5
  SHA512:
6
- metadata.gz: a0e5062e30588c3030ea4a7ff58a703714bde72e28db8594977e9b8913ba44b8ee38050ebf8f9ab718ecbe7fcedde29109186fb0add397d0fddcf89ab60b6e77
7
- data.tar.gz: 2a7f4501b1bf520adb00c74cfb8a7882b6558b0f9eb46b28b67cae14bc067ee0e57a65a9a2ccb7a06d155498c11e67a55f280d5f9f222aed8d3c517cbb77d22c
6
+ metadata.gz: 09180e1e9b517e1019e87ccfe2a2ea9e26d5fc04f9ce84abcbbed33e2281eab568ca7a7badebedfcb0a795b1f3a4c8bae951eddfcc4cfdf80a9ada8ace914298
7
+ data.tar.gz: 5474fc3977e917b6585a9149b7dc728103b6db5a26fb2db2600e4668ddc74ec5d0b079f215495c224050d3cec5fef36522e24707596cd16919520be41b4db698
@@ -11,6 +11,6 @@
11
11
  </endpoints>
12
12
  <handlerwrapper>Test</handlerwrapper>
13
13
  <description>lala</description>
14
- <state>running</state>
14
+ <state>stopped</state>
15
15
  <transformation>xxx</transformation>
16
16
  </properties>
@@ -12,6 +12,7 @@ require File.expand_path(File.dirname(__FILE__) + '/protocols/http/generator')
12
12
  require File.expand_path(File.dirname(__FILE__) + '/protocols/http/parser')
13
13
  require File.expand_path(File.dirname(__FILE__) + '/protocols/xmpp/generator')
14
14
  require File.expand_path(File.dirname(__FILE__) + '/protocols/xmpp/parser')
15
+ require File.expand_path(File.dirname(__FILE__) + '/protocols/utils')
15
16
  require File.expand_path(File.dirname(__FILE__) + '/header')
16
17
  require File.expand_path(File.dirname(__FILE__) + '/option')
17
18
 
@@ -268,7 +269,7 @@ unless Module.constants.include?('CLIENT_INCLUDED')
268
269
  p.type = :query
269
270
  end
270
271
  if p.class == Riddl::Parameter::Simple && p.type == :query
271
- qparams << Protocols::HTTP::Generator::escape(p.name) + (p.value.nil? ? '' : '=' + Protocols::HTTP::Generator::escape(p.value))
272
+ qparams << Protocols::Utils::escape(p.name) + (p.value.nil? ? '' : '=' + Protocols::Utils::escape(p.value))
272
273
  true
273
274
  else
274
275
  starting = false
@@ -7,7 +7,7 @@ module Riddl
7
7
  provided = []
8
8
  qs = what.read
9
9
  (qs || '').split(/[&] */n).each do |p|
10
- k, v = Protocols::HTTP::Parser::unescape(p).split('=', 2)
10
+ k, v = Protocols::Utils::unescape(p).split('=', 2)
11
11
  provided << k.to_sym
12
12
  end
13
13
  WANTED.all?{ |e| provided.include?(e) }
@@ -21,42 +21,42 @@ module Riddl
21
21
  def initialize(qs)
22
22
  @provided = {}
23
23
  (qs || '').split(/[&] */n).each do |p|
24
- k, v = Protocols::HTTP::Parser::unescape(p).split('=', 2)
24
+ k, v = Protocols::Utils::unescape(p).split('=', 2)
25
25
  @provided[k.to_sym] = v
26
26
  end
27
27
  end
28
28
  end
29
29
 
30
30
  def self::sign(fullpath,method,parameters,headers,options)
31
- signature_string = method.upcase + "&" + Protocols::HTTP::Generator::escape(fullpath) + "&"
31
+ signature_string = method.upcase + "&" + Protocols::Utils::escape(fullpath) + "&"
32
32
 
33
33
  sparams = []
34
34
  if parameters.class == Array
35
35
  parameters.each do |p|
36
36
  if p.class == Riddl::Parameter::Simple
37
- sparams << [Protocols::HTTP::Generator::escape(p.name),Protocols::HTTP::Generator::escape(p.value)]
37
+ sparams << [Protocols::Utils::escape(p.name),Protocols::Utils::escape(p.value)]
38
38
  end
39
39
  end
40
40
  end
41
41
 
42
42
  oparams = []
43
- oparams << ["oauth_consumer_key",Protocols::HTTP::Generator::escape(options[:consumer_key])]
43
+ oparams << ["oauth_consumer_key",Protocols::Utils::escape(options[:consumer_key])]
44
44
  oparams << ["oauth_signature_method","HMAC-SHA1"]
45
45
  oparams << ["oauth_timestamp",Time.new.to_i.to_s]
46
46
  oparams << ["oauth_version","1.0"]
47
- oparams << ["oauth_nonce",Protocols::HTTP::Generator::escape(OpenSSL::Digest::SHA1.hexdigest(rand(10000).to_s)[0...32])]
48
- oparams << ["oauth_token",Protocols::HTTP::Generator::escape(options[:token])] if options[:token]
49
- oparams << ["oauth_verifier",Protocols::HTTP::Generator::escape(options[:verifier])] if options[:verifier]
47
+ oparams << ["oauth_nonce",Protocols::Utils::escape(OpenSSL::Digest::SHA1.hexdigest(rand(10000).to_s)[0...32])]
48
+ oparams << ["oauth_token",Protocols::Utils::escape(options[:token])] if options[:token]
49
+ oparams << ["oauth_verifier",Protocols::Utils::escape(options[:verifier])] if options[:verifier]
50
50
 
51
51
  params = (sparams + oparams).sort{|a,b|a[0]<=>b[0]}.map{ |e| e[0] + '=' + e[1] }.join('&')
52
- signature_string += Protocols::HTTP::Generator::escape(params)
52
+ signature_string += Protocols::Utils::escape(params)
53
53
 
54
- signature = OpenSSL::HMAC.digest(DIGEST,"#{Protocols::HTTP::Generator::escape(options[:consumer_secret])}&#{Protocols::HTTP::Generator::escape(options[:token_secret])}",signature_string)
54
+ signature = OpenSSL::HMAC.digest(DIGEST,"#{Protocols::Utils::escape(options[:consumer_secret])}&#{Protocols::Utils::escape(options[:token_secret])}",signature_string)
55
55
  signature = [signature].pack("m").gsub(/\n/, '')
56
56
 
57
- oparams << ["oauth_signature", Protocols::HTTP::Generator::escape(signature)]
57
+ oparams << ["oauth_signature", Protocols::Utils::escape(signature)]
58
58
 
59
- oparams.unshift(["realm", Protocols::HTTP::Generator::escape(options[:realm])]) if options[:realm]
59
+ oparams.unshift(["realm", Protocols::Utils::escape(options[:realm])]) if options[:realm]
60
60
 
61
61
  headers['Authorization'] = 'OAuth ' + oparams.map{|e|e[0]+'='+"\"#{e[1]}\""}.join(', ')
62
62
  end
@@ -5,6 +5,7 @@ require File.expand_path(File.dirname(__FILE__) + '/protocols/http/parser')
5
5
  require File.expand_path(File.dirname(__FILE__) + '/protocols/http/generator')
6
6
  require File.expand_path(File.dirname(__FILE__) + '/protocols/xmpp/parser')
7
7
  require File.expand_path(File.dirname(__FILE__) + '/protocols/xmpp/generator')
8
+ require File.expand_path(File.dirname(__FILE__) + '/protocols/utils')
8
9
  require File.expand_path(File.dirname(__FILE__) + '/protocols/websocket')
9
10
  require File.expand_path(File.dirname(__FILE__) + '/header')
10
11
  require File.expand_path(File.dirname(__FILE__) + '/parameter')
@@ -341,7 +342,7 @@ module Riddl
341
342
  @riddl_info = {
342
343
  :h => @riddl_headers,
343
344
  :p => @riddl_parameters,
344
- :r => @riddl_pinfo.sub(/\//,'').split('/').map{|e|Protocols::HTTP::Parser::unescape(e)},
345
+ :r => @riddl_pinfo.sub(/\//,'').split('/').map{|e|Protocols::Utils::unescape(e)},
345
346
  :s => @riddl_matching_path[0].sub(/\//,'').split('/'),
346
347
  :m => @riddl_method,
347
348
  :env => Hash[@riddl_env.root.attributes.map{|a| [a.qname.name, a.value] }].merge({ 'riddl.transport' => 'xmpp', 'xmpp' => @riddl_res }),
@@ -402,7 +403,7 @@ module Riddl
402
403
  @riddl_info = {
403
404
  :h => @riddl_headers,
404
405
  :p => @riddl_parameters,
405
- :r => @riddl_pinfo.sub(/\//,'').split('/').map{|e|Protocols::HTTP::Parser::unescape(e)},
406
+ :r => @riddl_pinfo.sub(/\//,'').split('/').map{|e|Protocols::Utils::unescape(e)},
406
407
  :s => @riddl_matching_path[0].sub(/\//,'').split('/'),
407
408
  :m => @riddl_method,
408
409
  :env => @riddl_env.reject{|k,v| k =~ /^rack\./}.merge({'riddl.transport' => 'http', 'xmpp' => @riddl_opts[:xmpp]}),
@@ -209,7 +209,7 @@ module Riddl
209
209
 
210
210
  EM.defer{handler.property(@r[1]).read} unless handler.nil?
211
211
 
212
- if ret = extract_values(backend,@r[1],Riddl::Protocols::HTTP::Parser::unescape(@r[2..-1].join('/')))
212
+ if ret = extract_values(backend,@r[1],Riddl::Protocols::Utils::unescape(@r[2..-1].join('/')))
213
213
  ret
214
214
  else
215
215
  @status = 404
@@ -393,7 +393,7 @@ module Riddl
393
393
  handler = @a[1]
394
394
 
395
395
  property = @r[1]
396
- minor = Riddl::Protocols::HTTP::Parser::unescape(@r[2])
396
+ minor = Riddl::Protocols::Utils::unescape(@r[2])
397
397
 
398
398
  unless backend.modifiable?(property)
399
399
  @status = 500
@@ -250,7 +250,7 @@ module Riddl
250
250
  def load_necessary_roles!
251
251
  #{{{
252
252
  @doc.find("//des:resource/@role").map{|h|h.to_s}.uniq.each do |h|
253
- h = Protocols::HTTP::Generator::escape(h)
253
+ h = Protocols::Utils::escape(h)
254
254
  if File.exists?(File.dirname(__FILE__) + '/roles/' + h + '.rb')
255
255
  require File.expand_path(File.dirname(__FILE__) + '/roles/' + h)
256
256
  end
data/riddl.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.99.162"
3
+ s.version = "0.99.163"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
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.99.162
4
+ version: 0.99.163
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler