Commit Graph

5 Commits

Author SHA1 Message Date
Alex Slaughter 85108b92ba move inst_access to gem
This moves the inst_access gem to the public repo and references
the now published inst_access gem instead.

Github:
https://github.com/instructure/inst_access

Rubygems.org:
https://rubygems.org/gems/inst_access

Test Plan:
 - Specs pass

flag = none

Change-Id: I6002b118723e5a329202085a6c649a857e34d0e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277527
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-05 19:47:46 +00:00
August Thornton bc6a684750 prefer active user if matching uuid for InstAccess tokens
Prefer local users with a caveat. in case there are user merge
artifacts left behind with matching uuids we can prefer a local
user record object, BUT it could be in a deleted state, instead
we want to only look up active user record objects as we can
count on shadow records getting updated properly on workflow
state changes.

fixes FOO-2424
refs FOO-2374
flag = none

test plan:
 • have a user-merge occur x-shard
 • visit an api-gateway mediated pathway like account notifications
 • the correct _active_ shard-local user should be loaded as the
   proper auth context

Change-Id: I7d7e53663cd34e3d016863b1d04f34a562c2dcbe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275897
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-10-14 14:35:24 +00:00
Michael Ziwisky cf4da290e3 don't blow up when InstAccess::Token contains a bad user_uuid
fixes INTEROP-7105

test plan:
 - create an InstAccess::Token for a bogus user, e.g. in a rails
   console:
   > InstAccess::Token.for_user(user_uuid: 'bogus', account_uuid: 'whatever').to_unencrypted_token_string

 - try to use that token to query the subgraph, e.g.:
   $ curl http://localhost:3000/api/graphql/subgraph \
     -v \
     -X POST \
     -H "Accept: application/json" \
     -H "Content-type: application/json" \
     -H "Authorization: Bearer $INST_ACCESS" \
     --data '{ "query": "{ allCourses { name } }" }'

 - notice the response is a 401, not a 500

Change-Id: Ia303ce2a233d3bc3b4e30358ac71f19bb360a091
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275785
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-10-13 16:06:40 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Ethan Vizitei 9aaf1106fc InstAccess Tokens should prefer shard-local users
closes FOO-2368

TEST PLAN:
  1) have a user-merge occur x-shard
  2) visit an api-gateway mediated pathway
     like account notifications
  3) correct shard-local user should always be loaded
     as auth context

Change-Id: I2dfb86ec35499e9a00ebb8498c4eab9c6c95297e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273451
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-09-13 22:23:38 +00:00