Repository navigation
Send every Evidence value but the reserved names in the cloud request - #99
Merged
Merged
Conversation
…rved names The Cloud Request Engine must send every Evidence value apart from the reserved names resource, license, licence and values, under any prefix and in any letter case, whether or not the cloud service lists the key in its evidencekeys answer. The test that only accepted Evidence is sent is replaced by one that the request carries Evidence the service does not list, and still leaves out reserved names under prefixes it does not list.
The Cloud Request Engine sent only the Evidence whose keys the cloud service lists in its evidencekeys answer. It now sends every Evidence value apart from the reserved names resource, license, licence and values, under any prefix and in any letter case, and apart from the web request, as .NET does. What the service uses changes over time, and knowing about the other Evidence helps it improve. The accepted Evidence still serves as the engine's Evidence key filter, for the Pipeline and the web Vary header.
Keys only usually carry a prefix, as the Overview of the Evidence specification says, and .NET sends a key with no prefix under its whole key unless it is a reserved name. Java drops it. .NET also compares prefixes without regard to case, where Java treats Query.User-Agent as Evidence with some other prefix, so header Evidence of the same name takes precedence over it with a warning.
…s ignoring case A key with no separator now has the whole key as both its prefix and the name it is sent under, as .NET's AddQueryData takes it, so it is sent unless it is a reserved name. Prefixes are compared without regard to case when Evidence is grouped and when a conflict is reported, as .NET's KeyHasPrefix and AddQueryData compare them.
Evidence with no prefix ranks with Evidence of any prefix other than query, header and cookie, so header Evidence of the same name takes precedence over it, and a bare key that is itself a prefix, such as query, ranks with that prefix's Evidence, as in .NET. The Evidence specification's precedence order covers prefixes only, so the test records the choice.
The getFormData comment now gives the precedence order and where Evidence with no prefix ranks in it, and the hasKeyPrefix comment says a key with no separator is its own prefix.
…oes not list Two identical requests share a cache entry whatever the key is built from, so the test passed without showing that the key is built from the advertised Evidence. The second request now differs only in header.sec-ch-ua-platform, which the cloud service does not list, and one request must still be posted, carrying the first request's value. The test fails if the cache key takes every Evidence value.
jwrosewell
marked this pull request as ready for review
November 11, 2026 12:18
This was referenced Nov 11, 2026
Merged
Merged
Draft
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 Cloud Request Engine sends the cloud service only the Evidence whose keys the service lists in its
evidencekeysanswer. It is to send every Evidence value apart from the reserved names, which is what .NET, Python, PHP and Node already do. Go has the same gap and changes separately. There is no issue for this change.A review of this draft found two more differences from .NET on the same path.
bare, is never sent, where .NET sends it under its whole key.Query.User-Agentis treated as Evidence with some other prefix, andheader.User-Agenttakes precedence over it with a warning. .NET compares prefixes without regard to case, and Evidence keys are case-insensitive.The decision
On 10 November the rule was decided as "everything but reserved", because what the cloud service uses changes over time and knowing about the other Evidence is important to continued optimization. The reserved names are
resource,license,licenceandvalues, in any letter case and under any prefix.The cause
At
rcd39b6af,CloudRequestEngineDefault.isSentreturns false for a key thatevidenceKeyFilter.includerejects, which is any key theevidencekeysanswer does not list, and for a key with no separator.getFormDatabuilds the request only from EvidenceisSentallows. #89 (merged as ff6e4c0) added the first check, following the first sentence of the specification's Processing section at the time. Java's Evidence store keeps every key added (FlowDataDefault.addEvidence), so the check is the only thing that limits the request.hasKeyPrefixtestsitemKey.startsWith(prefix + "."), which is case-sensitive, and the conflict check compares the prefix withequals("query").What the specification says
specifications#138 merged into specifications
rcat 07:28 UTC today. Atrce89679e, the Processing section of the Cloud Request Engine page says the following.A key with no prefix has nothing to remove, so it is sent under its whole key, and a reserved name with no prefix still strips to itself and is left out. The Overview of the Evidence page at the same commit says "Keys MUST be case-insensitive and will usually be split into <prefix>.<field>", so a prefix is only usual, and its precedence list puts
queryaboveheader,cookieand the rest.What .NET does
On 51degrees-dotnet
rcat b3e90b4,CloudRequestEngine.GetContentadds every Evidence value apart from the web request, andIsReservedFieldleaves out the reserved names. It does not check theevidencekeysanswer, although the engine holds that answer as its Evidence key filter.AddQueryDatatakes the whole key as both the prefix and the suffix when the key has no separator, and leaves it out only when the suffix is reserved.KeyHasPrefixcompares the part before the first separator, or the whole key, withInvariantCultureIgnoreCase, and the conflict check compares thequeryprefix the same way.What changed
Head 85b8ad7, which merges
rcat 1c2c578 into 7e8fac2. Links are at 7e8fac2, whose files the merge does not change, because it brings in only the data update service change of #98.isSentno longer consults the accepted Evidence and no longer drops a key with no prefix. It leaves out only the web request (server.http-request) and a key whose name is a reserved name, compared without regard to case. Everything else is sent.keyPrefixandkeySuffix, split a key at its first separator as .NET does, and give the whole key as both where it has none.isSent,addFormDataandhasKeyPrefixuse them, so the reserved name filter applies to a key with no prefix the same way it applies to the name after a prefix. A name after the prefix can still hold a dot, asid.usagedoes inquery.id.usage.hasKeyPrefixand the conflict check compare the prefix without regard to case, soQuery.User-Agenttakes precedence overheader.User-Agentwith no warning. A key with no separator is its own prefix, so a bare key such asqueryranks with query Evidence, as in .NET, and the comment onhasKeyPrefixnow says so.GetContentputs such a key with the other prefixes too. The comment ongetFormDatarecords the choice.Varyheader, as theCloudEvidenceKeyFiltercomment says. When the engine sends a request is also unchanged, so no data request is sent until discovery has the accepted Evidence and the properties.For the release notes
resource,license,licenceandvaluesand the web request, whether or not the service lists the key as accepted, and including Evidence whose key has no prefix.How it was checked
Five tests in
CloudRequestEngineTestspost through a mocked HTTP client and read the fields of the one request sent.process_SendsEveryEvidenceValueButTheReservedNamesreplacesprocess_SendsOnlyAcceptedEvidence, which expected the opposite. The service lists onlyquery.User-Agent. The request must carryUser-Agent,accept-language,X-Other,sessionandclient-ip, and must leave outother.VALUESandserver.licence.process_SendsEvidenceWithNoPrefixUnderItsWholeKeyrequiresbare=valuein the request, andValues,license,RESOURCEandlicencewith no prefix to be left out.process_ComparesPrefixesWithoutRegardToCasesendsQuery.User-Agentandheader.User-Agent, and requires the query value to be sent with no warning logged.process_RanksEvidenceWithNoPrefixsendsX-Thingandheader.X-Thing, and requires the header value, then a barequeryandheader.query, and requires the bare value.process_RepeatedRequestHitsTheCachebuilds the engine with a cache and sends two requests that differ only inheader.sec-ch-ua-platform, which the service does not list. One request must be posted, carrying the first request's value, and the engine must not advertise the unlisted key. The Generation of keys section of the caching page says "All Flow Elements MUST advertize the Evidence keys that they make use of. You will need to use this to build a list of the relevant Evidence keys and values that are present in the Flow Data."FlowCacheDefaultbuilds its keys from the engine's Evidence key filter, so sending every value does not change what a cache entry is found by. The test fails if the cache key takes every Evidence value, and it pins behaviour that already holds, so it has no red run. It came from 2321010, whose two requests were identical and so would share an entry whatever the key was built from, and 7e8fac2 makes the second differ.The existing tests that the reserved names are left out even where the service lists them, and that the web request is never sent, are unchanged and still pass.
Each run used a temporary workflow on a
tmp/branch that builds the named modules on Ubuntu and runs the named tests.rc, Java 17process_RepeatedRequestHitsTheCacheamong themThe full build's 9 jobs without macOS all passed, being Ubuntu Java 8, 11, 17 and 21, Ubuntu ARM Java 17, and Windows Java 8, 11, 17 and 21. Every
Setting 'PullRequestSha'line, in Configure and in each of the 9 jobs, is 85b8ad7, the head, and Configure printed "Left out 6 macOS entries". Earlier full builds are superseded, 42897571422 at 4e73db5, and 43001749269 at 7e8fac2, which was cancelled whenrcwas merged in.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.
The branch has
rcmerged in twice, at c77fb05, which movescxxto c6d4e4d9, and at 1c2c578, which carries #98.Other drafts
git merge-tree --write-treeof this head against every other open draft's head finds no conflict, apart from #43, #63, #67, #82 and #97, which conflict withrcitself, #82's being thecxxsubmodule. #98 is merged intorcand is in this branch.What remains
Go makes the same change separately. Go, Node, Python and PHP should make the same three choices as .NET and this draft, being to send Evidence with no prefix under its whole key, to compare prefixes without regard to case, and to rank Evidence with no prefix with the other prefixes unless the whole key is query, header or cookie. Java did none of these before this change.