Skip to content

Commit

Permalink
Request stringified IDs from Canvas
Browse files Browse the repository at this point in the history
Shard-qualified IDs can get too large for JS to represent as numeric,
and it does weird things in this scenario

closes MAT-921
flag=none

test plan
- Find an RCE
- Insert -> Document -> Coures Documents
- Switch to "All" view
* In Network Inspector, verify that the IDs that come back on the requests to the
Folders API are strings

It's not really possible to repro the production issue locally due to
highly specific requirements on shard ID; we will have to validate in

Change-Id: I7cf95e087bf513a12cae1a7ae1870e8fe76fc13b
Reviewed-on: https://gerrit.instructure.com/c/canvas-rce-api/+/303763
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Joe Hernandez <[email protected]>
QA-Review: Joe Hernandez <[email protected]>
Product-Review: Jon Scheiding <[email protected]>
  • Loading branch information
Jon Scheiding committed Oct 25, 2022
1 parent 7ec2263 commit d8c2d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ docker-compose.override.yml
coverage/
.nyc_output/
.env
.vscode
3 changes: 2 additions & 1 deletion app/api/canvasProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function requestHeaders(tokenString, req) {
Authorization: "Bearer " + tokenString,
"User-Agent": req.get("User-Agent"),
"X-Request-Context-Id": Buffer.from(req.id).toString("base64"),
"X-Request-Context-Signature": reqIdSignature
"X-Request-Context-Signature": reqIdSignature,
Accept: "application/json+canvas-string-ids"
};
}

Expand Down

0 comments on commit d8c2d04

Please sign in to comment.