Refactor Grape framework to be encapsulated properly in Module

This commit is contained in:
Chad Bentz
2025-09-19 19:06:50 -04:00
parent 89e9ee43c0
commit f4bbbc346f
2 changed files with 285 additions and 279 deletions

View File

@@ -3,20 +3,20 @@ import codeql.ruby.frameworks.Grape
import codeql.ruby.Concepts
import codeql.ruby.AST
query predicate grapeApiClasses(GrapeApiClass api) { any() }
query predicate grapeApiClasses(Grape::GrapeApiClass api) { any() }
query predicate grapeEndpoints(GrapeApiClass api, GrapeEndpoint endpoint, string method, string path) {
query predicate grapeEndpoints(Grape::GrapeApiClass api, Grape::GrapeEndpoint endpoint, string method, string path) {
endpoint = api.getAnEndpoint() and
method = endpoint.getHttpMethod() and
path = endpoint.getPath()
}
query predicate grapeParams(GrapeParamsSource params) { any() }
query predicate grapeParams(Grape::GrapeParamsSource params) { any() }
query predicate grapeHeaders(GrapeHeadersSource headers) { any() }
query predicate grapeHeaders(Grape::GrapeHeadersSource headers) { any() }
query predicate grapeRequest(GrapeRequestSource request) { any() }
query predicate grapeRequest(Grape::GrapeRequestSource request) { any() }
query predicate grapeRouteParam(GrapeRouteParamSource routeParam) { any() }
query predicate grapeRouteParam(Grape::GrapeRouteParamSource routeParam) { any() }
query predicate grapeCookies(GrapeCookiesSource cookies) { any() }
query predicate grapeCookies(Grape::GrapeCookiesSource cookies) { any() }