access 2.0.46 → 2.0.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +1 -1
- data/lib/access/api.rb +6 -0
- data/lib/access/user.rb +4 -0
- data/lib/access/version.rb +1 -1
- data/test/access/member_test.rb +2 -2
- data/test/access/user_test.rb +23 -0
- data/test/vcr/cassettes/favorite_one_of_everything.yml +14 -14
- data/test/vcr/cassettes/member_authenticate_member_key_failure.yml +48 -0
- data/test/vcr/cassettes/member_authenticate_member_key_success.yml +55 -0
- data/test/vcr/cassettes/member_update_success.yml +46 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2798a5c18928d29bab031295be486ba147541654
|
4
|
+
data.tar.gz: db2f9042c8ad58b6aee63d973589cb6913c210ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2ea9e1132caf6ee7959f8b024a9b8b5dba003924a349fab7479ff61b53e286cbefa2ff359e87e6e1b0c3d086861a14152f1a790b7928f2e42976a09fda46d97
|
7
|
+
data.tar.gz: 06f48937c774a1c483614f56eaec1a6dcdb93324c49882272769d924de04eaa4d2a84d98bf6c01c19458bf8c3bf3c7c0983b54d529f7b78b07048bd394174fb5
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/access/api.rb
CHANGED
@@ -157,6 +157,12 @@ module Access
|
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
160
|
+
def user_authentication_by_member_key(options = {})
|
161
|
+
request.get("/auth", "mms", options) do |response|
|
162
|
+
UserResponse.new(response)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
160
166
|
# Member
|
161
167
|
def member_show(member_key, options = {})
|
162
168
|
request.get("/members/#{member_key}", 'mms', options) do |response|
|
data/lib/access/user.rb
CHANGED
data/lib/access/version.rb
CHANGED
data/test/access/member_test.rb
CHANGED
@@ -22,11 +22,11 @@ class MemberTest < Minitest::Test
|
|
22
22
|
|
23
23
|
def test_member_update
|
24
24
|
VCR.use_cassette('member update success') do
|
25
|
-
request = Access::Member.update '226872', program_id: '2412', api_environment: 'stage', birth_date:
|
25
|
+
request = Access::Member.update '226872', program_id: '2412', api_environment: 'stage', birth_date: '2016-01-01'
|
26
26
|
assert request.success
|
27
27
|
assert_kind_of Access::MemberResponse, request
|
28
28
|
assert_kind_of Hash, request.response
|
29
|
-
assert_equal request.response["birth_date"],
|
29
|
+
assert_equal request.response["birth_date"], '2016-01-01'
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/test/access/user_test.rb
CHANGED
@@ -79,6 +79,29 @@ class UserTest < Minitest::Test
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
def test_authenticate_member_key_success
|
83
|
+
VCR.use_cassette('member authenticate member_key success') do
|
84
|
+
request = Access::User.authenticate_by_member_key member_key: '226872', api_environment: 'stage'
|
85
|
+
assert request.success
|
86
|
+
assert_kind_of Access::UserResponse, request
|
87
|
+
assert_kind_of Array, request.users
|
88
|
+
assert_equal 1, request.users.count
|
89
|
+
|
90
|
+
assert_kind_of Access::Member, request.users.first
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_authenticate_member_key_failure
|
95
|
+
VCR.use_cassette('member authenticate member_key failure') do
|
96
|
+
request = Access::User.authenticate_by_member_key member_key: 'thisisaverybadmember_keyman1234556badbadbad', api_environment: 'stage'
|
97
|
+
refute request.success
|
98
|
+
assert_equal 401, request.status
|
99
|
+
assert_kind_of Access::UserResponse, request
|
100
|
+
refute_nil request.error
|
101
|
+
assert_kind_of Access::Error, request.error
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
82
105
|
def registration_params
|
83
106
|
{
|
84
107
|
program_id: 2412,
|
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- nginx/1.8.0
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Tue, 02 Feb 2016 00:15:10 GMT
|
25
25
|
Content-Type:
|
26
26
|
- application/json
|
27
27
|
Transfer-Encoding:
|
@@ -45,15 +45,15 @@ http_interactions:
|
|
45
45
|
X-Ratelimit-Limit:
|
46
46
|
- '1000'
|
47
47
|
X-Ratelimit-Remaining:
|
48
|
-
- '
|
48
|
+
- '997'
|
49
49
|
Etag:
|
50
50
|
- '"ff0ab01838dc435bd23c5be20a69c5ca"'
|
51
51
|
Cache-Control:
|
52
52
|
- max-age=0, private, must-revalidate
|
53
53
|
X-Request-Id:
|
54
|
-
-
|
54
|
+
- f4310394-b4cc-4021-b66b-120d1a637751
|
55
55
|
X-Runtime:
|
56
|
-
- '0.
|
56
|
+
- '0.077904'
|
57
57
|
body:
|
58
58
|
encoding: ASCII-8BIT
|
59
59
|
string: !binary |-
|
@@ -904,7 +904,7 @@ http_interactions:
|
|
904
904
|
MS9vZmZlcnM/YWxsX29mZmVycz10cnVlJm1lbWJlcl9rZXk9QVBJX1RFU1Qm
|
905
905
|
cGFnZT0yJnF1ZXJ5PV9leGlzdHNfJTNBcHJvZ3JhbV9rZXlzIgogIH0KfQ==
|
906
906
|
http_version:
|
907
|
-
recorded_at:
|
907
|
+
recorded_at: Tue, 02 Feb 2016 00:15:36 GMT
|
908
908
|
- request:
|
909
909
|
method: get
|
910
910
|
uri: https://redeem-stage.adcrws.com/v1/redeem/14813065/instore?member_key=API_TEST
|
@@ -930,12 +930,12 @@ http_interactions:
|
|
930
930
|
Content-Length:
|
931
931
|
- '64'
|
932
932
|
Date:
|
933
|
-
-
|
933
|
+
- Tue, 02 Feb 2016 00:14:15 GMT
|
934
934
|
body:
|
935
935
|
encoding: UTF-8
|
936
936
|
string: '{"message":"Offer key ''14813065'' cannot be found.","status":404}'
|
937
937
|
http_version:
|
938
|
-
recorded_at:
|
938
|
+
recorded_at: Tue, 02 Feb 2016 00:15:36 GMT
|
939
939
|
- request:
|
940
940
|
method: post
|
941
941
|
uri: https://mms-stage.adcrws.com/v1/members/API_TEST/favorites/offers/14813065
|
@@ -975,13 +975,13 @@ http_interactions:
|
|
975
975
|
Transfer-Encoding:
|
976
976
|
- chunked
|
977
977
|
Date:
|
978
|
-
-
|
978
|
+
- Tue, 02 Feb 2016 00:17:18 GMT
|
979
979
|
body:
|
980
980
|
encoding: UTF-8
|
981
981
|
string: '{"message":"Member with member_key API_TEST does not exist in program
|
982
982
|
with program_id 263862512.","status":200}'
|
983
983
|
http_version:
|
984
|
-
recorded_at:
|
984
|
+
recorded_at: Tue, 02 Feb 2016 00:15:37 GMT
|
985
985
|
- request:
|
986
986
|
method: post
|
987
987
|
uri: https://mms-stage.adcrws.com/v1/members/API_TEST/favorites/locations/5454532
|
@@ -1021,13 +1021,13 @@ http_interactions:
|
|
1021
1021
|
Transfer-Encoding:
|
1022
1022
|
- chunked
|
1023
1023
|
Date:
|
1024
|
-
-
|
1024
|
+
- Tue, 02 Feb 2016 00:17:18 GMT
|
1025
1025
|
body:
|
1026
1026
|
encoding: UTF-8
|
1027
1027
|
string: '{"message":"Member with member_key API_TEST does not exist in program
|
1028
1028
|
with program_id 263862512.","status":200}'
|
1029
1029
|
http_version:
|
1030
|
-
recorded_at:
|
1030
|
+
recorded_at: Tue, 02 Feb 2016 00:15:37 GMT
|
1031
1031
|
- request:
|
1032
1032
|
method: post
|
1033
1033
|
uri: https://mms-stage.adcrws.com/v1/members/API_TEST/favorites/stores/18938324
|
@@ -1067,11 +1067,11 @@ http_interactions:
|
|
1067
1067
|
Transfer-Encoding:
|
1068
1068
|
- chunked
|
1069
1069
|
Date:
|
1070
|
-
-
|
1070
|
+
- Tue, 02 Feb 2016 00:17:18 GMT
|
1071
1071
|
body:
|
1072
1072
|
encoding: UTF-8
|
1073
1073
|
string: '{"message":"Member with member_key API_TEST does not exist in program
|
1074
1074
|
with program_id 263862512.","status":200}'
|
1075
1075
|
http_version:
|
1076
|
-
recorded_at:
|
1077
|
-
recorded_with: VCR 3.0.
|
1076
|
+
recorded_at: Tue, 02 Feb 2016 00:15:37 GMT
|
1077
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://mms-stage.adcrws.com/v1/auth?member_key=thisisaverybadmember_keyman1234556badbadbad
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Access-Token:
|
11
|
+
- ACCESS_TOKEN
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 401
|
19
|
+
message: Unauthorized
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
X-Content-Type-Options:
|
24
|
+
- nosniff
|
25
|
+
X-Xss-Protection:
|
26
|
+
- 1; mode=block
|
27
|
+
Cache-Control:
|
28
|
+
- no-cache, no-store, max-age=0, must-revalidate
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Expires:
|
32
|
+
- '0'
|
33
|
+
X-Frame-Options:
|
34
|
+
- DENY
|
35
|
+
X-Application-Context:
|
36
|
+
- application:main,stage:10110
|
37
|
+
Content-Type:
|
38
|
+
- application/json;charset=UTF-8
|
39
|
+
Transfer-Encoding:
|
40
|
+
- chunked
|
41
|
+
Date:
|
42
|
+
- Fri, 05 Feb 2016 21:32:13 GMT
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"message":"No active member with specified credentials found.","status":401,"error_code":"AUTHENTICATION_FAILURE_MEMBER_NOT_FOUND"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Fri, 05 Feb 2016 21:30:30 GMT
|
48
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://mms-stage.adcrws.com/v1/auth?member_key=226872
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Access-Token:
|
11
|
+
- ACCESS_TOKEN
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
X-Content-Type-Options:
|
24
|
+
- nosniff
|
25
|
+
X-Xss-Protection:
|
26
|
+
- 1; mode=block
|
27
|
+
Cache-Control:
|
28
|
+
- no-cache, no-store, max-age=0, must-revalidate
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Expires:
|
32
|
+
- '0'
|
33
|
+
X-Frame-Options:
|
34
|
+
- DENY
|
35
|
+
X-Application-Context:
|
36
|
+
- application:main,stage:10120
|
37
|
+
Content-Type:
|
38
|
+
- application/json;charset=UTF-8
|
39
|
+
Transfer-Encoding:
|
40
|
+
- chunked
|
41
|
+
Date:
|
42
|
+
- Fri, 05 Feb 2016 21:32:14 GMT
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"users":[{"program_id":2412,"program_key":"TYP123","program_name":"Access
|
46
|
+
Perks Demo","organization_id":2000896,"organization_key":"TYPDEMO","organization_name":"Access
|
47
|
+
Perks Demo","member_id":89738626,"member_key":"226872","email":"cs@test.com","first_name":"Cody","last_name":"Stringham","reg_id":1084059,"cvt":"6fa6c66c4edc07b767f147a6e5fc614c20797ef0","postal_code":"84101","roles":[],"program_provisioning_method":"SHARED_SECRET","user_has_password":true}],"members":[{"organization":{"organization_id":2000896,"organization_key":"TYPDEMO","name":"Access
|
48
|
+
Perks Demo"},"program":{"program_id":2412,"program_key":"TYP123","name":"Access
|
49
|
+
Perks Demo","provisioning_method":"SHARED_SECRET"},"member":{"member_id":89738626,"member_key":"226872","email":"cs@test.com","first_name":"Cody","last_name":"Stringham","cvt":"6fa6c66c4edc07b767f147a6e5fc614c20797ef0","postal_code":"84101"},"user":{"email":"cs@test.com","first_name":"Cody","last_name":"Stringham","reg_id":1084059,"roles":[],"has_password":true,"password_expired":false}},{"organization":{"organization_id":2000811,"organization_key":"2000811","name":"Alabama
|
50
|
+
Farmers Federation"},"program":{"program_id":2237,"program_key":"100406","name":"Everyday
|
51
|
+
Extras","provisioning_method":"MEMBER_CID"},"member":{"member_id":54967340,"member_key":"226872","email":null,"first_name":"ROBERT","last_name":"W
|
52
|
+
CANTRELL","cvt":"d7926ca8f22fcf998195faedfc448cef99306e9b","postal_code":"35950"}}]}'
|
53
|
+
http_version:
|
54
|
+
recorded_at: Fri, 05 Feb 2016 21:30:31 GMT
|
55
|
+
recorded_with: VCR 3.0.1
|
@@ -135,4 +135,49 @@ http_interactions:
|
|
135
135
|
string: '{"username":"cs@test.com","birth_date":"2016-02-01","gender":null,"home_address":null,"default_location":null,"mobile_phone_number":null,"created_dts":"2015-12-15T00:33:37.372+0000","modified_dts":"2016-01-08T18:36:58.667+0000","last_registered_dts":"2015-10-07T19:57:56.456+0000","active":true,"messaging":null,"first_name":"Cody","last_name":"Stringham","member_id":89738626,"program_id":2412,"member_key":"226872","program_key":"TYP123","cvt":"6fa6c66c4edc07b767f147a6e5fc614c20797ef0","lat_lon_address":null,"address":null}'
|
136
136
|
http_version:
|
137
137
|
recorded_at: Mon, 01 Feb 2016 22:59:49 GMT
|
138
|
-
|
138
|
+
- request:
|
139
|
+
method: put
|
140
|
+
uri: https://mms-stage.adcrws.com/v1/members/226872?program_id=2412
|
141
|
+
body:
|
142
|
+
encoding: UTF-8
|
143
|
+
string: '{"birth_date":"2016-01-01"}'
|
144
|
+
headers:
|
145
|
+
Access-Token:
|
146
|
+
- ACCESS_TOKEN
|
147
|
+
Content-Type:
|
148
|
+
- application/json
|
149
|
+
Accept:
|
150
|
+
- application/json
|
151
|
+
response:
|
152
|
+
status:
|
153
|
+
code: 200
|
154
|
+
message: OK
|
155
|
+
headers:
|
156
|
+
Server:
|
157
|
+
- Apache-Coyote/1.1
|
158
|
+
X-Content-Type-Options:
|
159
|
+
- nosniff
|
160
|
+
X-Xss-Protection:
|
161
|
+
- 1; mode=block
|
162
|
+
Cache-Control:
|
163
|
+
- no-cache, no-store, max-age=0, must-revalidate
|
164
|
+
Pragma:
|
165
|
+
- no-cache
|
166
|
+
Expires:
|
167
|
+
- '0'
|
168
|
+
X-Frame-Options:
|
169
|
+
- DENY
|
170
|
+
X-Application-Context:
|
171
|
+
- application:main,stage:10120
|
172
|
+
Content-Type:
|
173
|
+
- application/json;charset=UTF-8
|
174
|
+
Transfer-Encoding:
|
175
|
+
- chunked
|
176
|
+
Date:
|
177
|
+
- Tue, 02 Feb 2016 00:17:18 GMT
|
178
|
+
body:
|
179
|
+
encoding: UTF-8
|
180
|
+
string: '{"username":"cs@test.com","birth_date":"2016-01-01","gender":null,"home_address":null,"default_location":null,"mobile_phone_number":null,"created_dts":"2015-12-15T00:33:37.372+0000","modified_dts":"2016-02-02T00:13:07.879+0000","last_registered_dts":"2015-10-07T19:57:56.456+0000","active":true,"messaging":null,"first_name":"Cody","last_name":"Stringham","member_id":89738626,"program_id":2412,"member_key":"226872","program_key":"TYP123","cvt":"6fa6c66c4edc07b767f147a6e5fc614c20797ef0","lat_lon_address":null,"address":null}'
|
181
|
+
http_version:
|
182
|
+
recorded_at: Tue, 02 Feb 2016 00:15:38 GMT
|
183
|
+
recorded_with: VCR 3.0.1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: access
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-02-
|
13
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -313,6 +313,8 @@ files:
|
|
313
313
|
- test/vcr/cassettes/member_authenticate_cvt_failure.yml
|
314
314
|
- test/vcr/cassettes/member_authenticate_cvt_success.yml
|
315
315
|
- test/vcr/cassettes/member_authenticate_failure.yml
|
316
|
+
- test/vcr/cassettes/member_authenticate_member_key_failure.yml
|
317
|
+
- test/vcr/cassettes/member_authenticate_member_key_success.yml
|
316
318
|
- test/vcr/cassettes/member_authenticate_success.yml
|
317
319
|
- test/vcr/cassettes/member_device_search_failure.yml
|
318
320
|
- test/vcr/cassettes/member_device_search_success.yml
|
@@ -444,6 +446,8 @@ test_files:
|
|
444
446
|
- test/vcr/cassettes/member_authenticate_cvt_failure.yml
|
445
447
|
- test/vcr/cassettes/member_authenticate_cvt_success.yml
|
446
448
|
- test/vcr/cassettes/member_authenticate_failure.yml
|
449
|
+
- test/vcr/cassettes/member_authenticate_member_key_failure.yml
|
450
|
+
- test/vcr/cassettes/member_authenticate_member_key_success.yml
|
447
451
|
- test/vcr/cassettes/member_authenticate_success.yml
|
448
452
|
- test/vcr/cassettes/member_device_search_failure.yml
|
449
453
|
- test/vcr/cassettes/member_device_search_success.yml
|