fixes CNVS-11424
test plan:
- rake db:migrate
- if you don't already have one, set yourself up with a developer token.
(you can do so from <canvas>/developer_keys)
- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
-X GET -F 'ns=test' \
<canvas>/api/v1/users/self/custom_data
#=> {"message":"no data for scope"}
- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
-X PUT -F 'ns=test' \
-F 'data[apple]=so tasty' \
-F 'data[kiwi]=a bit sour' \
<canvas>/api/v1/users/self/custom_data/fruit
#=> {"data":{"apple":"so tasty","kiwi":"a bit sour"}}
- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
-X GET -F 'ns=test' \
<canvas>/api/v1/users/self/custom_data
#=> {"data":{"fruit":{"apple":"so tasty","kiwi":"a bit sour"}}}
- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
-X DELETE -F 'ns=test' \
<canvas>/api/v1/users/self/custom_data/fruit/kiwi
#=> {"data":"a bit sour"}
- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
-X GET -F 'ns=test' \
<canvas>/api/v1/users/self/custom_data
#=> {"data":{"fruit":{"apple":"so tasty"}}}
- see new API doc for more info about how it should work, but
basically, you should be able to GET, PUT, and DELETE at will
for any given scope, and PUTting JSON hashes creates referenceable
scopes. (e.g. the DELETE above has 'kiwi' in its scope)
Change-Id: If027ae4aeec14edf44275ba0372a68aef7e5600e
Reviewed-on: https://gerrit.instructure.com/31173
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>