Repository navigation
Add the usage sharing options to share all Evidence and all query string parameters - #83
Draft
jwrosewell wants to merge 6 commits into
Draft
jwrosewell wants to merge 6 commits into
jwrosewell wants to merge 6 commits into
Conversation
…ing parameters, read keys without regard to case, and keep one tracker cache
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.
Problem
Three differences between Java's usage sharing element and the usage sharing element specification (on specifications
rc), found in the independent review of #68 (merged intorcas 7299688).Changes
SetShareAllEvidenceandSetShareAllQueryStringParameters, and Go has the same pair. Java now hassetShareAllEvidence(boolean)andsetShareAllQueryStringParameters(boolean)onShareUsageBuilderBase, withisShareAllEvidence()andisShareAllQueryStringParameters(). The configuration file reads them like every other builder option, asShareAllEvidenceandShareAllQueryStringParameters.id.email,id.salt,request-query,request-pathandheader.cookie) are still refused "even when all Evidence is shared", and the rules for blocked headers,cookie.,session.andquery.apply only "unless all Evidence is shared". The filter checks the never-shared keys first, then returns true.query.key that is not a never-shared key, and leaves the rules for headers, cookies and session values alone. .NET does this by dropping the allow list, and Java by a flag in the filter, with the same result.ShareUsageBase, being the filter that decides what is sent and the filter the tracker uses, so session tracking sees the same values that are sent.ShareUsageTrackerbuilt a second cache for its own keys, whileTrackerBase(throughDataKeyedCacheBase) built its own and never used it.DataKeyedCacheBasenow has an overridablegenerateKey(FlowData), whichgetandputuse, and the tracker overrides it instead of keeping a second cache. Review finding 2 in the review of #68. The new method defaults to the previous behaviour, so no other class changes.ShareUsageBase.getDataFromEvidenceswitched on the key as given, soServer.Client-IPwas written as an ordinaryServervalue, not as the client IP, whilstfind()is case-insensitive. The switch now uses the lower-case key. Review finding 5 in the review of Accept no Evidence for usage sharing, and give it the whole web request #68.How it was checked
Tests are in the new
ShareUsageOptionsTests, which builds the element from options as a configuration file does and reads the XML it sends.rcplus the tests only: run 42687160142, Java 8 and 17. Of 7 new tests, 6 fail (tracker_BuildsOneCacheexpected 1 cache and found 2,keysAreReadWithoutRegardToCasefound no client IP, and the four option tests fail with aPipelineConfigurationerror because the options do not exist). The other 38 tests in the run pass.Other drafts
EvidenceKeyFilterShareUsage.include(a check ofserver.http-requestbefore the lower-casing) and the XML character handling inShareUsageElement.java. This draft adds its share-all check after the never-shared loop and changes only the constructors ofShareUsageElement.git merge-treeof this branch with Add switches and paths to the web integration, and Element Data to the Sequence Element #80 reports no conflict.writeXmlDatainShareUsageElement.java. This draft does not touch that method.git merge-treewith Write the usage sharing record as the specification says #81 reports no conflict.rcand is included. Add switches and paths to the web integration, and Element Data to the Sequence Element #80 is not changed. TheSequenceElement.javaconflict between Add switches and paths to the web integration, and Element Data to the Sequence Element #80 and Accept no Evidence for usage sharing, and give it the whole web request #68 that the review found is not part of this draft.Remaining
server.http-requestrefused in the filter), which Add switches and paths to the web integration, and Element Data to the Sequence Element #80 already covers, and finding 4 (test strength), which needs no change.51d.xmlis not changed, as both options default to false.Locale
Review of this draft found that the filter lower-cased keys with the default locale. In a Turkish locale
ID.EMAILdoes not becomeid.email, so the never-shared check would miss and share-all would send the raw email key.EvidenceKeyFilterShareUsagenow lower-cases withLocale.ROOT(the session cookie name, blocked headers, included parameters and the key). No other usage sharing code lowers or raises case without a locale.neverSharedKeys_TurkishLocale_StillRefusedsets the default locale to Turkish and checks the never-shared keys are refused with and without share-all.ID.EMAIL ==> expected: <false> but was: <true>.Full build
Head 4e720fc, which merges
rcat 9846076 (including #81). Run 42719938865, and everySetting 'PullRequestSha'line is 4e720fc. Configure, the four Windows jobs (Java 8, 11, 17, 21) and the five Ubuntu jobs (Java 8, 11, 17, 21 and ARM 17) succeeded. The macOS jobs and Compare Performance were cancelled.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.