Repository navigation
Conversation
- Test that path() followed by pathRegex() drops the declared path on Vert.x 4/5 - Skip the catch-all remainder for declared paths without a trailing '*' (root route) - Static-import NormalizedRouteHelper helpers and Grammar.LEGACY
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdfdce2ca6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Isolated rendering admits a request-valued mount prefix when parameter names overlap and changes an encoded slash into a separator. Both remain conditional concerns because their real Vert.x input shapes could not be confirmed.
🤖 Bits Code Review · Commit 3e92aeb
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
There was a problem hiding this comment.
More details
The PR adds AppSec normalized-route tags for Vert.x 3–5 while preserving http.route. Vert.x validation rules out the duplicate-name concern, and encoded-slash mounts now omit the tag before decoding, resolving the remaining concern and leaving no open findings.
🤖 Bits Code Review · Commit 7964e1e
What Does This Do
Sets the
_dd.appsec.normalized_routespan tag (RFC-1125) on Vert.x web server spans: Vert.x 3.x (vertx-web-3.4) and Vert.x 4.x and 5.x (vertx-web-4.0, which also handles 5.x at runtime). It is set next tohttp.route, only when AppSec is active and API Security is enabled, on top of the core from #13501 and #13518.Declared route capture
RouteImpl.getPath()drops the trailing*(so/files/*and the exact/files/look the same), and Vert.x has no public way to tell them apart before 4.0.2. The route is therefore taken from the path the application declared.RouteSetPathAdvice: exit advice on the privateRouteImpl.setPath(String). It stores the declared path in aContextStore<Route, String>only whensetPathdid not throw.RouteSetRegexAdviceremoves it when the route becomes a regex route (pathRegex).RouteHandlerWrapperAdvicepasses the store toRouteHandlerWrapper. InsetRoute, inside the existingshouldUpdateRoutebranch and right afterwithRoute, the wrapper callsVertxNormalizedRoute.tag(...)with the declared path,mountPoint(),normalisedPath()(3.x) ornormalizedPath()(4.x/5.x), andpathParams(). The tagging is wrapped in try/catch with a debug log, andhttp.routeis unchanged.Vert.x route grammar (internal-api)
VertxRouteParser: tokenizer for Vert.x paths, next toSpringRouteParser::nameparams, several per segment (:id.:format,user-:id,:a-:b-:c).LEGACY(3.x),DEFAULT(4.0.3+) andEXTENDED(-Dio.vertx.web.route.param.extended-pattern=true).*becomes an unnamed catch-all.caf%C3%A9renderscaf%C3%A9).? [ ] { } | ^ \, or a*that is not the last character) cannot be expressed, so they get no tag.DDCacheper grammar.VertxNormalizedRoute: single entry point for both modules./*middleware) never keeps an earlier route's value.mountPoint().startsWithfor routes without params, the[^/]+segments of the compiled regex otherwise, with the mount joined asRouteState.pathMatchesdoes. This gives RFC-1125 rows 39/49:/filesfor/files,/files/for/files/,/files/{param1}for/files/a/b. The Vert.x*path param is never used: it does not exist in 3.x and its values are inverted in 4.0.3+.mountPoint()holds the matched request values. No tag either when the static base ends inside a request segment.Tests
@TableTest):VertxRouteParserTest,VertxRouteParserRfcVectorsTest(the RFC-1125 rows Vert.x syntax can express),VertxRouteParserCacheTest,VertxNormalizedRouteTestandVertxNormalizedRouteForkedTest.// empty ///, sub-routers, a mount with params, regex routes, the stale-tag cases, an encoded literal, AppSec inactive, and API Security disabled (forked).testandlatestDepTestthroughsrc/testNormalizedRoute.VertxHttpServerForkedTestbases (3.4, 4.0testandlatestDepTest, 5.0; vertx-rx-3.5 inherits from 3.4) overrideHttpServerTest.expectedNormalizedRoute, so every server suite asserts the tag.Motivation
RFC-1125 (amends RFC-1103): normalized routes for API Security Testing. Follow-up of the Spring MVC (#13633) and WebFlux (#13635) integrations.
Additional Notes
http.routeis unchanged. No change to the shared core classes indatadog.trace.api.appsec.route.tests/appsec/api_security_testing/test_normalized_route.pywas validated locally with this branch on thevertx3andvertx4weblogs from [java] Add normalized route endpoints and enable RFC-1125 tests for Spring weblogs system-tests#8689: 25 passed, 2 skipped.test_param_namesis irrelevant because Vert.x names cannot contain-.test_static_routecannot pass because the weblog declares/wafas a regex route, which has no normalized route. The manifest change enabling them comes after this PR._are read with the 4.0.3+ grammar there.http.routebut different templates (/files/*middleware then/files/) keep the first route's tag, because the tag follows thehttp.routeupdates./:lang/*) drops the tag.http.route, so the previous middleware'shttp.routeand normalized route both stay (a consistent pair).pathRegex()followed bypath()without:on the same route: Vert.x keeps matching with the regex, while the tag (andhttp.route) use the static path.route.path(bad)throws after Vert.x updated its state and the application catches the exception, the stored declared path stays the previous one.useNormalizedPath(false)still compute the catch-all presence from the normalized path.extended-patternsystem property is read on the first tagged request (Vert.x reads it whenRouteImplis initialized).http.routestill contains the matched request values (pre-existing). The normalized route is omitted there./(%2F) gives no tag: the prefix is rendered decoded, so the%2Fwould become a separator.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: APPSEC-72044
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.