Skip to content

Compare usage sharing keys in the root locale - #83

Merged
jwrosewell merged 9 commits into
rcfrom
fix/usage-sharing-options
Nov 14, 2026
Merged

jwrosewell merged 9 commits into
rcfrom
fix/usage-sharing-options

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

EvidenceKeyFilterShareUsage decides which Evidence the usage sharing element sends. On rc at 30e4886 it lower-cases each key with key.toLowerCase() at line 192, and the blocked headers, the query string parameters and the session cookie name at lines 170, 172 and 178, all in the default locale of the JVM. Under a Turkish or Azeri default locale a capital I lower-cases to a dotless i (U+0131), so ID.EMAIL becomes ıd.emaıl, does not match the never-shared key id.email, and is shared. HEADER.COOKIE and ID.SALT get through the same way, and so does a blocked header written with a capital I.

What the specification says

The Shared Evidence section of the usage sharing element specification, at 6570727d on the specifications main branch, says "Keys are compared without regard to case", and that the filter "MUST return false (i.e. not shared) for these keys, matched as the whole key or after a ., whatever the configuration and even when all Evidence is shared", listing id.email, id.salt, request-query, request-path and header.cookie. A comparison that depends on the default locale is not one without regard to case, because it gives a different answer in some locales.

What changed

The four calls lower-case in Locale.ROOT, which gives the same answer in every locale. Nothing else in the filter changes.

This draft first held the two sharing options, one tracker cache and the key handling of the usage sharing element. #62 brought all of those into rc (cf7e5e2), so rc was merged in at dfd2aea with a merge commit taking rc's version of every file this branch had changed. After that merge the branch's tree was the same as rc's, and the two commits after it are the whole change.

Tests

861b42a6 adds ShareUsageOptionsTests.neverSharedKeys_TurkishLocale_StillRefused, which sets the default locale to tr-TR and checks that ID.EMAIL, Query.ID.Email, HEADER.COOKIE, Server.Request-Path, SERVER.REQUEST-QUERY and ID.SALT are refused by a filter with the default options and by one that shares all Evidence. 61eb4ade is the fix.

  • Red, run 43519526894 on a throwaway branch holding 861b42a and a temporary workflow that runs ShareUsageOptionsTests on ubuntu-latest with the runner's Java 17.0.21 and Maven 3.10.0. 1 of 9 failed, the new test, with "ID.EMAIL ==> expected: but was: ".
  • Green, run 43519543993, the same with 61eb4ad. 9 of 9 passed.

Full build

Run 43519926331 built 61eb4ad merged with rc (30e4886) 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. Each of its ten Setting 'PullRequestSha' lines names 61eb4ad, 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 remains

Outside this file, 72 other calls in 20 files under src/main change case in the default locale on rc at ceab088, among them FlowDataDefault, PipelineBuilder, JsonBuilderElement and the cloud engines. They are not about what is shared, so #135 passes Locale.ROOT to every one of them, with a check on every pull request that keeps it so. #135 also makes the same four changes and adds the same import to EvidenceKeyFilterShareUsage.java as this draft, line for line, so the two merge in either order without a conflict.

#62 brought the two sharing options, the one tracker cache and the key handling this branch held, so every file this branch changed takes rc's version.
Lower-casing in the default locale turns I into a dotless i under a Turkish or Azeri locale, so ID.EMAIL did not match the never-shared key id.email and was shared.
@jwrosewell jwrosewell changed the title Add the usage sharing options to share all Evidence and all query string parameters Compare usage sharing keys in the root locale Nov 14, 2026
@jwrosewell
jwrosewell marked this pull request as ready for review November 14, 2026 10:36
@jwrosewell
jwrosewell merged commit b76596b into rc Nov 14, 2026
3 checks passed
@jwrosewell
jwrosewell deleted the fix/usage-sharing-options branch November 14, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant