Repository navigation
Make every opt-out fail closed (0.8.0) - #51
Merged
Merged
Conversation
A switch that does not clearly mean "on" now turns reporting off, so an operator's opt-out can never be read as consent: - Server-wide config: every enabled: line counts, its value is read as a YAML scalar (quotes and trailing comment stripped), and only true/on/yes/1 keeps reporting on. A quoted "false", an empty enabled:, a typo, or any later enabled: false now disables (#15, #27). - A server-wide file that exists but cannot be read now disables; one that is not UTF-8 is read as ISO-8859-1 and not appended to (#40). A file that is missing and cannot be created still counts as enabled. - Environment: TRACE_USAGE_REPORTING set to anything but blank or a clear "on" disables; DO_NOT_TRACK set to anything but blank or a clear "no" disables; an environment that cannot be read disables (#39). - New TraceClient.allowsReporting(Object) for a program's own setting, which fails closed the same way; the docs now use it instead of getBoolean(path, true), which reads a quoted "false" as on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
Merged
Merged
Merged
Open
Merged
Merged
Merged
Merged
This was referenced Nov 19, 2026
Merged
dmccoystephenson
added a commit
to Stephenson-Software/trace-client-csharp
that referenced
this pull request
Nov 19, 2026
A switch that does not clearly mean "on" now turns reporting off, so an opt-out can never be read as consent: - Environment: TRACE_USAGE_REPORTING set to anything but blank or a clear "on" (true/on/yes/1) disables; DO_NOT_TRACK set to anything but blank or a clear "no" (0/false/off/no) disables. Before, only a fixed list of values disabled, so TRACE_USAGE_REPORTING=disabled or DO_NOT_TRACK=on left reporting on. - An environment that cannot be read (e.g. a SecurityException in a sandbox) now disables; it used to leave reporting on. - New TraceClient.AllowsReporting(object) for a program's own setting: only true, or a string true/on/yes/1, allows reporting; anything else, including null, a number or a quoted "false", turns it off. The README and doc-comment examples now pass the setting through it. Counterpart of Stephenson-Software/trace-client-java#51. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
dmccoystephenson
added a commit
to Stephenson-Software/trace-client-cpp
that referenced
this pull request
Nov 19, 2026
A switch that does not clearly mean "on" now turns reporting off, so an opt-out can never be read as consent: - Environment: TRACE_USAGE_REPORTING set to anything but blank or a clear "on" (true/on/yes/1) disables; DO_NOT_TRACK set to anything but blank or a clear "no" (0/false/off/no) disables. Before, only a fixed list of values disabled, so TRACE_USAGE_REPORTING=disabled or DO_NOT_TRACK=on left reporting on. An environment that cannot be read now disables. - New trace_client::allowsReporting(value) for a program's own setting: only true, or a string true/on/yes/1, allows reporting; anything else, including a null pointer, a number or a quoted "false", turns it off. The README and header examples now pass the setting through it. Counterpart of Stephenson-Software/trace-client-java#51. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 of 2 tasks
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.
A server operator reported that usage reporting kept turning itself back on. Every way the client could read an opt-out as consent was audited, and each switch now fails closed: a value that does not clearly mean "on" turns reporting off.
Changes
Server-wide
plugins/trace/config.yml(closes #15, closes #27, closes #42)enabled:is read as a YAML scalar, with quotes and any trailing comment stripped. Onlytrue,on,yesor1keep reporting on."false", an emptyenabled:, a comment-only value or a typo now disables.enabled:line counts, so a laterenabled: falseis no longer shadowed by an earlier line.Unreadable files (closes #40)
enabled: false.Environment (closes #39)
TRACE_USAGE_REPORTINGset to anything but blank ortrue/on/yes/1disables.disabledandofflineused to leave reporting on.DO_NOT_TRACKset to anything but blank or0/false/off/nodisables.SecurityManagerdenyinggetenv) disables instead of throwing out ofbuild().New:
TraceClient.allowsReporting(Object)getBoolean(path, true). Bukkit'sgetBooleanreturns its default for a quoted"false", so that pattern read an opt-out as on.The version is bumped to 0.8.0, because values that used to leave reporting on now turn it off.
Tests
123 pass. The tests that pinned the old fail-open behaviour (
...Yet,theFirstEnabledLineIsTheSwitch,valuesThatAreNotAnOptOutLeaveReportingOn) now assert the fail-closed behaviour. New tests cover an unreadable file, a non-UTF-8 file, an unreadable environment andallowsReporting.The plugins that vendor this client will be updated to 0.8.0 and switched to
allowsReportingin follow-up PRs.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson