Skip to content

Commit

Permalink
Explicitly list the authorization routes that use a query parameter
Browse files Browse the repository at this point in the history
While a bit more verbose it's more explicit and more "grep-able" while
looking for code related to one particular route.
  • Loading branch information
marcospri committed May 9, 2024
1 parent 3905b57 commit 749c827
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lms/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ def get_policy(request: Request):
# LTIUser serialized in the state param for the oauth flow
return OAuthCallbackLTIUserPolicy()

if (path.startswith("/api") and path.endswith("authorize")) or path in {
if path in {
# LTUser serialized as query param for authorization failures
"/api/d2l/oauth/authorize",
"/api/blackboard/oauth/authorize",
"/api/canvas/oauth/authorize",
"/api/canvas_studio/oauth/authorize",
# To fetch pages content from LMSes' APIs
"/api/canvas/pages/proxy",
"/api/moodle/pages/proxy",
Expand Down

0 comments on commit 749c827

Please sign in to comment.