gala 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +30 -0
- data/Gemfile.lock +3 -1
- data/README.md +11 -3
- data/gala.gemspec +1 -0
- data/lib/gala/version.rb +1 -1
- data/test/payment_token_test.rb +4 -4
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4227537dc0b299428df76e8558c2191c30d065b0
|
4
|
+
data.tar.gz: 87347e9b12ab6fb03644a13c18c171d4f90801cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04c1581817cf346028e8b575802150c3e4639e7b87c44f49c35b83058c939c0d7eff0f5ebc9e98d0e9a14dbb535f5688de72c014ead1a7169727f637c735c0a7
|
7
|
+
data.tar.gz: 0f12a08997bdba5a6996811f2713c6b68d7cca61de3835b712d4786f6f62c949b2fb930140e912d3a1852ed21458480ae79bab5e58e2d5253e95c86b0ec845a1
|
@@ -0,0 +1,30 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
ruby-2.1:
|
4
|
+
docker:
|
5
|
+
- image: circleci/ruby:2.1.10
|
6
|
+
steps:
|
7
|
+
- checkout
|
8
|
+
- run: bundle
|
9
|
+
- run: rake test
|
10
|
+
ruby-2.2:
|
11
|
+
docker:
|
12
|
+
- image: circleci/ruby:2.2.10
|
13
|
+
steps:
|
14
|
+
- checkout
|
15
|
+
- run: bundle
|
16
|
+
- run: rake test
|
17
|
+
ruby-2.3:
|
18
|
+
docker:
|
19
|
+
- image: circleci/ruby:2.3.7
|
20
|
+
steps:
|
21
|
+
- checkout
|
22
|
+
- run: bundle
|
23
|
+
- run: rake test
|
24
|
+
workflows:
|
25
|
+
version: 2
|
26
|
+
rubies:
|
27
|
+
jobs:
|
28
|
+
- ruby-2.1
|
29
|
+
- ruby-2.2
|
30
|
+
- ruby-2.3
|
data/Gemfile.lock
CHANGED
@@ -17,6 +17,7 @@ GEM
|
|
17
17
|
specs:
|
18
18
|
macaddr (1.7.1)
|
19
19
|
systemu (~> 2.6.2)
|
20
|
+
minitest (5.11.3)
|
20
21
|
rake (12.0.0)
|
21
22
|
systemu (2.6.5)
|
22
23
|
|
@@ -27,7 +28,8 @@ DEPENDENCIES
|
|
27
28
|
aead!
|
28
29
|
bundler (~> 1.14)
|
29
30
|
gala!
|
31
|
+
minitest
|
30
32
|
rake (~> 12.0)
|
31
33
|
|
32
34
|
BUNDLED WITH
|
33
|
-
1.
|
35
|
+
1.15.4
|
data/README.md
CHANGED
@@ -6,16 +6,18 @@ Gala is available under the MIT License.
|
|
6
6
|
|
7
7
|
## Install
|
8
8
|
|
9
|
-
Add to your `Gemfile
|
9
|
+
Add both `gala` and `aead` to your `Gemfile`. Specifying `aead` is necessary to pull in the Shopify version of the library which has been updated to support Ruby versions 2.2 and above.
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
gem "gala", "~> 0.3.1"
|
13
|
+
gem 'aead', git: 'https://github.com/Shopify/aead.git', ref: '340e7718d8bd9c1fcf3c443e32f439436ea2b70d'
|
13
14
|
```
|
14
15
|
|
15
|
-
|
16
|
+
If you need to track a development branch or reference functionality not yet contained in the RubyGem release you can specify the gala repo directly.
|
16
17
|
|
17
18
|
```ruby
|
18
|
-
gem "gala", git: "https://github.com/spreedly/gala.git", ref: master
|
19
|
+
gem "gala", git: "https://github.com/spreedly/gala.git", ref: :master
|
20
|
+
gem 'aead', git: 'https://github.com/Shopify/aead.git', ref: '340e7718d8bd9c1fcf3c443e32f439436ea2b70d'
|
19
21
|
```
|
20
22
|
|
21
23
|
Then `bundle install` to fetch Gala into your local environment.
|
@@ -89,6 +91,12 @@ $ rake release
|
|
89
91
|
|
90
92
|
## Changelog
|
91
93
|
|
94
|
+
### v0.3.2
|
95
|
+
|
96
|
+
* Setup CircleCI for more comprehensive Ruby version/compatibility testing
|
97
|
+
* Use Minitest instead of TestUnit to more seamlessly support higher Ruby versions
|
98
|
+
* Last planned release that supports < Ruby 2.4
|
99
|
+
|
92
100
|
### v0.3.1
|
93
101
|
|
94
102
|
* Use Shopify aead library for compatibility w/ Ruby >= v2.2
|
data/gala.gemspec
CHANGED
data/lib/gala/version.rb
CHANGED
data/test/payment_token_test.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
2
|
-
require '
|
2
|
+
require 'minitest/autorun'
|
3
3
|
require 'json'
|
4
4
|
require 'gala'
|
5
5
|
|
6
|
-
class Gala::PaymentTokenTest < Test
|
6
|
+
class Gala::PaymentTokenTest < Minitest::Test
|
7
7
|
|
8
8
|
def setup
|
9
9
|
fixtures = File.dirname(__FILE__) + "/fixtures/"
|
@@ -45,7 +45,7 @@ class Gala::PaymentTokenTest < Test::Unit::TestCase
|
|
45
45
|
assert_equal "200731", payment_data["applicationExpirationDate"]
|
46
46
|
assert_equal "840", payment_data["currencyCode"]
|
47
47
|
assert_equal 100, payment_data["transactionAmount"]
|
48
|
-
|
48
|
+
assert_nil payment_data["cardholderName"]
|
49
49
|
assert_equal "040010030273", payment_data["deviceManufacturerIdentifier"]
|
50
50
|
assert_equal "3DSecure", payment_data["paymentDataType"]
|
51
51
|
assert_equal "Af9x/QwAA/DjmU65oyc1MAABAAA=", payment_data["paymentData"]["onlinePaymentCryptogram"]
|
@@ -54,7 +54,7 @@ class Gala::PaymentTokenTest < Test::Unit::TestCase
|
|
54
54
|
|
55
55
|
def test_failed_decrypt
|
56
56
|
@payment_token.data = "bogus4OZho15e9Yp5K0EtKergKzeRpPAjnKHwmSNnagxhjwhKQ5d29sfTXjdbh1CtTJ4DYjsD6kfulNUnYmBTsruphBz7RRVI1WI8P0LrmfTnImjcq1mi"
|
57
|
-
exception =
|
57
|
+
exception = assert_raises Gala::PaymentToken::InvalidSignatureError do
|
58
58
|
JSON.parse(@payment_token.decrypt(@certificate, @private_key))
|
59
59
|
end
|
60
60
|
assert_equal("The given signature is not a valid ECDSA signature.", exception.message)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gala
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Bennett
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aead
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '12.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: minitest
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
description: Given an (encrypted) Apple Pay token, verify and decrypt it
|
57
71
|
email:
|
58
72
|
- ryan@spreedly.com
|
@@ -60,6 +74,7 @@ executables: []
|
|
60
74
|
extensions: []
|
61
75
|
extra_rdoc_files: []
|
62
76
|
files:
|
77
|
+
- ".circleci/config.yml"
|
63
78
|
- ".gitignore"
|
64
79
|
- Gemfile
|
65
80
|
- Gemfile.lock
|