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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb8410c5b436029e036acecdf7c192f5c9d807de
4
- data.tar.gz: cc6f08a6ca3df055ba225d6ca696a4102ac05795
3
+ metadata.gz: 683a8c3b800d595a278cb6bfad07519e316b9c5e
4
+ data.tar.gz: 5d039ed1e75512585e3d537551533a9950f9b437
5
5
  SHA512:
6
- metadata.gz: ee40f00cbd01cc9c1f8fdfb2a478795c2f5637ab0425aef711181517368480c85fb8fd76eeacb237af3d978974631a106351c714188feb53bd1ab79756da2ace
7
- data.tar.gz: 7ed63f1be7a63c2deb37b3692a4665253ee30e0b1b7c60113bfc243b3bbcb23191f03ab5555b6e9aa772315145e4176949ac8f5718d0f19dfcf21491927720ac
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 Net::HTTPRequest") if not request.is_a? Rack::Request
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 not unique"
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
@@ -1,3 +1,3 @@
1
1
  module Smaak
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
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.9
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-16 00:00:00.000000000 Z
11
+ date: 2015-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: persistent-cache