Skip to content

Commit 1b1809a

Browse files
antonisclaude
andauthored
fix(android): Mask auth token in sentry.gradle upload-task log (#6057)
* fix(android): Mask auth token in sentry.gradle upload-task log The upload task logged its full sentry-cli argument list at the gradle lifecycle log level, which is the default verbosity. When flavorAware is enabled the args include `--auth-token <token>`, exposing it in CI build logs and developer terminal scrollback. Replace the token value with `***` in the logged copy of the args; the actual command-line invocation is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update changelog --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 99a0692 commit 1b1809a

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
### Fixes
1717

1818
- Stop the Hermes sampling profiler on React instance teardown to prevent `pthread_kill` SIGABRT when the JS thread is torn down with profiling active ([#6035](https://github.com/getsentry/sentry-react-native/pull/6035))
19+
- Mask the Sentry auth token in the `sentry.gradle` upload-task lifecycle log ([#6057](https://github.com/getsentry/sentry-react-native/pull/6057))
1920
- Discard invalid navigation/interaction transactions via an event processor instead of mutating the internal `_sampled` flag, removing misleading "dropped due to sampling" debug logs ([#6051](https://github.com/getsentry/sentry-react-native/pull/6051))
2021

2122
### Dependencies

packages/core/sentry.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ plugins.withId('com.android.application') {
269269

270270
args.addAll(extraArgs)
271271

272-
project.logger.lifecycle("Sentry-CLI arguments: ${args}")
272+
// Mask sentryAuthToken in the logged args; do not pass loggedArgs to the CLI.
273+
def loggedArgs = sentryAuthToken ? args.collect { it == sentryAuthToken ? "***" : it } : args
274+
project.logger.lifecycle("Sentry-CLI arguments: ${loggedArgs}")
273275
def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c', 'node'] : []
274276
if (!System.getenv('SENTRY_DOTENV_PATH') && file("$reactRoot/.env.sentry-build-plugin").exists()) {
275277
environment('SENTRY_DOTENV_PATH', "$reactRoot/.env.sentry-build-plugin")

0 commit comments

Comments
 (0)