pnthr 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pnthr/version.rb +1 -1
- data/lib/pnthr.rb +3 -4
- data/spec/lib/pnthr_spec.rb +4 -4
- 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: aa7c53ab1a31ab1e49234adb0fc26fa4501b3af2
|
4
|
+
data.tar.gz: 77bc14383efc74fc3183036bfc6a58e7ddbe6d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1505b89d126b1b408ca9759c9a8c987fabe39dd0a73ccab269435ff62a8af4cfbd3ace40f26e1a1d8f32304cd1b6162d0e0940e50c8724f243bdd861f39de3cf
|
7
|
+
data.tar.gz: e8ef50e7f76baee7ca321a4c9f76353971dafefbf8b207282a3e82e041b5a326dc1f862025acb4bedd07b3073a46fdc465bc8dc30974ffdd712f64c4c893b11d
|
data/lib/pnthr/version.rb
CHANGED
data/lib/pnthr.rb
CHANGED
@@ -13,8 +13,8 @@ module Pnthr
|
|
13
13
|
@cipher = OpenSSL::Cipher::AES.new(secret.length * 8, :CFB)
|
14
14
|
|
15
15
|
options[:url] ||= 'https://pnthr-api.herokuapp.com/'
|
16
|
-
options[:ssl].nil? ? true : options[:ssl]
|
17
|
-
options[:iv] ||=
|
16
|
+
options[:ssl] = options[:ssl].nil? ? true : options[:ssl]
|
17
|
+
options[:iv] ||= Base64.encode64(rand.to_s)[0..15]
|
18
18
|
|
19
19
|
@request = {
|
20
20
|
url: options[:url],
|
@@ -75,8 +75,7 @@ module Pnthr
|
|
75
75
|
https = Net::HTTP.new(@request[:uri].host, @request[:uri].port)
|
76
76
|
https.use_ssl = @request[:ssl]
|
77
77
|
|
78
|
-
package = Base64.encode64(payload).strip! + "
|
79
|
-
puts package
|
78
|
+
package = Base64.encode64(payload).strip! + "-" + @request[:iv]
|
80
79
|
|
81
80
|
https.post(@request[:uri].path, package, { 'pnthr' => @request[:id] })
|
82
81
|
end
|
data/spec/lib/pnthr_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require 'pnthr'
|
|
3
3
|
|
4
4
|
describe Pnthr do
|
5
5
|
|
6
|
-
host_url = '
|
7
|
-
ssl_on =
|
6
|
+
host_url = 'https://pnthr-api.herokuapp.com/'
|
7
|
+
ssl_on = true
|
8
8
|
app_id = '534c33bb6637350002000000'
|
9
9
|
app_secret = '9857ec6046ee8d22b90ce68214a8304b'
|
10
10
|
|
@@ -24,7 +24,7 @@ describe Pnthr do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should not use SSL for local tests" do
|
27
|
-
pnthr.request[:ssl].should be
|
27
|
+
pnthr.request[:ssl].should be true
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should properly set the request url" do
|
@@ -52,7 +52,7 @@ describe Pnthr do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should respond with a predictable string" do
|
55
|
-
response.body.should eq 'NuCn7VFKvrcLzneoRG4
|
55
|
+
response.body.should eq 'NuCn7VFKvrcLzneoRG4=-534c33bb66373500'
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should encrypt with a predictable string" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pnthr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay McIlrath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|