caren-api 0.4.12 → 0.4.13
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.
- data/VERSION +1 -1
- data/caren-api.gemspec +2 -2
- data/lib/caren/base.rb +1 -1
- data/lib/caren/care_provider.rb +1 -1
- data/lib/caren/caren.rb +7 -7
- data/lib/caren/external_message.rb +1 -1
- data/lib/caren/link.rb +1 -1
- data/lib/caren/product.rb +1 -1
- data/lib/caren/product_category.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.13
|
data/caren-api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{caren-api}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andre Foeken"]
|
12
|
-
s.date = %q{2011-11-
|
12
|
+
s.date = %q{2011-11-17}
|
13
13
|
s.description = %q{You can use this gem as inspiration of the base of your connections with Caren.}
|
14
14
|
s.email = %q{andre.foeken@nedap.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/caren/base.rb
CHANGED
data/lib/caren/care_provider.rb
CHANGED
data/lib/caren/caren.rb
CHANGED
@@ -59,7 +59,7 @@ module Caren
|
|
59
59
|
def put path, xml
|
60
60
|
begin
|
61
61
|
timestamp = DateTime.now.to_i
|
62
|
-
response = RestClient.put url_for(path), xml, :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp,xml)
|
62
|
+
response = RestClient.put url_for(path), xml, :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp,path,xml)
|
63
63
|
return check_signature(response)
|
64
64
|
rescue RestClient::Exception => e
|
65
65
|
handle_error(e.response)
|
@@ -69,7 +69,7 @@ module Caren
|
|
69
69
|
def post path, xml
|
70
70
|
begin
|
71
71
|
timestamp = DateTime.now.to_i
|
72
|
-
response = RestClient.post url_for(path), xml, :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp,xml)
|
72
|
+
response = RestClient.post url_for(path), xml, :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp,path,xml)
|
73
73
|
return check_signature(response)
|
74
74
|
rescue RestClient::Exception => e
|
75
75
|
handle_error(e.response)
|
@@ -79,7 +79,7 @@ module Caren
|
|
79
79
|
def delete path
|
80
80
|
begin
|
81
81
|
timestamp = DateTime.now.to_i
|
82
|
-
response = RestClient.delete url_for(path), :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp)
|
82
|
+
response = RestClient.delete url_for(path), :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp,path)
|
83
83
|
return check_signature(response)
|
84
84
|
rescue RestClient::Exception => e
|
85
85
|
handle_error(e.response)
|
@@ -89,7 +89,7 @@ module Caren
|
|
89
89
|
def get path
|
90
90
|
begin
|
91
91
|
timestamp = DateTime.now.to_i
|
92
|
-
response = RestClient.get url_for(path), :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp)
|
92
|
+
response = RestClient.get url_for(path), :content_type => :xml, :accept => :xml, :timestamp => timestamp, :signature => sign(timestamp,path)
|
93
93
|
return check_signature(response)
|
94
94
|
rescue RestClient::Exception => e
|
95
95
|
handle_error(e.response)
|
@@ -147,11 +147,11 @@ module Caren
|
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
150
|
-
|
151
150
|
# Sign your string and timestamp using private key
|
152
151
|
# Timestamp is UNIX timestamp seconds since 1970
|
153
|
-
def sign timestamp, string=nil, private_key=self.private_key
|
154
|
-
|
152
|
+
def sign timestamp, path, string=nil, private_key=self.private_key
|
153
|
+
path = URI.parse(path).path
|
154
|
+
encrypted_digest = private_key.sign( "sha1", path.to_s + string.to_s + timestamp.to_s )
|
155
155
|
signature = CGI.escape(Base64.encode64(encrypted_digest))
|
156
156
|
return signature
|
157
157
|
end
|
data/lib/caren/link.rb
CHANGED
data/lib/caren/product.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
8
|
+
- 13
|
9
9
|
segments_generated: true
|
10
|
-
version: 0.4.
|
10
|
+
version: 0.4.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andre Foeken
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-17 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|