Repository navigation
fix: vendor trace-client 0.8.0 so every opt-out fails closed - #274
Merged
Merged
Conversation
- Re-vendor trace-client-java 0.8.0 (TraceClient + TraceClientTest):
TRACE_USAGE_REPORTING set to anything but blank or a clear on value,
DO_NOT_TRACK set to anything but blank or a clear no, or an unreadable
environment now turns reporting off.
- UsageReporter reads usage-reporting.enabled as text and judges it with
TraceClient.allowsReporting: only true/on/yes/1 keeps reporting on, so a
blank USAGE_REPORTING_ENABLED=, a quoted "false" or a typo is an opt-out
instead of a failed start.
- compose.yml: ${USAGE_REPORTING_ENABLED-true} instead of :-true, so a
blank value in .env is no longer replaced with true.
- Tests for the setting table, blank/unclear settings, and unclear
TRACE_USAGE_REPORTING / DO_NOT_TRACK values; README + sample.env.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A server operator reported usage reporting turning itself back on after it had been disabled. Every way an operator's opt-out could be read as, or turned back into, "on" without their consent is closed here: a switch that does not clearly mean "on" now means off.
Changes
TraceClient+TraceClientTest, fail-closed client from Make every opt-out fail closed (0.8.0) Stephenson-Software/trace-client-java#51):TRACE_USAGE_REPORTINGset to anything but blank or a clear on value,DO_NOT_TRACKset to anything but blank or a clear no, or an environment that cannot be read now turns reporting off.usage-reporting.enabledfails closed. It was bound as a Springboolean, so a blankUSAGE_REPORTING_ENABLED=, a quoted"false"or a typo stopped the service starting. It is now read as text and judged byTraceClient.allowsReporting(...): onlytrue/on/yes/1keeps reporting on; anything else turns it off.compose.ymlfail-open closed.${USAGE_REPORTING_ENABLED:-true}replaced a blankUSAGE_REPORTING_ENABLED=in.envwithtrue; it is now${USAGE_REPORTING_ENABLED-true}(default only when unset), so a blank value reaches the service and turns reporting off.sample.envdescribe the fail-closed rule.Tests
usage-reporting.enabledvalue table, blank/quoted/unclear settings disabling the reporter, andTRACE_USAGE_REPORTING=disabled/DO_NOT_TRACK=pleaseturning reporting off. Existing reporter tests now pass the setting as text.mvn test(JDK 21): 747 tests, 0 failures, 0 skipped.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson