openstax_exchange 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +15 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -0
- data/Gemfile +4 -0
- data/MIT-LICENSE +3 -1
- data/README.md +58 -20
- data/Rakefile +5 -13
- data/exchange-client.gemspec +30 -0
- data/lib/openstax/exchange/client_instance.rb +23 -0
- data/lib/openstax/exchange/configuration.rb +12 -0
- data/lib/openstax/exchange/exceptions.rb +21 -0
- data/lib/openstax/exchange/exchange.rb +65 -0
- data/lib/openstax/exchange/fake_client/configuration.rb +13 -0
- data/lib/openstax/exchange/fake_client/fake_client.rb +71 -0
- data/lib/openstax/exchange/real_client/real_client.rb +76 -0
- data/lib/openstax/exchange/version.rb +1 -1
- data/lib/openstax_exchange.rb +8 -112
- data/spec/cassettes/OpenStax_Exchange/client_instance_configuration/can_be_configured_to_use_a_real_exchange_client.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange/internal_client_instance/_client_defaults_to_a_real_exchange_client.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange/internal_client_instance/_reset_causes_a_new_client_object_to_be_returned_by_client.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_create_identifier/success/creates_a_distinct_identifer_per_invokation.yml +146 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_create_identifier/success/creates_and_returns_a_new_identifier.yml +97 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_initialize/invalid_platform_id/raises_an_exception.yml +52 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_initialize/invalid_platform_secret/raises_an_exception.yml +52 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_initialize/success/initializes_the_authentication_token.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/duplicate_identifer_resource_trial_triplet/raises_an_exception.yml +194 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/invalid_resource_string/raises_an_exception.yml +145 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/allows_answers_with_distinct_identifiers_to_be_saved.yml +244 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/allows_answers_with_distinct_resources_to_be_saved.yml +195 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/allows_answers_with_distinct_trials_to_be_saved.yml +195 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/creates_a_multiple_choice_answer_associated_with_the_given_identifier.yml +146 -0
- data/spec/lib/openstax/exchange/client_configuration_spec.rb +58 -0
- data/spec/lib/openstax/exchange/fake_client_v1_spec.rb +14 -0
- data/spec/lib/openstax/exchange/real_client_v1_spec.rb +9 -0
- data/spec/lib/openstax/exchange/shared_examples_for_exchange_client_v1.rb +208 -0
- data/spec/spec_helper.rb +52 -38
- metadata +97 -100
- checksums.yaml +0 -15
- data/spec/dummy/README.md +0 -1
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/api/dummy_controller.rb +0 -11
- data/spec/dummy/app/controllers/api/events_controller.rb +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -7
- data/spec/dummy/app/controllers/oauth_controller.rb +0 -8
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -55
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -29
- data/spec/dummy/config/environments/production.rb +0 -69
- data/spec/dummy/config/environments/test.rb +0 -35
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/openstax_exchange.rb +0 -10
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -11
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +0 -16
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -929
- data/spec/dummy/log/test.log +0 -46753
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/lib/openstax_exchange_spec.rb +0 -23
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: grant_type=client_credentials
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Faraday v0.9.0
|
|
12
|
+
Content-Type:
|
|
13
|
+
- application/x-www-form-urlencoded
|
|
14
|
+
Accept:
|
|
15
|
+
- ! '*/*'
|
|
16
|
+
response:
|
|
17
|
+
status:
|
|
18
|
+
code: 200
|
|
19
|
+
message: OK
|
|
20
|
+
headers:
|
|
21
|
+
X-Frame-Options:
|
|
22
|
+
- SAMEORIGIN
|
|
23
|
+
X-Xss-Protection:
|
|
24
|
+
- 1; mode=block
|
|
25
|
+
X-Content-Type-Options:
|
|
26
|
+
- nosniff
|
|
27
|
+
Cache-Control:
|
|
28
|
+
- no-store
|
|
29
|
+
Pragma:
|
|
30
|
+
- no-cache
|
|
31
|
+
Content-Type:
|
|
32
|
+
- application/json; charset=utf-8
|
|
33
|
+
Etag:
|
|
34
|
+
- W/"82884c9b3008af4ccaf46353aeeef132"
|
|
35
|
+
X-Request-Id:
|
|
36
|
+
- 6f2fc9e1-1fef-4518-93dc-37648900170a
|
|
37
|
+
X-Runtime:
|
|
38
|
+
- '0.015095'
|
|
39
|
+
Connection:
|
|
40
|
+
- close
|
|
41
|
+
Server:
|
|
42
|
+
- thin
|
|
43
|
+
body:
|
|
44
|
+
encoding: US-ASCII
|
|
45
|
+
string: ! '{"access_token":"08b427583d41d73a5672ec0fc8b97871bc0b694d52fc1087209a498fa68a9110","token_type":"bearer"}'
|
|
46
|
+
http_version:
|
|
47
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
48
|
+
- request:
|
|
49
|
+
method: post
|
|
50
|
+
uri: http://localhost:3003/api/identifiers
|
|
51
|
+
body:
|
|
52
|
+
encoding: US-ASCII
|
|
53
|
+
string: ''
|
|
54
|
+
headers:
|
|
55
|
+
User-Agent:
|
|
56
|
+
- Faraday v0.9.0
|
|
57
|
+
Accept:
|
|
58
|
+
- application/vnd.exchange.openstax.v1
|
|
59
|
+
Authorization:
|
|
60
|
+
- Bearer 08b427583d41d73a5672ec0fc8b97871bc0b694d52fc1087209a498fa68a9110
|
|
61
|
+
Content-Length:
|
|
62
|
+
- '0'
|
|
63
|
+
response:
|
|
64
|
+
status:
|
|
65
|
+
code: 201
|
|
66
|
+
message: Created
|
|
67
|
+
headers:
|
|
68
|
+
X-Frame-Options:
|
|
69
|
+
- SAMEORIGIN
|
|
70
|
+
X-Xss-Protection:
|
|
71
|
+
- 1; mode=block
|
|
72
|
+
X-Content-Type-Options:
|
|
73
|
+
- nosniff
|
|
74
|
+
Content-Type:
|
|
75
|
+
- application/json; charset=utf-8
|
|
76
|
+
Etag:
|
|
77
|
+
- W/"cc8e379581092a35e843b81cbfd33d2b"
|
|
78
|
+
Cache-Control:
|
|
79
|
+
- max-age=0, private, must-revalidate
|
|
80
|
+
Set-Cookie:
|
|
81
|
+
- _exercises_session=KzB4Ymw2a3pxSjliRlQ5ZVZFWlQxelBVNW1hVWZiWGowdWN5d296VFplTDUzZjV1QWJyaTdCRGdjMnhIbC9sbnZJQ1RKYkthOXIzRlBGQk1nMDNZRXc9PS0tMGVrK2ZyTjBWU0VjUlU0Ri9YRVE2Zz09--41d9dbc4721df5af04b5f4fa8ba0147184bde304;
|
|
82
|
+
path=/; HttpOnly
|
|
83
|
+
- request_method=POST; path=/
|
|
84
|
+
X-Request-Id:
|
|
85
|
+
- ba6a728a-6ebf-42b8-9f40-c20a90c285ee
|
|
86
|
+
X-Runtime:
|
|
87
|
+
- '0.042171'
|
|
88
|
+
Connection:
|
|
89
|
+
- close
|
|
90
|
+
Server:
|
|
91
|
+
- thin
|
|
92
|
+
body:
|
|
93
|
+
encoding: US-ASCII
|
|
94
|
+
string: ! '{"identifier":"8619c5b7492c2221a1964a8bd4483ea7c4ec0704f5cfe7c4897e501de5ae755c"}'
|
|
95
|
+
http_version:
|
|
96
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
97
|
+
- request:
|
|
98
|
+
method: post
|
|
99
|
+
uri: http://localhost:3003/api/identifiers
|
|
100
|
+
body:
|
|
101
|
+
encoding: US-ASCII
|
|
102
|
+
string: ''
|
|
103
|
+
headers:
|
|
104
|
+
User-Agent:
|
|
105
|
+
- Faraday v0.9.0
|
|
106
|
+
Accept:
|
|
107
|
+
- application/vnd.exchange.openstax.v1
|
|
108
|
+
Authorization:
|
|
109
|
+
- Bearer 08b427583d41d73a5672ec0fc8b97871bc0b694d52fc1087209a498fa68a9110
|
|
110
|
+
Content-Length:
|
|
111
|
+
- '0'
|
|
112
|
+
response:
|
|
113
|
+
status:
|
|
114
|
+
code: 201
|
|
115
|
+
message: Created
|
|
116
|
+
headers:
|
|
117
|
+
X-Frame-Options:
|
|
118
|
+
- SAMEORIGIN
|
|
119
|
+
X-Xss-Protection:
|
|
120
|
+
- 1; mode=block
|
|
121
|
+
X-Content-Type-Options:
|
|
122
|
+
- nosniff
|
|
123
|
+
Content-Type:
|
|
124
|
+
- application/json; charset=utf-8
|
|
125
|
+
Etag:
|
|
126
|
+
- W/"5838958de72eb3a04dae80c5d2a65a4d"
|
|
127
|
+
Cache-Control:
|
|
128
|
+
- max-age=0, private, must-revalidate
|
|
129
|
+
Set-Cookie:
|
|
130
|
+
- _exercises_session=cTh0SUtoaE9qNk9Kd041L1lkamRNSE1mbEE1Wmd4TUVVZEFrTmw0WE4yLzJYU3B1K1lhVHNnY0VMdzZBREpPOExZUkl2eFNBV0V4cU9sRmVtQlM1WlE9PS0teGMrWUo3aGFFT3luTWJwa0UyT1MzQT09--380d39715f335d623df313c6148f6ab3340af9b8;
|
|
131
|
+
path=/; HttpOnly
|
|
132
|
+
- request_method=POST; path=/
|
|
133
|
+
X-Request-Id:
|
|
134
|
+
- 896f939e-0dd4-4f1a-a8f1-8995d382486b
|
|
135
|
+
X-Runtime:
|
|
136
|
+
- '0.050707'
|
|
137
|
+
Connection:
|
|
138
|
+
- close
|
|
139
|
+
Server:
|
|
140
|
+
- thin
|
|
141
|
+
body:
|
|
142
|
+
encoding: US-ASCII
|
|
143
|
+
string: ! '{"identifier":"aa9e51faf7833b6956153781c684cc8c35d4dd36d6f614a0bf48556710db5cc0"}'
|
|
144
|
+
http_version:
|
|
145
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
146
|
+
- request:
|
|
147
|
+
method: post
|
|
148
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
|
149
|
+
body:
|
|
150
|
+
encoding: UTF-8
|
|
151
|
+
string: ! '{"identifier":"8619c5b7492c2221a1964a8bd4483ea7c4ec0704f5cfe7c4897e501de5ae755c","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","answer":"answer_string"}'
|
|
152
|
+
headers:
|
|
153
|
+
User-Agent:
|
|
154
|
+
- Faraday v0.9.0
|
|
155
|
+
Accept:
|
|
156
|
+
- application/vnd.exchange.openstax.v1
|
|
157
|
+
Authorization:
|
|
158
|
+
- Bearer 08b427583d41d73a5672ec0fc8b97871bc0b694d52fc1087209a498fa68a9110
|
|
159
|
+
Content-Type:
|
|
160
|
+
- application/x-www-form-urlencoded
|
|
161
|
+
response:
|
|
162
|
+
status:
|
|
163
|
+
code: 201
|
|
164
|
+
message: Created
|
|
165
|
+
headers:
|
|
166
|
+
X-Frame-Options:
|
|
167
|
+
- SAMEORIGIN
|
|
168
|
+
X-Xss-Protection:
|
|
169
|
+
- 1; mode=block
|
|
170
|
+
X-Content-Type-Options:
|
|
171
|
+
- nosniff
|
|
172
|
+
Content-Type:
|
|
173
|
+
- application/json; charset=utf-8
|
|
174
|
+
Etag:
|
|
175
|
+
- W/"ae12b9a761fcb42683b1bd4dee9441af"
|
|
176
|
+
Cache-Control:
|
|
177
|
+
- max-age=0, private, must-revalidate
|
|
178
|
+
Set-Cookie:
|
|
179
|
+
- _exercises_session=Q01wRDFka2ZDVk8xRW1MaE5ERTk5dWdVWmhrVlFERFY5QTFRS0FQUnRFUW0raUFGOXM3cXdsM3owSW9RQjFWN1N1bm10WVdWSndMMUFiUXlId0dVTEE9PS0tVFh4K0hONllncll4K3ZPaWlEV01mdz09--001bc64a41e72905652fb2e291165f826b98c9e2;
|
|
180
|
+
path=/; HttpOnly
|
|
181
|
+
- request_method=POST; path=/
|
|
182
|
+
X-Request-Id:
|
|
183
|
+
- d7abcb98-3843-43ac-be4c-df8e31e7d2d4
|
|
184
|
+
X-Runtime:
|
|
185
|
+
- '0.075641'
|
|
186
|
+
Connection:
|
|
187
|
+
- close
|
|
188
|
+
Server:
|
|
189
|
+
- thin
|
|
190
|
+
body:
|
|
191
|
+
encoding: US-ASCII
|
|
192
|
+
string: ! '{"identifier":"8619c5b7492c2221a1964a8bd4483ea7c4ec0704f5cfe7c4897e501de5ae755c","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","created_at":"2015-01-12T21:08:52.635Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
|
193
|
+
http_version:
|
|
194
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
195
|
+
- request:
|
|
196
|
+
method: post
|
|
197
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
|
198
|
+
body:
|
|
199
|
+
encoding: UTF-8
|
|
200
|
+
string: ! '{"identifier":"aa9e51faf7833b6956153781c684cc8c35d4dd36d6f614a0bf48556710db5cc0","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","answer":"answer_string"}'
|
|
201
|
+
headers:
|
|
202
|
+
User-Agent:
|
|
203
|
+
- Faraday v0.9.0
|
|
204
|
+
Accept:
|
|
205
|
+
- application/vnd.exchange.openstax.v1
|
|
206
|
+
Authorization:
|
|
207
|
+
- Bearer 08b427583d41d73a5672ec0fc8b97871bc0b694d52fc1087209a498fa68a9110
|
|
208
|
+
Content-Type:
|
|
209
|
+
- application/x-www-form-urlencoded
|
|
210
|
+
response:
|
|
211
|
+
status:
|
|
212
|
+
code: 201
|
|
213
|
+
message: Created
|
|
214
|
+
headers:
|
|
215
|
+
X-Frame-Options:
|
|
216
|
+
- SAMEORIGIN
|
|
217
|
+
X-Xss-Protection:
|
|
218
|
+
- 1; mode=block
|
|
219
|
+
X-Content-Type-Options:
|
|
220
|
+
- nosniff
|
|
221
|
+
Content-Type:
|
|
222
|
+
- application/json; charset=utf-8
|
|
223
|
+
Etag:
|
|
224
|
+
- W/"b5c2bf1e932a083356ff7234261c9400"
|
|
225
|
+
Cache-Control:
|
|
226
|
+
- max-age=0, private, must-revalidate
|
|
227
|
+
Set-Cookie:
|
|
228
|
+
- _exercises_session=M29CMSswL3BCTHRLR3FtQzZnMkNnTUtrY1IrVmNXQ2o3bWg1Znl3bjFnMytxaWczNnNsRVZPNjhiQXZ5am9ldTFDMDdFTVk2R3daYU1HOE5QK3B3ZlE9PS0tcW5Oei9ZSnltSTF0OVV4YStuVDRmUT09--9d1b98d2f867110d4d0cdb0f0b6a0c49b2e72b6a;
|
|
229
|
+
path=/; HttpOnly
|
|
230
|
+
- request_method=POST; path=/
|
|
231
|
+
X-Request-Id:
|
|
232
|
+
- ec3f8534-526d-4fd9-81a1-ac4bbd66b954
|
|
233
|
+
X-Runtime:
|
|
234
|
+
- '0.159099'
|
|
235
|
+
Connection:
|
|
236
|
+
- close
|
|
237
|
+
Server:
|
|
238
|
+
- thin
|
|
239
|
+
body:
|
|
240
|
+
encoding: US-ASCII
|
|
241
|
+
string: ! '{"identifier":"aa9e51faf7833b6956153781c684cc8c35d4dd36d6f614a0bf48556710db5cc0","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","created_at":"2015-01-12T21:08:52.794Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
|
242
|
+
http_version:
|
|
243
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
244
|
+
recorded_with: VCR 2.9.3
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: grant_type=client_credentials
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Faraday v0.9.0
|
|
12
|
+
Content-Type:
|
|
13
|
+
- application/x-www-form-urlencoded
|
|
14
|
+
Accept:
|
|
15
|
+
- ! '*/*'
|
|
16
|
+
response:
|
|
17
|
+
status:
|
|
18
|
+
code: 200
|
|
19
|
+
message: OK
|
|
20
|
+
headers:
|
|
21
|
+
X-Frame-Options:
|
|
22
|
+
- SAMEORIGIN
|
|
23
|
+
X-Xss-Protection:
|
|
24
|
+
- 1; mode=block
|
|
25
|
+
X-Content-Type-Options:
|
|
26
|
+
- nosniff
|
|
27
|
+
Cache-Control:
|
|
28
|
+
- no-store
|
|
29
|
+
Pragma:
|
|
30
|
+
- no-cache
|
|
31
|
+
Content-Type:
|
|
32
|
+
- application/json; charset=utf-8
|
|
33
|
+
Etag:
|
|
34
|
+
- W/"1db1bd051b10759d8e082f9c4d97f1a2"
|
|
35
|
+
X-Request-Id:
|
|
36
|
+
- b7c271cf-e691-408f-a891-601ae080a091
|
|
37
|
+
X-Runtime:
|
|
38
|
+
- '0.032509'
|
|
39
|
+
Connection:
|
|
40
|
+
- close
|
|
41
|
+
Server:
|
|
42
|
+
- thin
|
|
43
|
+
body:
|
|
44
|
+
encoding: US-ASCII
|
|
45
|
+
string: ! '{"access_token":"223e1079d9fc17c0a6c72d3b203a8685fe81e6bb2e5afa242570c1f7d14d58a4","token_type":"bearer"}'
|
|
46
|
+
http_version:
|
|
47
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
48
|
+
- request:
|
|
49
|
+
method: post
|
|
50
|
+
uri: http://localhost:3003/api/identifiers
|
|
51
|
+
body:
|
|
52
|
+
encoding: US-ASCII
|
|
53
|
+
string: ''
|
|
54
|
+
headers:
|
|
55
|
+
User-Agent:
|
|
56
|
+
- Faraday v0.9.0
|
|
57
|
+
Accept:
|
|
58
|
+
- application/vnd.exchange.openstax.v1
|
|
59
|
+
Authorization:
|
|
60
|
+
- Bearer 223e1079d9fc17c0a6c72d3b203a8685fe81e6bb2e5afa242570c1f7d14d58a4
|
|
61
|
+
Content-Length:
|
|
62
|
+
- '0'
|
|
63
|
+
response:
|
|
64
|
+
status:
|
|
65
|
+
code: 201
|
|
66
|
+
message: Created
|
|
67
|
+
headers:
|
|
68
|
+
X-Frame-Options:
|
|
69
|
+
- SAMEORIGIN
|
|
70
|
+
X-Xss-Protection:
|
|
71
|
+
- 1; mode=block
|
|
72
|
+
X-Content-Type-Options:
|
|
73
|
+
- nosniff
|
|
74
|
+
Content-Type:
|
|
75
|
+
- application/json; charset=utf-8
|
|
76
|
+
Etag:
|
|
77
|
+
- W/"7c513075a0628876caf5244e0aa179c9"
|
|
78
|
+
Cache-Control:
|
|
79
|
+
- max-age=0, private, must-revalidate
|
|
80
|
+
Set-Cookie:
|
|
81
|
+
- _exercises_session=M0Q2Mzc1YkNpdHpKQ2h6cWVEUTR4SXFIUXdNbjR6cS9aSzBORmJkWVc4U1FHK0U3VWQ3bkhKemxJNU1jdXI0ZGNCQzNicU5zYU9acWVJZ2pHUWlwRFE9PS0tQTVPcTAxVkRaVVhQSlRBVEpDTVoyUT09--39d88c2341b105f2c8d188d7da12aeb44d835072;
|
|
82
|
+
path=/; HttpOnly
|
|
83
|
+
- request_method=POST; path=/
|
|
84
|
+
X-Request-Id:
|
|
85
|
+
- db3af164-fc15-49b2-8dee-212b50963600
|
|
86
|
+
X-Runtime:
|
|
87
|
+
- '0.052918'
|
|
88
|
+
Connection:
|
|
89
|
+
- close
|
|
90
|
+
Server:
|
|
91
|
+
- thin
|
|
92
|
+
body:
|
|
93
|
+
encoding: US-ASCII
|
|
94
|
+
string: ! '{"identifier":"a77551fb068480c38afd1dd8d8fb8e3eac943992a6769d404786e863e00720c4"}'
|
|
95
|
+
http_version:
|
|
96
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
|
97
|
+
- request:
|
|
98
|
+
method: post
|
|
99
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
|
100
|
+
body:
|
|
101
|
+
encoding: UTF-8
|
|
102
|
+
string: ! '{"identifier":"a77551fb068480c38afd1dd8d8fb8e3eac943992a6769d404786e863e00720c4","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","answer":"answer_string"}'
|
|
103
|
+
headers:
|
|
104
|
+
User-Agent:
|
|
105
|
+
- Faraday v0.9.0
|
|
106
|
+
Accept:
|
|
107
|
+
- application/vnd.exchange.openstax.v1
|
|
108
|
+
Authorization:
|
|
109
|
+
- Bearer 223e1079d9fc17c0a6c72d3b203a8685fe81e6bb2e5afa242570c1f7d14d58a4
|
|
110
|
+
Content-Type:
|
|
111
|
+
- application/x-www-form-urlencoded
|
|
112
|
+
response:
|
|
113
|
+
status:
|
|
114
|
+
code: 201
|
|
115
|
+
message: Created
|
|
116
|
+
headers:
|
|
117
|
+
X-Frame-Options:
|
|
118
|
+
- SAMEORIGIN
|
|
119
|
+
X-Xss-Protection:
|
|
120
|
+
- 1; mode=block
|
|
121
|
+
X-Content-Type-Options:
|
|
122
|
+
- nosniff
|
|
123
|
+
Content-Type:
|
|
124
|
+
- application/json; charset=utf-8
|
|
125
|
+
Etag:
|
|
126
|
+
- W/"af5fad75935bb550a629ec0c635ad608"
|
|
127
|
+
Cache-Control:
|
|
128
|
+
- max-age=0, private, must-revalidate
|
|
129
|
+
Set-Cookie:
|
|
130
|
+
- _exercises_session=WWZqcUdHS3ErZGRsc3F5NjZTWmQyZGx0OXJaTWRXQm1JaXE2c1ZWZEVZQno2TG5QQk16TVY3SS92TEo4T09rZFNsU29uMWRuRHA0eWF2cFhwS0NFdnc9PS0tbzJObitQNGx5czJBRlZoK1JmcThxZz09--3f3618e97901ffdc7bf941e0a4ee3b2d1a27b20e;
|
|
131
|
+
path=/; HttpOnly
|
|
132
|
+
- request_method=POST; path=/
|
|
133
|
+
X-Request-Id:
|
|
134
|
+
- 8fc95cac-5d8b-43b5-ba35-4de0b2342503
|
|
135
|
+
X-Runtime:
|
|
136
|
+
- '0.073550'
|
|
137
|
+
Connection:
|
|
138
|
+
- close
|
|
139
|
+
Server:
|
|
140
|
+
- thin
|
|
141
|
+
body:
|
|
142
|
+
encoding: US-ASCII
|
|
143
|
+
string: ! '{"identifier":"a77551fb068480c38afd1dd8d8fb8e3eac943992a6769d404786e863e00720c4","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","created_at":"2015-01-12T21:08:52.988Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
|
144
|
+
http_version:
|
|
145
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
|
146
|
+
- request:
|
|
147
|
+
method: post
|
|
148
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
|
149
|
+
body:
|
|
150
|
+
encoding: UTF-8
|
|
151
|
+
string: ! '{"identifier":"a77551fb068480c38afd1dd8d8fb8e3eac943992a6769d404786e863e00720c4","resource":"http://exercises.openstax.org/exercises/3456","trial":"1","answer":"answer_string"}'
|
|
152
|
+
headers:
|
|
153
|
+
User-Agent:
|
|
154
|
+
- Faraday v0.9.0
|
|
155
|
+
Accept:
|
|
156
|
+
- application/vnd.exchange.openstax.v1
|
|
157
|
+
Authorization:
|
|
158
|
+
- Bearer 223e1079d9fc17c0a6c72d3b203a8685fe81e6bb2e5afa242570c1f7d14d58a4
|
|
159
|
+
Content-Type:
|
|
160
|
+
- application/x-www-form-urlencoded
|
|
161
|
+
response:
|
|
162
|
+
status:
|
|
163
|
+
code: 201
|
|
164
|
+
message: Created
|
|
165
|
+
headers:
|
|
166
|
+
X-Frame-Options:
|
|
167
|
+
- SAMEORIGIN
|
|
168
|
+
X-Xss-Protection:
|
|
169
|
+
- 1; mode=block
|
|
170
|
+
X-Content-Type-Options:
|
|
171
|
+
- nosniff
|
|
172
|
+
Content-Type:
|
|
173
|
+
- application/json; charset=utf-8
|
|
174
|
+
Etag:
|
|
175
|
+
- W/"43d957a9436ca80c3a80f25ee5ebd56d"
|
|
176
|
+
Cache-Control:
|
|
177
|
+
- max-age=0, private, must-revalidate
|
|
178
|
+
Set-Cookie:
|
|
179
|
+
- _exercises_session=WXZhTXZ0Vnpxb3VEVHVlcEltaWJSQVQvWGFjVmFvRW9hZGhCQkVyNXJTblE3MVkyZmIxcUFpdSt4V3Mvei9KbHNOT2g4Q2NraEh0czNDdmRhNkdUVHc9PS0tbDFWT3pqdU84U0NLOG1nb1ZoY3VoZz09--b13cdee89189697d1755394ee5bdddd8d19e7f11;
|
|
180
|
+
path=/; HttpOnly
|
|
181
|
+
- request_method=POST; path=/
|
|
182
|
+
X-Request-Id:
|
|
183
|
+
- 82239e96-36ba-4908-8c11-ed84ec764e8e
|
|
184
|
+
X-Runtime:
|
|
185
|
+
- '0.082626'
|
|
186
|
+
Connection:
|
|
187
|
+
- close
|
|
188
|
+
Server:
|
|
189
|
+
- thin
|
|
190
|
+
body:
|
|
191
|
+
encoding: US-ASCII
|
|
192
|
+
string: ! '{"identifier":"a77551fb068480c38afd1dd8d8fb8e3eac943992a6769d404786e863e00720c4","resource":"http://exercises.openstax.org/exercises/3456","trial":"1","created_at":"2015-01-12T21:08:53.073Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
|
193
|
+
http_version:
|
|
194
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
|
195
|
+
recorded_with: VCR 2.9.3
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: grant_type=client_credentials
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Faraday v0.9.0
|
|
12
|
+
Content-Type:
|
|
13
|
+
- application/x-www-form-urlencoded
|
|
14
|
+
Accept:
|
|
15
|
+
- ! '*/*'
|
|
16
|
+
response:
|
|
17
|
+
status:
|
|
18
|
+
code: 200
|
|
19
|
+
message: OK
|
|
20
|
+
headers:
|
|
21
|
+
X-Frame-Options:
|
|
22
|
+
- SAMEORIGIN
|
|
23
|
+
X-Xss-Protection:
|
|
24
|
+
- 1; mode=block
|
|
25
|
+
X-Content-Type-Options:
|
|
26
|
+
- nosniff
|
|
27
|
+
Cache-Control:
|
|
28
|
+
- no-store
|
|
29
|
+
Pragma:
|
|
30
|
+
- no-cache
|
|
31
|
+
Content-Type:
|
|
32
|
+
- application/json; charset=utf-8
|
|
33
|
+
Etag:
|
|
34
|
+
- W/"ab1b4891590a9b55ed3b68cdea0797dc"
|
|
35
|
+
X-Request-Id:
|
|
36
|
+
- eae23034-415c-41d8-b753-c1c2db718bef
|
|
37
|
+
X-Runtime:
|
|
38
|
+
- '0.015784'
|
|
39
|
+
Connection:
|
|
40
|
+
- close
|
|
41
|
+
Server:
|
|
42
|
+
- thin
|
|
43
|
+
body:
|
|
44
|
+
encoding: US-ASCII
|
|
45
|
+
string: ! '{"access_token":"b59697ce884560cd4ffb45d25429eac6e7748b02b92515435b878ecefdc5b744","token_type":"bearer"}'
|
|
46
|
+
http_version:
|
|
47
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
|
48
|
+
- request:
|
|
49
|
+
method: post
|
|
50
|
+
uri: http://localhost:3003/api/identifiers
|
|
51
|
+
body:
|
|
52
|
+
encoding: US-ASCII
|
|
53
|
+
string: ''
|
|
54
|
+
headers:
|
|
55
|
+
User-Agent:
|
|
56
|
+
- Faraday v0.9.0
|
|
57
|
+
Accept:
|
|
58
|
+
- application/vnd.exchange.openstax.v1
|
|
59
|
+
Authorization:
|
|
60
|
+
- Bearer b59697ce884560cd4ffb45d25429eac6e7748b02b92515435b878ecefdc5b744
|
|
61
|
+
Content-Length:
|
|
62
|
+
- '0'
|
|
63
|
+
response:
|
|
64
|
+
status:
|
|
65
|
+
code: 201
|
|
66
|
+
message: Created
|
|
67
|
+
headers:
|
|
68
|
+
X-Frame-Options:
|
|
69
|
+
- SAMEORIGIN
|
|
70
|
+
X-Xss-Protection:
|
|
71
|
+
- 1; mode=block
|
|
72
|
+
X-Content-Type-Options:
|
|
73
|
+
- nosniff
|
|
74
|
+
Content-Type:
|
|
75
|
+
- application/json; charset=utf-8
|
|
76
|
+
Etag:
|
|
77
|
+
- W/"23bf8a5c1f6c37c77f932fb457c2cf9c"
|
|
78
|
+
Cache-Control:
|
|
79
|
+
- max-age=0, private, must-revalidate
|
|
80
|
+
Set-Cookie:
|
|
81
|
+
- _exercises_session=MXhFZHZROXBOL0htVUZURkN6c1EvVkl4emF4WjlCcEpEeld6R21CVWlmZVltWUt1ODZ0cnh6WVl2d3Jka0dIOVVEdStRbXFGZ0pxUCtHTmhzUllZTkE9PS0taGNnRlhPTU9VMWNwTzM3a2ZjK2x1dz09--96afdd88799321242558c51063c5740eb5628341;
|
|
82
|
+
path=/; HttpOnly
|
|
83
|
+
- request_method=POST; path=/
|
|
84
|
+
X-Request-Id:
|
|
85
|
+
- 43446333-8184-48d5-9967-5dc67b1821a3
|
|
86
|
+
X-Runtime:
|
|
87
|
+
- '0.043338'
|
|
88
|
+
Connection:
|
|
89
|
+
- close
|
|
90
|
+
Server:
|
|
91
|
+
- thin
|
|
92
|
+
body:
|
|
93
|
+
encoding: US-ASCII
|
|
94
|
+
string: ! '{"identifier":"abea60a1e7d41a4bc1e08dac7d5503f2d4d1b980525040ffd0a518ccc56cfa21"}'
|
|
95
|
+
http_version:
|
|
96
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
|
97
|
+
- request:
|
|
98
|
+
method: post
|
|
99
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
|
100
|
+
body:
|
|
101
|
+
encoding: UTF-8
|
|
102
|
+
string: ! '{"identifier":"abea60a1e7d41a4bc1e08dac7d5503f2d4d1b980525040ffd0a518ccc56cfa21","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","answer":"answer_string"}'
|
|
103
|
+
headers:
|
|
104
|
+
User-Agent:
|
|
105
|
+
- Faraday v0.9.0
|
|
106
|
+
Accept:
|
|
107
|
+
- application/vnd.exchange.openstax.v1
|
|
108
|
+
Authorization:
|
|
109
|
+
- Bearer b59697ce884560cd4ffb45d25429eac6e7748b02b92515435b878ecefdc5b744
|
|
110
|
+
Content-Type:
|
|
111
|
+
- application/x-www-form-urlencoded
|
|
112
|
+
response:
|
|
113
|
+
status:
|
|
114
|
+
code: 201
|
|
115
|
+
message: Created
|
|
116
|
+
headers:
|
|
117
|
+
X-Frame-Options:
|
|
118
|
+
- SAMEORIGIN
|
|
119
|
+
X-Xss-Protection:
|
|
120
|
+
- 1; mode=block
|
|
121
|
+
X-Content-Type-Options:
|
|
122
|
+
- nosniff
|
|
123
|
+
Content-Type:
|
|
124
|
+
- application/json; charset=utf-8
|
|
125
|
+
Etag:
|
|
126
|
+
- W/"4738777d6ef383aacb01235f3f0aecc9"
|
|
127
|
+
Cache-Control:
|
|
128
|
+
- max-age=0, private, must-revalidate
|
|
129
|
+
Set-Cookie:
|
|
130
|
+
- _exercises_session=NTJxQU1LM3VLRmJZYmZveHl5RFkxWkorVWNxMUZYQWpuNWx3OVZrbFlDT0tVYWhucXpMTXZ2SXY2SUdXVStxZ0VzZlJNYTg5ckIzaVdiWC92dy95V0E9PS0tK1hLVWRzRDA4MzRhWWhBbUEwenRuUT09--5629f468e0c0390f0e8503de735c2de2bb61fdb8;
|
|
131
|
+
path=/; HttpOnly
|
|
132
|
+
- request_method=POST; path=/
|
|
133
|
+
X-Request-Id:
|
|
134
|
+
- eba4d4cc-b391-40e1-bf64-7960a35f4d8d
|
|
135
|
+
X-Runtime:
|
|
136
|
+
- '0.121233'
|
|
137
|
+
Connection:
|
|
138
|
+
- close
|
|
139
|
+
Server:
|
|
140
|
+
- thin
|
|
141
|
+
body:
|
|
142
|
+
encoding: US-ASCII
|
|
143
|
+
string: ! '{"identifier":"abea60a1e7d41a4bc1e08dac7d5503f2d4d1b980525040ffd0a518ccc56cfa21","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","created_at":"2015-01-12T21:08:53.287Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
|
144
|
+
http_version:
|
|
145
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
|
146
|
+
- request:
|
|
147
|
+
method: post
|
|
148
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
|
149
|
+
body:
|
|
150
|
+
encoding: UTF-8
|
|
151
|
+
string: ! '{"identifier":"abea60a1e7d41a4bc1e08dac7d5503f2d4d1b980525040ffd0a518ccc56cfa21","resource":"http://exercises.openstax.org/exercises/1234","trial":"2","answer":"answer_string"}'
|
|
152
|
+
headers:
|
|
153
|
+
User-Agent:
|
|
154
|
+
- Faraday v0.9.0
|
|
155
|
+
Accept:
|
|
156
|
+
- application/vnd.exchange.openstax.v1
|
|
157
|
+
Authorization:
|
|
158
|
+
- Bearer b59697ce884560cd4ffb45d25429eac6e7748b02b92515435b878ecefdc5b744
|
|
159
|
+
Content-Type:
|
|
160
|
+
- application/x-www-form-urlencoded
|
|
161
|
+
response:
|
|
162
|
+
status:
|
|
163
|
+
code: 201
|
|
164
|
+
message: Created
|
|
165
|
+
headers:
|
|
166
|
+
X-Frame-Options:
|
|
167
|
+
- SAMEORIGIN
|
|
168
|
+
X-Xss-Protection:
|
|
169
|
+
- 1; mode=block
|
|
170
|
+
X-Content-Type-Options:
|
|
171
|
+
- nosniff
|
|
172
|
+
Content-Type:
|
|
173
|
+
- application/json; charset=utf-8
|
|
174
|
+
Etag:
|
|
175
|
+
- W/"37e4b819d2e843dfc999ec163249a53f"
|
|
176
|
+
Cache-Control:
|
|
177
|
+
- max-age=0, private, must-revalidate
|
|
178
|
+
Set-Cookie:
|
|
179
|
+
- _exercises_session=TUd2eDhvNUVSdjVTaXFrQUdXRTVBYUlqdE40UnV0N0ptZXc0SXBYV3BWaW54VVJ4Tzh4RFk5K3ZMUzhIbS9Pd1VoS2N6aWZWeVN6Y0NkRERkMFBwMUE9PS0tbEh6cnlaMUZiSU43Qmx4QXlxeFdOdz09--158b91791d386dbb96fbf65af3db126c7cd9b8f0;
|
|
180
|
+
path=/; HttpOnly
|
|
181
|
+
- request_method=POST; path=/
|
|
182
|
+
X-Request-Id:
|
|
183
|
+
- 3f6b2acd-73bf-434e-a4c9-13cd9d5e8800
|
|
184
|
+
X-Runtime:
|
|
185
|
+
- '0.073191'
|
|
186
|
+
Connection:
|
|
187
|
+
- close
|
|
188
|
+
Server:
|
|
189
|
+
- thin
|
|
190
|
+
body:
|
|
191
|
+
encoding: US-ASCII
|
|
192
|
+
string: ! '{"identifier":"abea60a1e7d41a4bc1e08dac7d5503f2d4d1b980525040ffd0a518ccc56cfa21","resource":"http://exercises.openstax.org/exercises/1234","trial":"2","created_at":"2015-01-12T21:08:53.370Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
|
193
|
+
http_version:
|
|
194
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
|
195
|
+
recorded_with: VCR 2.9.3
|