canvas-lms/lib/app_center
August Thornton 5e6986b19e set the appropriate app center token by context
this bug fix will address setting the app center token
if one is explicitly set at the current context else
it will look up it's account chain. if there isn't one
explicitley set up the account chain it will use the
root_account's configured app_center plugin setting token

fixes PLAT-3698
refs PLAT-3598

test plan:
 - create two organizations and generate an api token for each
   within eduappcenter
 - for the first organization generate a visible whitelist of
   apps
 - for the second organization generate a visible whitelist of
   apps that includes an app that is not included within the
   first organization's whitelist
 - configure your canvas instance to talk with app center
   via plugin settings and use the first organization's
   api token
 - within your canvas root account settings --> apps
   check to make sure the external apps get populated that were
   included within the first organization's whitelist
 - create a sub-account and within settings --> apps
   click on |Manage App List| button and input the second
   organization's api token
 - verify the external apps that were whitelisted for the second
   organization appear
 - attempt to install an app that appears in the sub-account app
   listing, but does not appear in the root account's app listing
 - it should install without error
 - verify both account and course context app centers are populated
   with whitelisted apps pertaining to the token's organization in
   eduappcenter and allow for specific apps to be installed
 - lastly set an explicit root account token, and unset any sub-account
   tokens
   - ensure the root account's plugin setting for the app center
     is using a different token than the explicitly set root account token
   - verify the sub-account inherits the set root account's
     whitelist and not the whitelist from the plugin setting token

Change-Id: If7de1fb5952993371fe366d8fe5192228219be44
Reviewed-on: https://gerrit.instructure.com/162450
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-08-30 21:16:39 +00:00
..
app_api.rb set the appropriate app center token by context 2018-08-30 21:16:39 +00:00