|
| 1 | +/** |
| 2 | + * Provides classes and predicates related to `ratpack.http.*`. |
| 3 | + */ |
| 4 | + |
| 5 | +import java |
| 6 | + |
| 7 | +/** |
| 8 | + * The interface `ratpack.http.Request`. |
| 9 | + * https://ratpack.io/manual/current/api/ratpack/http/Request.html |
| 10 | + */ |
| 11 | +library class RatpackRequest extends RefType { |
| 12 | + RatpackRequest() { hasQualifiedName("ratpack.http", "Request") } |
| 13 | +} |
| 14 | + |
| 15 | +/** |
| 16 | + * Methods on `ratpack.http.Request` that return user tainted data. |
| 17 | + */ |
| 18 | +library class RatpackHttpRequestGetMethod extends Method { |
| 19 | + RatpackHttpRequestGetMethod() { |
| 20 | + getDeclaringType() instanceof RatpackRequest and |
| 21 | + hasName([ |
| 22 | + "getContentLength", "getCookies", "getHeaders", "getPath", "getQuery", "getQueryParams", |
| 23 | + "getRawUri", "getUri" |
| 24 | + ]) |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +/** |
| 29 | + * The interface `ratpack.http.TypedData`. |
| 30 | + * https://ratpack.io/manual/current/api/ratpack/http/TypedData.html |
| 31 | + */ |
| 32 | +library class RatpackTypedData extends RefType { |
| 33 | + RatpackTypedData() { hasQualifiedName("ratpack.http", "TypedData") } |
| 34 | +} |
| 35 | + |
| 36 | +/** |
| 37 | + * Methods on `ratpack.http.TypedData` that return user tainted data. |
| 38 | + */ |
| 39 | +library class RatpackHttpTypedDataGetMethod extends Method { |
| 40 | + RatpackHttpTypedDataGetMethod() { |
| 41 | + getDeclaringType() instanceof RatpackTypedData and |
| 42 | + hasName(["getBuffer", "getBytes", "getContentType", "getInputStream", "getText"]) |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +/** |
| 47 | + * The interface `ratpack.form.UploadedFile`. |
| 48 | + * https://ratpack.io/manual/current/api/ratpack/form/UploadedFile.html |
| 49 | + */ |
| 50 | +library class RatpackUploadFile extends RefType { |
| 51 | + RatpackUploadFile() { hasQualifiedName("ratpack.form", "UploadedFile") } |
| 52 | +} |
| 53 | + |
| 54 | +library class RatpackUploadFileGetMethod extends Method { |
| 55 | + RatpackUploadFileGetMethod() { |
| 56 | + getDeclaringType() instanceof RatpackUploadFile and |
| 57 | + hasName("getFileName") |
| 58 | + } |
| 59 | +} |
0 commit comments