Repository navigation
Make every opt-out fail closed (0.4.0) - #36
Merged
Merged
Conversation
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>
This was referenced Nov 19, 2026
Merged
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.
Usage reporting must actually stay off when it is turned off. This brings the C++ client to the same fail-closed semantics as the Java client 0.8.0 (Stephenson-Software/trace-client-java#51).
Fail-open paths fixed
TRACE_USAGE_REPORTINGwas a deny-list (off/false/0/no): any other non-blank value, e.g.disabledor a typo, left reporting on. It now disables for anything but blank ortrue/on/yes/1(case-insensitive, trimmed).DO_NOT_TRACKwas an allow-list of opt-outs (1/true/yes):on,yand so on left reporting on. It now disables for anything but blank or0/false/off/no.environmentOptsOut()catches and returnstrue); it never throws.trace_client::allowsReporting(value):true, or astd::string/const char *readingtrue/on/yes/1, allows reporting;false, a quoted"false", a typo, a null pointer, a number or any other type turns it off. The README and header examples now use it.The client reads no config file of its own with a switch (the install-ID file holds only an ID), so no file-parsing changes were needed.
Version
0.3.0 → 0.4.0 in the header comment,
TRACE_CLIENT_VERSION,CMakeLists.txtand the README User-Agent example.Tests
make test: 81 tests, 0 failed checks (env tests now cover typos and the new accepted "on"/"no" values;allowsReportingtests cover bool,std::string,const char *,char *, null,nullptr, numbers). Also compiles warning-free under-std=c++17.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson