s2s-auth 0.0.1 → 0.0.2

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: 30476f1d68de002751a1e5002c3f75f9fe4997e2
4
- data.tar.gz: cae731a5d7b0c9db173f5d2d72e4df6c1d6d8ae7
3
+ metadata.gz: 7b9b1930b5f9b10ffc9d2da950f17377af07ae55
4
+ data.tar.gz: 96f2f62700b100e4c71af02c56ed05dff444176a
5
5
  SHA512:
6
- metadata.gz: c045d152483d4f1769250940ee61e8f2a98caaee76a0b8017091005287e6b65cab415472df79f11d84571e5dff066233a9a92676d740729c035e92b6b93e772e
7
- data.tar.gz: 33bc93af12c8405feb4f37c328421a4ff22469c1a24dbe8638aeb50554424eb569b0d51cc21a4aba6878590d822ee5904bcc18b62f002f56c09d0a41befb3b40
6
+ metadata.gz: 0ac514f8ba325ff7840004eae1e056b91558e4dbb66ff88ea049bc68c4318a6f9e4f545c88d18caf0c803ddc206e6f1f5b40fc3fec4439480569c058fd90b4b5
7
+ data.tar.gz: 99f076f5337b708702e5e83a5103dd5068be64d80a12ee750c3572bfdded48bc34ea053b2819a7707386af0e8dd10966594790ff5de5eae6348768807286e513
@@ -1,23 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- s2s-auth (0.0.1)
4
+ s2s-auth (0.0.2)
5
5
  activesupport (>= 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (4.1.0.beta1)
11
- i18n (~> 0.6, >= 0.6.9)
12
- json (~> 1.7, >= 1.7.7)
13
- minitest (~> 5.1)
10
+ activesupport (4.0.2)
11
+ i18n (~> 0.6, >= 0.6.4)
12
+ minitest (~> 4.2)
13
+ multi_json (~> 1.3)
14
14
  thread_safe (~> 0.1)
15
- tzinfo (~> 1.1)
15
+ tzinfo (~> 0.3.37)
16
16
  atomic (1.1.14)
17
17
  diff-lcs (1.2.5)
18
18
  i18n (0.6.9)
19
- json (1.7.7)
20
- minitest (5.2.2)
19
+ minitest (4.7.5)
20
+ multi_json (1.8.4)
21
21
  rake (0.9.6)
22
22
  rspec (2.14.1)
23
23
  rspec-core (~> 2.14.0)
@@ -29,8 +29,7 @@ GEM
29
29
  rspec-mocks (2.14.5)
30
30
  thread_safe (0.1.3)
31
31
  atomic
32
- tzinfo (1.1.0)
33
- thread_safe (~> 0.1)
32
+ tzinfo (0.3.38)
34
33
 
35
34
  PLATFORMS
36
35
  ruby
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ * 0.0.2 Bug fix: switched the default serializer to properly serialize
4
+ as per AS' expectations.
5
+ * 0.0.1 initial release
@@ -4,7 +4,7 @@ require "active_support/key_generator"
4
4
  require "active_support/message_verifier"
5
5
  require "active_support/message_encryptor"
6
6
  require "active_support/key_generator"
7
- require "json"
7
+ require_relative "serializer"
8
8
 
9
9
  module S2S
10
10
  module Auth
@@ -32,7 +32,7 @@ module S2S
32
32
  raise ArgumentError.new("This module needs to be setup following keys: secret, app, salt, sign_salt")
33
33
  end
34
34
  @iterations = opts[:iterations] || opts["iterations"] || 1000
35
- @serializer = opts[:serializer] || opts["serializer"] || JSON
35
+ @serializer = opts[:serializer] || opts["serializer"] || S2S::Auth::JsonSerializer
36
36
  keygen = ActiveSupport::CachingKeyGenerator.new(ActiveSupport::KeyGenerator.new(@secret, iterations: @iteration))
37
37
  secret = keygen.generate_key(@salt)
38
38
  sign_secret = keygen.generate_key(@sign_salt)
@@ -1,5 +1,5 @@
1
1
  module S2S
2
2
  module Auth
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -0,0 +1,19 @@
1
+ require "json"
2
+
3
+ module S2S
4
+ module Auth
5
+ # Based on https://gist.github.com/mattetti/7624413
6
+ module JsonSerializer
7
+ def self.load(value)
8
+ begin
9
+ JSON.parse(value)
10
+ rescue JSON::ParserError
11
+ nil
12
+ end
13
+ end
14
+ def self.dump(value)
15
+ JSON.generate(value)
16
+ end
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s2s-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Aimonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,8 +80,10 @@ files:
80
80
  - LICENSE.txt
81
81
  - README.md
82
82
  - Rakefile
83
+ - changelog.md
83
84
  - lib/s2s/auth.rb
84
85
  - lib/s2s/auth/version.rb
86
+ - lib/s2s/serializer.rb
85
87
  - s2s-auth.gemspec
86
88
  - spec/auth_spec.rb
87
89
  - spec/spec_helper.rb