Conversation
nan-li
force-pushed
the
nan/sdk-5282
branch
from
September 18, 2026 00:52
cc23f55 to
a3f3feb
Compare
`updateUserJwt` logged the full token at verbose behind a TODO to remove it before shipping, and `OneSignalClient` printed a request's `additionalHeaders` on send and again in the response handler, which is where `OSRequestAuth` puts the Authorization header, so every signed request logged its bearer. `onesignal_Log` hands every entry to app listeners and the internal sink whatever the console level is, so a host listener or remote logging could see the token without anyone turning verbose on. `updateUserJwt` now logs the external ID and the token's last 8 characters, the breadcrumb Android keeps: it cannot be replayed, and it ties a supplied token to a later rejection. The client masks the Authorization value as `<redacted>` at both log sites and keeps the key, so a log still shows whether a request went out signed. Three listener tests pin it: the exact `updateUserJwt` entry, and the client's request and response lines for a signed request, each asserting no entry contains the token. The client's two private log sites are reachable from the Core tests through a category, so no network round trip is needed. All three fail against the previous source.
nan-li
force-pushed
the
nan/sdk-5282
branch
from
September 18, 2026 01:22
a3f3feb to
00c3a33
Compare
nan-li
marked this pull request as ready for review
September 18, 2026 01:24
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.
Description
One Line Summary
Redact the JWT from SDK logs. SDK-5282.
Details
Motivation
Two verbose log lines printed the token in full: the
updateUserJwtentry line, and the HTTP client's header lines for signed requests. Log entries reach app log listeners and remote logging regardless of the console log level.Scope
updateUserJwtlogs the external ID and the last 8 characters of the token, matching Android.OneSignalClientmasks the Authorization header value as<redacted>in its request and response log lines. Other headers unchanged.Testing
Unit testing
Three log-listener tests assert no entry contains the token:
updateUserJwt, and the client's request and response lines for a signed request. The client's private log methods are exposed to the Core tests through a category in the bridging header. All three fail without the fix.Manual testing
Full unit test plan run locally on an iPhone 17 Pro simulator. Not run on a device.
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code