d2l-valence 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +22 -0
- data/.gitignore +17 -0
- data/.rubocop.yml +13 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +71 -0
- data/LICENSE.txt +22 -0
- data/README.md +266 -0
- data/Rakefile +6 -0
- data/d2l-valence.gemspec +30 -0
- data/lib/d2l/valence.rb +15 -0
- data/lib/d2l/valence/app_context.rb +49 -0
- data/lib/d2l/valence/auth_tokens.rb +60 -0
- data/lib/d2l/valence/encrypt.rb +34 -0
- data/lib/d2l/valence/host.rb +43 -0
- data/lib/d2l/valence/request.rb +104 -0
- data/lib/d2l/valence/response.rb +66 -0
- data/lib/d2l/valence/timestamp_error.rb +42 -0
- data/lib/d2l/valence/user_context.rb +58 -0
- data/lib/d2l/valence/version.rb +5 -0
- data/spec/d2l/valence/app_context_spec.rb +14 -0
- data/spec/d2l/valence/auth_tokens_spec.rb +30 -0
- data/spec/d2l/valence/host_spec.rb +64 -0
- data/spec/d2l/valence/request/authenticated_uri_spec.rb +75 -0
- data/spec/d2l/valence/request/execute/invalid_time_stamp_spec.rb +40 -0
- data/spec/d2l/valence/request/execute/lti_links/create_spec.rb +66 -0
- data/spec/d2l/valence/request/execute/lti_links/delete_spec.rb +39 -0
- data/spec/d2l/valence/request/execute/lti_links/list_spec.rb +41 -0
- data/spec/d2l/valence/request/execute/lti_links/update_spec.rb +73 -0
- data/spec/d2l/valence/request/execute/lti_links/view_spec.rb +41 -0
- data/spec/d2l/valence/request/execute/version_spec.rb +41 -0
- data/spec/d2l/valence/request/execute/whoami_spec.rb +40 -0
- data/spec/d2l/valence/response/code_spec.rb +34 -0
- data/spec/d2l/valence/response/server_skew_spec.rb +33 -0
- data/spec/d2l/valence/timestamp_error_spec.rb +21 -0
- data/spec/d2l/valence/user_context_spec.rb +6 -0
- data/spec/fixtures/vcr_cassettes/request/execute/create_lti_link.yml +71 -0
- data/spec/fixtures/vcr_cassettes/request/execute/delete_lti_link.yml +48 -0
- data/spec/fixtures/vcr_cassettes/request/execute/get_a_lti_link.yml +66 -0
- data/spec/fixtures/vcr_cassettes/request/execute/get_lti_links.yml +70 -0
- data/spec/fixtures/vcr_cassettes/request/execute/get_version.yml +66 -0
- data/spec/fixtures/vcr_cassettes/request/execute/get_whoami.yml +61 -0
- data/spec/fixtures/vcr_cassettes/request/execute/invalid_timestamp.yml +112 -0
- data/spec/fixtures/vcr_cassettes/request/execute/put_lti_link.yml +139 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/support/common_context.rb +37 -0
- metadata +228 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://partners.brightspace.com/d2l/api/versions/?x_a=api_id&x_b=user_id&x_c=GdcQFJmFI1iiwVX-rTAAdg_Rad00fsn8A-3cnbZ8Pls&x_d=Cnf1ERnqaasNkJ3tKGt3EclnIjfSd7Q7-Ygi2VfMB_M&x_t=1491960243
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.1 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
16
|
+
Host:
|
17
|
+
- partners.brightspace.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache, no-store
|
25
|
+
Pragma:
|
26
|
+
- no-cache
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=UTF-8
|
29
|
+
Content-Encoding:
|
30
|
+
- gzip
|
31
|
+
Expires:
|
32
|
+
- "-1"
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Server:
|
36
|
+
- Microsoft-IIS/7.5
|
37
|
+
Access-Control-Allow-Origin:
|
38
|
+
- "*"
|
39
|
+
Access-Control-Allow-Credentials:
|
40
|
+
- 'false'
|
41
|
+
Access-Control-Expose-Headers:
|
42
|
+
- Content-Disposition,Content-Length,Content-Type,Accept-Ranges,Content-Range,Date
|
43
|
+
X-Powered-By:
|
44
|
+
- ASP.NET
|
45
|
+
X-Xss-Protection:
|
46
|
+
- '0'
|
47
|
+
Date:
|
48
|
+
- Wed, 12 Apr 2017 01:24:04 GMT
|
49
|
+
Content-Length:
|
50
|
+
- '427'
|
51
|
+
body:
|
52
|
+
encoding: ASCII-8BIT
|
53
|
+
string: !binary |-
|
54
|
+
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
|
55
|
+
kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
|
56
|
+
AWz2zkrayZ4hgKrIHz9+fB8/Ir73iz96WVez9bQ9qWb5R48+mmTNR6OPnmdt
|
57
|
+
3rQ/mddNUS3p093xDn36er1aVXWbz/SL5qNH3+Ovvv9LRl04T4rlLK9PqmWb
|
58
|
+
L1t698MhTtdNWy2KH2QtNaR3+xD36NNBiCP6d5f/3bsR+u8/rdZ1k0/qbDkr
|
59
|
+
lhfZqqAX+/0B3A393djTIluV+Ztjat6HDyCD8COQ8xW90AWzN75Pn0bB7BGY
|
60
|
+
Ef2LcewRWfDvPf53n/+9H+3kXXw68WK0F3wVgVPm9EIfzB66HoADbEFU/Ats
|
61
|
+
ARn/4pVdwhb/fsr/PuB/D/jfh/zvrr4sb+/K67vy/q4A2BUIuwJiV2DsCpBd
|
62
|
+
gbInUPYEyp5A2RMohHlsmLE5IXjo6+dsmBE8n7+iL/t4AsCt0IyALNv3Fpuo
|
63
|
+
wNRxEmI0A2AwE9//fwAUhs6p2wQAAA==
|
64
|
+
http_version:
|
65
|
+
recorded_at: Wed, 12 Apr 2017 01:24:04 GMT
|
66
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://partners.brightspace.com/d2l/api/lp/1.0/users/whoami?x_a=api_id&x_b=user_id&x_c=hTF_WsN31LFqnT1VJkMeSFiW9V-THxKLje7FaHZi0jw&x_d=qtomVAPrzeMWAshx5J_bC2N5_Cl1DKX4N7vML2r9Srg&x_t=1491960098
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.1 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
16
|
+
Host:
|
17
|
+
- partners.brightspace.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache, no-store
|
25
|
+
Pragma:
|
26
|
+
- no-cache
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=UTF-8
|
29
|
+
Content-Encoding:
|
30
|
+
- gzip
|
31
|
+
Expires:
|
32
|
+
- "-1"
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Server:
|
36
|
+
- Microsoft-IIS/7.5
|
37
|
+
Access-Control-Allow-Origin:
|
38
|
+
- "*"
|
39
|
+
Access-Control-Allow-Credentials:
|
40
|
+
- 'false'
|
41
|
+
Access-Control-Expose-Headers:
|
42
|
+
- Content-Disposition,Content-Length,Content-Type,Accept-Ranges,Content-Range,Date
|
43
|
+
X-Powered-By:
|
44
|
+
- ASP.NET
|
45
|
+
X-Xss-Protection:
|
46
|
+
- '0'
|
47
|
+
Date:
|
48
|
+
- Wed, 12 Apr 2017 01:21:39 GMT
|
49
|
+
Content-Length:
|
50
|
+
- '212'
|
51
|
+
body:
|
52
|
+
encoding: ASCII-8BIT
|
53
|
+
string: !binary |-
|
54
|
+
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
|
55
|
+
kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
|
56
|
+
AWz2zkrayZ4hgKrIHz9+fB8/In7xR2ezfNkW50Vef/Too9293Z2PRh89K+qm
|
57
|
+
fZEtcvoof5U3eX2Z79LnzzP78fFsUSyLpq2ztqrpq6+WxS9a5/qleWd8jLde
|
58
|
+
1tV5UeZBR1/+ou8eP314/+H+T330S/4fwzWHaYQAAAA=
|
59
|
+
http_version:
|
60
|
+
recorded_at: Wed, 12 Apr 2017 01:21:40 GMT
|
61
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,112 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://partners.brightspace.com/d2l/api/lp/1.15/users/whoami?x_a=api_id&x_b=user_id&x_c=jzb6idkFNA49R1dfGqUaT16dyhCsbewWy4pwBfl0UUI&x_d=OwRg_VcnY2xw-keVNs7SjBaw_xe5h3nnukj4tFwICRw&x_t=1491940559
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.1 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
16
|
+
Host:
|
17
|
+
- partners.brightspace.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 403
|
21
|
+
message: Forbidden
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache, no-store
|
25
|
+
Pragma:
|
26
|
+
- no-cache
|
27
|
+
Content-Length:
|
28
|
+
- '33'
|
29
|
+
Content-Type:
|
30
|
+
- text/html; charset=utf-8
|
31
|
+
Expires:
|
32
|
+
- "-1"
|
33
|
+
Server:
|
34
|
+
- Microsoft-IIS/7.5
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'false'
|
39
|
+
Access-Control-Expose-Headers:
|
40
|
+
- Content-Disposition,Content-Length,Content-Type,Accept-Ranges,Content-Range,Date
|
41
|
+
X-Powered-By:
|
42
|
+
- ASP.NET
|
43
|
+
X-Xss-Protection:
|
44
|
+
- '0'
|
45
|
+
Date:
|
46
|
+
- Wed, 12 Apr 2017 01:29:20 GMT
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: |-
|
50
|
+
Timestamp out of range
|
51
|
+
1491960561
|
52
|
+
http_version:
|
53
|
+
recorded_at: Tue, 11 Apr 2017 19:56:01 GMT
|
54
|
+
- request:
|
55
|
+
method: get
|
56
|
+
uri: https://partners.brightspace.com/d2l/api/lp/1.15/users/whoami?x_a=api_id&x_b=user_id&x_c=VsD8Qz3x8BSbHUGfgWeOKA-ozx1irUm09upkVOBBm8g&x_d=WR2B8Lu0DZGLXzjH9jEp877-jo9_yWTTBRHVf0iKzjs&x_t=1491960561
|
57
|
+
body:
|
58
|
+
encoding: US-ASCII
|
59
|
+
string: ''
|
60
|
+
headers:
|
61
|
+
Accept:
|
62
|
+
- "*/*"
|
63
|
+
Accept-Encoding:
|
64
|
+
- gzip, deflate
|
65
|
+
User-Agent:
|
66
|
+
- rest-client/2.0.1 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
67
|
+
Host:
|
68
|
+
- partners.brightspace.com
|
69
|
+
response:
|
70
|
+
status:
|
71
|
+
code: 200
|
72
|
+
message: OK
|
73
|
+
headers:
|
74
|
+
Cache-Control:
|
75
|
+
- no-cache, no-store
|
76
|
+
Pragma:
|
77
|
+
- no-cache
|
78
|
+
Content-Type:
|
79
|
+
- application/json; charset=UTF-8
|
80
|
+
Content-Encoding:
|
81
|
+
- gzip
|
82
|
+
Expires:
|
83
|
+
- "-1"
|
84
|
+
Vary:
|
85
|
+
- Accept-Encoding
|
86
|
+
Server:
|
87
|
+
- Microsoft-IIS/7.5
|
88
|
+
Access-Control-Allow-Origin:
|
89
|
+
- "*"
|
90
|
+
Access-Control-Allow-Credentials:
|
91
|
+
- 'false'
|
92
|
+
Access-Control-Expose-Headers:
|
93
|
+
- Content-Disposition,Content-Length,Content-Type,Accept-Ranges,Content-Range,Date
|
94
|
+
X-Powered-By:
|
95
|
+
- ASP.NET
|
96
|
+
X-Xss-Protection:
|
97
|
+
- '0'
|
98
|
+
Date:
|
99
|
+
- Wed, 12 Apr 2017 01:29:21 GMT
|
100
|
+
Content-Length:
|
101
|
+
- '212'
|
102
|
+
body:
|
103
|
+
encoding: ASCII-8BIT
|
104
|
+
string: !binary |-
|
105
|
+
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
|
106
|
+
kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
|
107
|
+
AWz2zkrayZ4hgKrIHz9+fB8/In7xR2ezfNkW50Vef/Too9293Z2PRh89K+qm
|
108
|
+
fZEtcvoof5U3eX2Z79LnzzP78fFsUSyLpq2ztqrpq6+WxS9a5/qleWd8jLde
|
109
|
+
1tV5UeZBR1/+ou8eP314/+H+T330S/4fwzWHaYQAAAA=
|
110
|
+
http_version:
|
111
|
+
recorded_at: Tue, 11 Apr 2017 19:56:02 GMT
|
112
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,139 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://partners.brightspace.com/d2l/api/le/1.15/lti/link/8041?x_a=api_id&x_b=user_id&x_c=KH_X3X59yfk7bnuhN3Hjw6oZOzgA_cWFteRvvj6VU04&x_d=ewCokxFvZh4CcRgvwi3plbogovM-3KfLDLCbV58ZGMo&x_t=1491961066
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"Title":"The wrong title","Url":"http://myapplication.com/tool/launch","Description":"Link
|
9
|
+
for external tool","Key":"2015141297208","PlainSecret":"a30be7c3550149b7a7daac3065f0e5e5","IsVisible":false,"SignMessage":true,"SignWithTc":true,"SendTcInfo":true,"SendContextInfo":true,"SendUserId":true,"SendUserName":true,"SendUserEmail":true,"SendLinkTitle":true,"SendLinkDescription":true,"SendD2LUserName":true,"SendD2LOrgDefinedId":true,"SendD2LOrgRoleId":true,"UseToolProviderSecuritySettings":true,"CustomParameters":null}'
|
10
|
+
headers:
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip, deflate
|
15
|
+
User-Agent:
|
16
|
+
- rest-client/2.0.1 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
Content-Length:
|
20
|
+
- '522'
|
21
|
+
Host:
|
22
|
+
- partners.brightspace.com
|
23
|
+
response:
|
24
|
+
status:
|
25
|
+
code: 200
|
26
|
+
message: OK
|
27
|
+
headers:
|
28
|
+
Cache-Control:
|
29
|
+
- no-cache, no-store
|
30
|
+
Pragma:
|
31
|
+
- no-cache
|
32
|
+
Content-Type:
|
33
|
+
- application/json; charset=UTF-8
|
34
|
+
Content-Encoding:
|
35
|
+
- gzip
|
36
|
+
Expires:
|
37
|
+
- "-1"
|
38
|
+
Vary:
|
39
|
+
- Accept-Encoding
|
40
|
+
Server:
|
41
|
+
- Microsoft-IIS/7.5
|
42
|
+
Access-Control-Allow-Origin:
|
43
|
+
- "*"
|
44
|
+
Access-Control-Allow-Credentials:
|
45
|
+
- 'false'
|
46
|
+
Access-Control-Expose-Headers:
|
47
|
+
- Content-Disposition,Content-Length,Content-Type,Accept-Ranges,Content-Range,Date
|
48
|
+
X-Powered-By:
|
49
|
+
- ASP.NET
|
50
|
+
X-Xss-Protection:
|
51
|
+
- '0'
|
52
|
+
Date:
|
53
|
+
- Wed, 12 Apr 2017 01:37:47 GMT
|
54
|
+
Content-Length:
|
55
|
+
- '422'
|
56
|
+
body:
|
57
|
+
encoding: ASCII-8BIT
|
58
|
+
string: !binary |-
|
59
|
+
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
|
60
|
+
kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
|
61
|
+
AWz2zkrayZ4hgKrIHz9+fB8/In7xR181+ZuqKl/W1WUxy+vX+XRdF+3167xt
|
62
|
+
i+VF89Gjtl7no4+et8XzYvn2bPbRo939/Yf39kYffVlffLUsWnx0sLO/O/ro
|
63
|
+
TdGW+UePPnozz9OrulpepC1/Mvroq7qkz+dtu3p09+7iOlutymKatUW1HE+r
|
64
|
+
xd2WELhbZuvldE6Nn+bNtC5W+JZeQq/peVWn+bs2r5dZmaI1Nfu98mv6em9n
|
65
|
+
9/7u/u7ewwd7Owf06Vnzk0VTTKjXR+dZ2RDmr4uL5Rd502QX9JkMBh99t2jn
|
66
|
+
b6b2k3w5ezM9W55X7j366KRattRv73MiWo1xdz56kS2oj86Hp4usoNF7n2JI
|
67
|
+
SqvOp8HQve+e7j0HqB58+pxm4Wl+XizzWQch+e5VVebeFyfrpq0WL7OaIBE5
|
68
|
+
aXq/9/1f8v8A03m4bwUCAAA=
|
69
|
+
http_version:
|
70
|
+
recorded_at: Wed, 12 Apr 2017 01:37:47 GMT
|
71
|
+
- request:
|
72
|
+
method: put
|
73
|
+
uri: https://partners.brightspace.com/d2l/api/le/1.15/lti/link/144932?x_a=api_id&x_b=user_id&x_c=0H7TNX-YBSawGbzPULlqX5chiizIV8Ku1HE46RbfIdg&x_d=3-JZ8zQH68QKX6fAejl3R4ES5jxP9fBR6aON3VIfc7s&x_t=1491961067
|
74
|
+
body:
|
75
|
+
encoding: UTF-8
|
76
|
+
string: '{"Title":"LTI Link","Url":"http://myapplication.com/tool/launch","Description":"Link
|
77
|
+
for external tool","Key":"2015141297208","PlainSecret":"a30be7c3550149b7a7daac3065f0e5e5","IsVisible":false,"SignMessage":true,"SignWithTc":true,"SendTcInfo":true,"SendContextInfo":true,"SendUserId":true,"SendUserName":true,"SendUserEmail":true,"SendLinkTitle":true,"SendLinkDescription":true,"SendD2LUserName":true,"SendD2LOrgDefinedId":true,"SendD2LOrgRoleId":true,"UseToolProviderSecuritySettings":true,"CustomParameters":null}'
|
78
|
+
headers:
|
79
|
+
Accept:
|
80
|
+
- "*/*"
|
81
|
+
Accept-Encoding:
|
82
|
+
- gzip, deflate
|
83
|
+
User-Agent:
|
84
|
+
- rest-client/2.0.1 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
85
|
+
Content-Type:
|
86
|
+
- application/json
|
87
|
+
Content-Length:
|
88
|
+
- '515'
|
89
|
+
Host:
|
90
|
+
- partners.brightspace.com
|
91
|
+
response:
|
92
|
+
status:
|
93
|
+
code: 200
|
94
|
+
message: OK
|
95
|
+
headers:
|
96
|
+
Cache-Control:
|
97
|
+
- no-cache, no-store
|
98
|
+
Pragma:
|
99
|
+
- no-cache
|
100
|
+
Content-Type:
|
101
|
+
- application/json; charset=UTF-8
|
102
|
+
Content-Encoding:
|
103
|
+
- gzip
|
104
|
+
Expires:
|
105
|
+
- "-1"
|
106
|
+
Vary:
|
107
|
+
- Accept-Encoding
|
108
|
+
Server:
|
109
|
+
- Microsoft-IIS/7.5
|
110
|
+
Access-Control-Allow-Origin:
|
111
|
+
- "*"
|
112
|
+
Access-Control-Allow-Credentials:
|
113
|
+
- 'false'
|
114
|
+
Access-Control-Expose-Headers:
|
115
|
+
- Content-Disposition,Content-Length,Content-Type,Accept-Ranges,Content-Range,Date
|
116
|
+
X-Powered-By:
|
117
|
+
- ASP.NET
|
118
|
+
X-Xss-Protection:
|
119
|
+
- '0'
|
120
|
+
Date:
|
121
|
+
- Wed, 12 Apr 2017 01:37:48 GMT
|
122
|
+
Content-Length:
|
123
|
+
- '416'
|
124
|
+
body:
|
125
|
+
encoding: ASCII-8BIT
|
126
|
+
string: !binary |-
|
127
|
+
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
|
128
|
+
kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
|
129
|
+
AWz2zkrayZ4hgKrIHz9+fB8/In7xR181+ZuqKl/W1WUxy+vX+XRdF+3167xt
|
130
|
+
i+VF89Gjtl7no4+et8XzYvn2bPbRo939/Yf39kYffVlffLUsWnx0sLO/O/ro
|
131
|
+
TdGW+UePPnr+5ixF449GH31Vl/TBvG1Xj+7eXVxnq1VZTLO2qJbjabW421LP
|
132
|
+
d8tsvZzOqfHTvJnWxQrf0kuAkJ5XdZq/a/N6mZUpWlOz3yu/pq/3dnbv7+7v
|
133
|
+
7j18sLdzQJ+eNT9ZNMUECJxnZUMovy4ull/kTZNd0GcyCnz03aKdv5naT/Ll
|
134
|
+
7M30bHleuffoo5Nq2VK/vc+JWjUG3PnoRbagPjofni6ygkbvfYohKZE6nwZD
|
135
|
+
9757uvccoHrw6XMi/9P8vFjmsw5C8t2rqsy9L07WTVstXmY1QSJy0rx+7/u/
|
136
|
+
5P8BDstBOf4BAAA=
|
137
|
+
http_version:
|
138
|
+
recorded_at: Wed, 12 Apr 2017 01:37:48 GMT
|
139
|
+
recorded_with: VCR 3.0.3
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'd2l/valence'
|
2
|
+
require 'rspec'
|
3
|
+
require 'rspec/its'
|
4
|
+
require 'vcr'
|
5
|
+
require 'webmock/rspec'
|
6
|
+
require 'timecop'
|
7
|
+
|
8
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each {|f| require f }
|
9
|
+
|
10
|
+
VCR.configure do |c|
|
11
|
+
c.ignore_localhost = true
|
12
|
+
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
13
|
+
c.hook_into :webmock
|
14
|
+
c.configure_rspec_metadata!
|
15
|
+
c.allow_http_connections_when_no_cassette = true
|
16
|
+
c.filter_sensitive_data('api_id') { ENV['D2L_API_ID'] }
|
17
|
+
c.filter_sensitive_data('api_key') { ENV['D2L_API_KEY'] }
|
18
|
+
c.filter_sensitive_data('user_id') { ENV['D2L_USER_ID'] }
|
19
|
+
c.filter_sensitive_data('user_id') { ENV['D2L_USER_KEY'] }
|
20
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
shared_context :common_context do
|
2
|
+
let(:app_id) { ENV['D2L_API_ID'] }
|
3
|
+
let(:app_key) { ENV['D2L_API_KEY'] }
|
4
|
+
let(:auth_host) { D2L::Valence::Host.new(scheme: :https, host: 'partners.brightspace.com') }
|
5
|
+
let(:api_version) { '1.0'}
|
6
|
+
let(:app_context) do
|
7
|
+
D2L::Valence::AppContext.new(
|
8
|
+
brightspace_host: auth_host,
|
9
|
+
app_id: app_id,
|
10
|
+
app_key: app_key,
|
11
|
+
api_version: api_version
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:auth_token_parameters) do
|
16
|
+
[
|
17
|
+
D2L::Valence::AuthTokens::APP_ID_PARAM,
|
18
|
+
D2L::Valence::AuthTokens::SIGNATURE_BY_APP_KEY_PARAM,
|
19
|
+
D2L::Valence::AuthTokens::USER_ID_PARAM,
|
20
|
+
D2L::Valence::AuthTokens::SIGNATURE_BY_USER_KEY_PARAM,
|
21
|
+
D2L::Valence::AuthTokens::TIMESTAMP_PARAM
|
22
|
+
]
|
23
|
+
end
|
24
|
+
|
25
|
+
let(:callback_uri) { URI('https://apitesttool.desire2learnvalence.com/index.php') }
|
26
|
+
let(:auth_key) { D2L::Valence::Encrypt.generate_from(app_key, callback_uri.to_s) }
|
27
|
+
|
28
|
+
let(:user_context) do
|
29
|
+
D2L::Valence::UserContext.new(
|
30
|
+
app_context: app_context,
|
31
|
+
user_id: user_id,
|
32
|
+
user_key: user_key
|
33
|
+
)
|
34
|
+
end
|
35
|
+
let(:user_id) { '3' }
|
36
|
+
let(:user_key) { 'Vi9NYNbK-l3L' }
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: d2l-valence
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Harrison
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.4.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.4.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-its
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.2.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.0.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.0.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.0.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.0.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: timecop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.8.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.8.1
|
125
|
+
description: '["A", "Ruby", "client", "for", "Desire2Learn''s", "Valence", "Learning",
|
126
|
+
"Framework", "APIs", "primarily", "used", "for", "integration", "with", "D2L", "Brightspace"]'
|
127
|
+
email:
|
128
|
+
- michael@ereserve.com.au
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".codeclimate.yml"
|
134
|
+
- ".gitignore"
|
135
|
+
- ".rubocop.yml"
|
136
|
+
- Gemfile
|
137
|
+
- Gemfile.lock
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- d2l-valence.gemspec
|
142
|
+
- lib/d2l/valence.rb
|
143
|
+
- lib/d2l/valence/app_context.rb
|
144
|
+
- lib/d2l/valence/auth_tokens.rb
|
145
|
+
- lib/d2l/valence/encrypt.rb
|
146
|
+
- lib/d2l/valence/host.rb
|
147
|
+
- lib/d2l/valence/request.rb
|
148
|
+
- lib/d2l/valence/response.rb
|
149
|
+
- lib/d2l/valence/timestamp_error.rb
|
150
|
+
- lib/d2l/valence/user_context.rb
|
151
|
+
- lib/d2l/valence/version.rb
|
152
|
+
- spec/d2l/valence/app_context_spec.rb
|
153
|
+
- spec/d2l/valence/auth_tokens_spec.rb
|
154
|
+
- spec/d2l/valence/host_spec.rb
|
155
|
+
- spec/d2l/valence/request/authenticated_uri_spec.rb
|
156
|
+
- spec/d2l/valence/request/execute/invalid_time_stamp_spec.rb
|
157
|
+
- spec/d2l/valence/request/execute/lti_links/create_spec.rb
|
158
|
+
- spec/d2l/valence/request/execute/lti_links/delete_spec.rb
|
159
|
+
- spec/d2l/valence/request/execute/lti_links/list_spec.rb
|
160
|
+
- spec/d2l/valence/request/execute/lti_links/update_spec.rb
|
161
|
+
- spec/d2l/valence/request/execute/lti_links/view_spec.rb
|
162
|
+
- spec/d2l/valence/request/execute/version_spec.rb
|
163
|
+
- spec/d2l/valence/request/execute/whoami_spec.rb
|
164
|
+
- spec/d2l/valence/response/code_spec.rb
|
165
|
+
- spec/d2l/valence/response/server_skew_spec.rb
|
166
|
+
- spec/d2l/valence/timestamp_error_spec.rb
|
167
|
+
- spec/d2l/valence/user_context_spec.rb
|
168
|
+
- spec/fixtures/vcr_cassettes/request/execute/create_lti_link.yml
|
169
|
+
- spec/fixtures/vcr_cassettes/request/execute/delete_lti_link.yml
|
170
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_a_lti_link.yml
|
171
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_lti_links.yml
|
172
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_version.yml
|
173
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_whoami.yml
|
174
|
+
- spec/fixtures/vcr_cassettes/request/execute/invalid_timestamp.yml
|
175
|
+
- spec/fixtures/vcr_cassettes/request/execute/put_lti_link.yml
|
176
|
+
- spec/spec_helper.rb
|
177
|
+
- spec/support/common_context.rb
|
178
|
+
homepage: ''
|
179
|
+
licenses:
|
180
|
+
- MIT
|
181
|
+
metadata: {}
|
182
|
+
post_install_message:
|
183
|
+
rdoc_options: []
|
184
|
+
require_paths:
|
185
|
+
- lib
|
186
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: '0'
|
196
|
+
requirements: []
|
197
|
+
rubyforge_project:
|
198
|
+
rubygems_version: 2.5.2
|
199
|
+
signing_key:
|
200
|
+
specification_version: 4
|
201
|
+
summary: '["D2L", "Valence", "Learning", "Framework", "API", "client", "for", "Ruby"]'
|
202
|
+
test_files:
|
203
|
+
- spec/d2l/valence/app_context_spec.rb
|
204
|
+
- spec/d2l/valence/auth_tokens_spec.rb
|
205
|
+
- spec/d2l/valence/host_spec.rb
|
206
|
+
- spec/d2l/valence/request/authenticated_uri_spec.rb
|
207
|
+
- spec/d2l/valence/request/execute/invalid_time_stamp_spec.rb
|
208
|
+
- spec/d2l/valence/request/execute/lti_links/create_spec.rb
|
209
|
+
- spec/d2l/valence/request/execute/lti_links/delete_spec.rb
|
210
|
+
- spec/d2l/valence/request/execute/lti_links/list_spec.rb
|
211
|
+
- spec/d2l/valence/request/execute/lti_links/update_spec.rb
|
212
|
+
- spec/d2l/valence/request/execute/lti_links/view_spec.rb
|
213
|
+
- spec/d2l/valence/request/execute/version_spec.rb
|
214
|
+
- spec/d2l/valence/request/execute/whoami_spec.rb
|
215
|
+
- spec/d2l/valence/response/code_spec.rb
|
216
|
+
- spec/d2l/valence/response/server_skew_spec.rb
|
217
|
+
- spec/d2l/valence/timestamp_error_spec.rb
|
218
|
+
- spec/d2l/valence/user_context_spec.rb
|
219
|
+
- spec/fixtures/vcr_cassettes/request/execute/create_lti_link.yml
|
220
|
+
- spec/fixtures/vcr_cassettes/request/execute/delete_lti_link.yml
|
221
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_a_lti_link.yml
|
222
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_lti_links.yml
|
223
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_version.yml
|
224
|
+
- spec/fixtures/vcr_cassettes/request/execute/get_whoami.yml
|
225
|
+
- spec/fixtures/vcr_cassettes/request/execute/invalid_timestamp.yml
|
226
|
+
- spec/fixtures/vcr_cassettes/request/execute/put_lti_link.yml
|
227
|
+
- spec/spec_helper.rb
|
228
|
+
- spec/support/common_context.rb
|