Change-Id: I70825be7ec7e24458afe0c63dc48c5a76158f520
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
use unique_constraint_retry when creating record
and lock! around setting/removing data
closes #ADMIN-2819
Change-Id: If34c9f547e586107bf001bd18d0f94d14b9b8b18
Reviewed-on: https://gerrit.instructure.com/204450
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
refs #CNVS-32574
Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
write_attribute returns the original object but not
the actual stored object anymore
refs #CNVS-26056
Change-Id: I3f602a9060daf244d3c90f89286f571e804f43f0
Reviewed-on: https://gerrit.instructure.com/69498
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
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>