Repository navigation
Supply server.request-query in the web integration - #144
Merged
Merged
Conversation
RequestLineEvidenceTests gives the request line keys to an element that accepts them and expects the query string whole and undecoded, and an empty one when the request has none, as the web integration specification's Populating Evidence section asks.
The web integration specification's Populating Evidence section says an integration that supplies the request line keys supplies all three on every request, with server.request-query the whole query string, undecoded, and empty when the request has none. The servlet filter and the Spring interceptor supplied the method and the path only. The query string comes from getQueryString, which the container does not decode. Usage sharing never shares it, as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The problem
The web integration supplies the method and the path of the request line as Evidence, and not the query string. web-integration.md lines 95 to 114 at 706de1f0 list "Request query string, whole and undecoded. Key is
server.request-query" beside the method and the path, and say:WebRequestEvidenceServiceCore.Default.addEvidenceFromRequestaddedserver.request-methodandserver.request-pathand nothing for the query. The servlet filter and the Spring interceptor both go through it, so neither suppliedserver.request-query. So an element that checks a signature over the request line, as the Agent Signature Element the specification names does, would have no query string to rebuild it from.What changed
addEvidenceFromRequestnow addsserver.request-queryfromHttpServletRequest.getQueryString, which the servlet API gives as sent, with no decoding, and an empty string when the request has no query string. Like every other value it is added as Evidence only when an element in the Pipeline accepts the key, and it is recorded in the web request that usage sharing reads. Usage sharing never shares it, asrequest-queryis already on the never-shared list (EvidenceKeyFilterShareUsage.java line 110), because the whole query string would undo the rules for its parameters, which share only51D_ones by default.Tests
Tests first, in 6bf4870b, a new class
RequestLineEvidenceTestsinpipeline.web. Each test gives the service Flow Data whose Evidence key filter accepts the three request line keys.RequestQuery_SuppliedWholeAndUndecodedsends a GET for/awith the query stringx=%2F&y=1and expects the method, the path andserver.request-queryasx=%2F&y=1.RequestQuery_NoQueryString_SuppliedEmptysends a GET for/awith no query string and expectsserver.request-queryas an empty string.Red 43616169242 on 6bf4870 plus a throwaway workflow, Java 17. Both new tests fail ("Argument(s) are different"), and
PipelineFilterTests(12) andUsageSharingEvidenceTests(7) pass.Green 43616169257 on the fix a9f5dc8e plus the same workflow. 2, 12 and 7 pass.
Full build
Run 43617663019 built a9f5dc8 merged with
rc(b33daa0) on nine configurations, Ubuntu x64 with Java 8, 11, 17 and 21, Ubuntu arm64 with Java 17, and Windows with Java 8, 11, 17 and 21, and every job passed.RequestLineEvidenceTestspassed 2 of 2 andPipelineFilterTests12 of 12 in all nine jobs. Each of its tenSetting 'PullRequestSha'lines names a9f5dc8, and its Configure job printed "Left out 6 macOS entries".macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
What it releases
pipeline.webchanges, which is in Monday's plan under version per package (#63) already.Base branch
rcat b33daa0, and a trial merge of the head withrcat 32b3784 is clean. #67 changes only a Javadoc inWebRequestEvidence.javaof the same package, and a trial merge of the two was clean.