зеркало из https://github.com/github/codeql.git
Ruby: rack - rename App as RackApplication
This commit is contained in:
Родитель
de6547341f
Коммит
b67b80ca2a
|
@ -128,7 +128,7 @@ module Request {
|
|||
private import codeql.ruby.frameworks.Rack
|
||||
|
||||
private class RackEnv extends Env {
|
||||
RackEnv() { this = any(Rack::App::App app).getEnv().getALocalUse() }
|
||||
RackEnv() { this = any(Rack::App::RackApplication app).getEnv().getALocalUse() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -93,7 +93,7 @@ module App {
|
|||
* taking a single argument and returns a rack response, or a lambda or
|
||||
* proc that takes a single `env` argument and returns a rack response.
|
||||
*/
|
||||
abstract class App extends TApp {
|
||||
abstract class RackApplication extends TApp {
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { result = "Rack application" }
|
||||
|
||||
|
@ -112,11 +112,11 @@ module App {
|
|||
* an instance method or a singleton method named "call" which takes a
|
||||
* single `env` argument and returns a rack response.
|
||||
*/
|
||||
private class ClassApp extends TApp, App {
|
||||
private class ClassRackApplication extends TApp, RackApplication {
|
||||
private DataFlow::ClassNode cn;
|
||||
private CallNode call;
|
||||
|
||||
ClassApp() {
|
||||
ClassRackApplication() {
|
||||
this = TClassApp(cn, call) and
|
||||
call = [cn.getInstanceMethod("call"), cn.getSingletonMethod("call")]
|
||||
}
|
||||
|
@ -130,10 +130,10 @@ module App {
|
|||
* A rack application that is either a lambda or a proc, which takes a
|
||||
* single `env` argument and returns a rack response.
|
||||
*/
|
||||
private class AnonymousApp extends TApp, App {
|
||||
private class AnonymousRackApplication extends TApp, RackApplication {
|
||||
private CallNode call;
|
||||
|
||||
AnonymousApp() {
|
||||
AnonymousRackApplication() {
|
||||
this = TAnonymousApp(call) and
|
||||
not exists(DataFlow::ClassNode cn |
|
||||
call = [cn.getInstanceMethod(_), cn.getSingletonMethod(_)]
|
||||
|
|
|
@ -91,7 +91,7 @@ module Public {
|
|||
/** A `DataFlow::Node` returned from a rack request. */
|
||||
class ResponseNode extends Http::Server::HttpResponse::Range instanceof Private::PotentialResponseNode
|
||||
{
|
||||
ResponseNode() { this = any(A::App::App app).getAResponse() }
|
||||
ResponseNode() { this = any(A::App::RackApplication app).getAResponse() }
|
||||
|
||||
override DataFlow::Node getBody() { result = this.(Private::PotentialResponseNode).getBody() }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ private import codeql.ruby.frameworks.Rack
|
|||
private import codeql.ruby.DataFlow
|
||||
|
||||
query predicate rackApps(
|
||||
Rack::App::App app, DataFlow::ParameterNode env, Rack::Response::ResponseNode resp
|
||||
Rack::App::RackApplication app, DataFlow::ParameterNode env, Rack::Response::ResponseNode resp
|
||||
) {
|
||||
env = app.getEnv() and resp = app.getAResponse()
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче