smaak 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smaak/adaptors/rack_adaptor.rb +1 -1
- data/lib/smaak/server.rb +3 -1
- data/lib/smaak/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 683a8c3b800d595a278cb6bfad07519e316b9c5e
|
4
|
+
data.tar.gz: 5d039ed1e75512585e3d537551533a9950f9b437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf29eb1070a61d30c67049937e3aaa1d9d270a6f346cbbcc185b442227887fad27bba095d627f1b0c9329c2a67d9fd834045afecbe8d8aa9accab5efae9c4a5
|
7
|
+
data.tar.gz: b5e49e9b7f5916c9ab4db94c1ecf5c7a672f517b439d925a8f703d384da00a45456cac5f82bb177750f7fd23564ccf4623863e430eba3e1373cf7203c8e65296
|
@@ -6,7 +6,7 @@ module Smaak
|
|
6
6
|
attr_reader :request
|
7
7
|
|
8
8
|
def initialize(request)
|
9
|
-
raise ArgumentError.new("Must provide a
|
9
|
+
raise ArgumentError.new("Must provide a Rack::Request") if not request.is_a? Rack::Request
|
10
10
|
@request = request
|
11
11
|
end
|
12
12
|
|
data/lib/smaak/server.rb
CHANGED
@@ -29,6 +29,7 @@ module Smaak
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def build_auth_message_from_request(adaptor)
|
32
|
+
puts "[smaak error]: x-smaak-* headers not all present. Is this a smaak request?" if adaptor.header("x-smaak-recipient").nil? or adaptor.header("x-smaak-psk").nil? or adaptor.header("x-smaak-expires").nil? or adaptor.header("x-smaak-identifier").nil? or adaptor.header("x-smaak-nonce").nil? or adaptor.header("x-smaak-encrypt").nil?
|
32
33
|
recipient_public_key = Base64.decode64(adaptor.header("x-smaak-recipient"))
|
33
34
|
psk = adaptor.header("x-smaak-psk")
|
34
35
|
expires = adaptor.header("x-smaak-expires")
|
@@ -43,8 +44,9 @@ module Smaak
|
|
43
44
|
puts "[smaak error]: message not unique"
|
44
45
|
return false
|
45
46
|
end
|
47
|
+
puts "[smaak error]: public key not set. Did you call set_public_key() ?" if @key.nil?
|
46
48
|
if not auth_message.intended_for_recipient?(@key.export)
|
47
|
-
puts "[smaak error]: message
|
49
|
+
puts "[smaak error]: message intended for this recipient"
|
48
50
|
return false
|
49
51
|
end
|
50
52
|
identifier = auth_message.identifier
|
data/lib/smaak/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smaak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernst van Graan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: persistent-cache
|