Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: Model the Pyramid framework #16300
Python: Model the Pyramid framework #16300
Changes from 2 commits
88e3227
f85ee38
86d1e5b
2a04598
7df8b1b
ba054bd
4f22b91
c6372d5
fd55713
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 23 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a hard requirement that the request parameter MUST be called
request
? or could it be namedreq
as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation suggests that it should:
however empirical testing seems to show it can allow other names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, let's include that in our tests, and let's change our modeling to handle that 👍
Check warning on line 41 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for a route like
/hello/<name>
that is handled bydef handle_hello(request, name): ...
the<name>
is a routed parameter. I haven't looked at the pyramid docs whether this is something they do, but that's sort of what it's for.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think pyramid has parameters like that (instead
name
would be in amatchdict
object on therequest
.Should the
request
parameter be modeled as a remote flow source separately from this then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please 👍
Check warning on line 65 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc
Check warning on line 82 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc
Check warning on line 85 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc
Check warning on line 89 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc
Check warning on line 90 in python/ql/lib/semmle/python/frameworks/Pyramid.qll
GitHub Actions / qldoc