sentry-cli 2.32.2__tar.gz → 2.33.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/Cargo.lock +17 -11
  2. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/Cargo.toml +2 -2
  3. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/PKG-INFO +1 -1
  4. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/sentry_cli.egg-info/PKG-INFO +1 -1
  5. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/sentry_cli.egg-info/SOURCES.txt +1 -0
  6. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/errors/api_error.rs +2 -2
  7. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/mod.rs +10 -6
  8. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/derive_parser.rs +3 -3
  9. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/mod.rs +31 -9
  10. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/sourcemaps/explain.rs +2 -2
  11. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/config.rs +8 -4
  12. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/args.rs +7 -4
  13. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/auth_token/auth_token_impl.rs +14 -19
  14. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/auth_token/mod.rs +5 -0
  15. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/auth_token/org_auth_token.rs +6 -4
  16. sentry_cli-2.33.1/src/utils/auth_token/redacting.rs +66 -0
  17. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/auth_token/test.rs +19 -31
  18. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/auth_token/user_auth_token.rs +10 -5
  19. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/chunks.rs +1 -1
  20. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/dif_upload.rs +2 -2
  21. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/file_upload.rs +17 -4
  22. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/http.rs +1 -1
  23. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/sourcemaps.rs +15 -1
  24. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/system.rs +1 -1
  25. sentry_cli-2.33.1/src/utils/value_parsers.rs +20 -0
  26. sentry_cli-2.32.2/src/utils/value_parsers.rs +0 -8
  27. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/LICENSE +0 -0
  28. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/MANIFEST.in +0 -0
  29. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/README.md +0 -0
  30. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/build.rs +0 -0
  31. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/pyproject.toml +0 -0
  32. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/sentry_cli.egg-info/dependency_links.txt +0 -0
  33. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/sentry_cli.egg-info/top_level.txt +0 -0
  34. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/setup.cfg +0 -0
  35. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/setup.py +0 -0
  36. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/connection_manager.rs +0 -0
  37. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/artifact.rs +0 -0
  38. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/compression.rs +0 -0
  39. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/dif.rs +0 -0
  40. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/file_state.rs +0 -0
  41. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/hash_algorithm.rs +0 -0
  42. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/mod.rs +0 -0
  43. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/upload/capability.rs +0 -0
  44. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/upload/mod.rs +0 -0
  45. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/chunking/upload/options.rs +0 -0
  46. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/data_types/mod.rs +0 -0
  47. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/encoding.rs +0 -0
  48. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/envelopes_api.rs +0 -0
  49. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/errors/mod.rs +0 -0
  50. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/errors/sentry_error.rs +0 -0
  51. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/api/pagination.rs +0 -0
  52. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/bashsupport.sh +0 -0
  53. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/bash_hook.rs +0 -0
  54. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/bundle_jvm.rs +0 -0
  55. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/bundle_sources.rs +0 -0
  56. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/check.rs +0 -0
  57. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/find.rs +0 -0
  58. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/mod.rs +0 -0
  59. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/print_sources.rs +0 -0
  60. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/debug_files/upload.rs +0 -0
  61. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/deploys/list.rs +0 -0
  62. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/deploys/mod.rs +0 -0
  63. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/deploys/new.rs +0 -0
  64. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/events/list.rs +0 -0
  65. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/events/mod.rs +0 -0
  66. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/files/delete.rs +0 -0
  67. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/files/list.rs +0 -0
  68. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/files/mod.rs +0 -0
  69. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/files/upload.rs +0 -0
  70. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/info.rs +0 -0
  71. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/issues/list.rs +0 -0
  72. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/issues/mod.rs +0 -0
  73. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/issues/mute.rs +0 -0
  74. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/issues/resolve.rs +0 -0
  75. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/issues/unresolve.rs +0 -0
  76. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/login.rs +0 -0
  77. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/monitors/list.rs +0 -0
  78. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/monitors/mod.rs +0 -0
  79. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/monitors/run.rs +0 -0
  80. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/organizations/list.rs +0 -0
  81. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/organizations/mod.rs +0 -0
  82. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/projects/list.rs +0 -0
  83. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/projects/mod.rs +0 -0
  84. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/react_native/appcenter.rs +0 -0
  85. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/react_native/gradle.rs +0 -0
  86. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/react_native/mod.rs +0 -0
  87. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/react_native/xcode.rs +0 -0
  88. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/archive.rs +0 -0
  89. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/delete.rs +0 -0
  90. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/finalize.rs +0 -0
  91. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/info.rs +0 -0
  92. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/list.rs +0 -0
  93. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/mod.rs +0 -0
  94. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/new.rs +0 -0
  95. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/propose_version.rs +0 -0
  96. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/restore.rs +0 -0
  97. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/releases/set_commits.rs +0 -0
  98. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/repos/list.rs +0 -0
  99. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/repos/mod.rs +0 -0
  100. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_envelope.rs +0 -0
  101. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_event.rs +0 -0
  102. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_metric/common_args.rs +0 -0
  103. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_metric/distribution.rs +0 -0
  104. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_metric/gauge.rs +0 -0
  105. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_metric/increment.rs +0 -0
  106. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_metric/mod.rs +0 -0
  107. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/send_metric/set.rs +0 -0
  108. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/sourcemaps/inject.rs +0 -0
  109. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/sourcemaps/mod.rs +0 -0
  110. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/sourcemaps/resolve.rs +0 -0
  111. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/sourcemaps/upload.rs +0 -0
  112. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/uninstall.rs +0 -0
  113. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/update.rs +0 -0
  114. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/upload_dif.rs +0 -0
  115. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/upload_dsym.rs +0 -0
  116. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/commands/upload_proguard.rs +0 -0
  117. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/constants.rs +0 -0
  118. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/main.rs +0 -0
  119. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/android.rs +0 -0
  120. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/appcenter.rs +0 -0
  121. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/auth_token/error.rs +0 -0
  122. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/cordova.rs +0 -0
  123. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/dif.rs +0 -0
  124. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/event.rs +0 -0
  125. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/file_search.rs +0 -0
  126. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/formatting.rs +0 -0
  127. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/fs.rs +0 -0
  128. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/logging.rs +0 -0
  129. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/metrics.rs +0 -0
  130. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/mod.rs +0 -0
  131. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/progress.rs +0 -0
  132. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/releases.rs +0 -0
  133. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/retry.rs +0 -0
  134. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_default_twenty.snap +0 -0
  135. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_ignore_missing.snap +0 -0
  136. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_base.snap +0 -0
  137. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_previous_commit.snap +0 -0
  138. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/snapshots/sentry_cli__utils__vcs__get_commits_from_git.snap +0 -0
  139. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/sourcemaps/inject.rs +0 -0
  140. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/ui.rs +0 -0
  141. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/update.rs +0 -0
  142. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/vcs.rs +0 -0
  143. {sentry_cli-2.32.2 → sentry_cli-2.33.1}/src/utils/xcode.rs +0 -0
@@ -2344,6 +2344,15 @@ dependencies = [
2344
2344
  "syn 2.0.68",
2345
2345
  ]
2346
2346
 
2347
+ [[package]]
2348
+ name = "secrecy"
2349
+ version = "0.8.0"
2350
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2351
+ checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e"
2352
+ dependencies = [
2353
+ "zeroize",
2354
+ ]
2355
+
2347
2356
  [[package]]
2348
2357
  name = "security-framework-sys"
2349
2358
  version = "2.11.0"
@@ -2413,7 +2422,7 @@ dependencies = [
2413
2422
 
2414
2423
  [[package]]
2415
2424
  name = "sentry-cli"
2416
- version = "2.32.2"
2425
+ version = "2.33.1"
2417
2426
  dependencies = [
2418
2427
  "anyhow",
2419
2428
  "anylog",
@@ -2465,6 +2474,7 @@ dependencies = [
2465
2474
  "rstest",
2466
2475
  "runas",
2467
2476
  "rust-ini",
2477
+ "secrecy",
2468
2478
  "semver 1.0.23",
2469
2479
  "sentry",
2470
2480
  "serde",
@@ -2474,7 +2484,6 @@ dependencies = [
2474
2484
  "sourcemap",
2475
2485
  "symbolic",
2476
2486
  "tempfile",
2477
- "testing_logger",
2478
2487
  "thiserror",
2479
2488
  "trycmd",
2480
2489
  "unix-daemonize",
@@ -2930,15 +2939,6 @@ dependencies = [
2930
2939
  "windows-sys 0.48.0",
2931
2940
  ]
2932
2941
 
2933
- [[package]]
2934
- name = "testing_logger"
2935
- version = "0.1.1"
2936
- source = "registry+https://github.com/rust-lang/crates.io-index"
2937
- checksum = "6d92b727cb45d33ae956f7f46b966b25f1bc712092aeef9dba5ac798fc89f720"
2938
- dependencies = [
2939
- "log",
2940
- ]
2941
-
2942
2942
  [[package]]
2943
2943
  name = "thiserror"
2944
2944
  version = "1.0.61"
@@ -3596,6 +3596,12 @@ dependencies = [
3596
3596
  "syn 2.0.68",
3597
3597
  ]
3598
3598
 
3599
+ [[package]]
3600
+ name = "zeroize"
3601
+ version = "1.8.1"
3602
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3603
+ checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
3604
+
3599
3605
  [[package]]
3600
3606
  name = "zip"
3601
3607
  version = "0.6.6"
@@ -2,7 +2,7 @@
2
2
  authors = ["Armin Ronacher <armin.ronacher@active-4.com>"]
3
3
  build = "build.rs"
4
4
  name = "sentry-cli"
5
- version = "2.32.2"
5
+ version = "2.33.1"
6
6
  edition = "2021"
7
7
  rust-version = "1.65"
8
8
 
@@ -80,6 +80,7 @@ zip = "0.6.4"
80
80
  data-encoding = "2.3.3"
81
81
  magic_string = "0.3.4"
82
82
  chrono-tz = "0.8.4"
83
+ secrecy = "0.8.0"
83
84
 
84
85
  [dev-dependencies]
85
86
  insta = { version = "1.26.0", features = ["redactions", "yaml"] }
@@ -87,7 +88,6 @@ mockito = "0.31.1"
87
88
  predicates = "2.1.5"
88
89
  rstest = "0.18.2"
89
90
  tempfile = "3.8.1"
90
- testing_logger = "0.1.1"
91
91
  trycmd = "0.14.11"
92
92
 
93
93
  [features]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry_cli
3
- Version: 2.32.2
3
+ Version: 2.33.1
4
4
  Summary: A command line utility to work with Sentry.
5
5
  Home-page: https://github.com/getsentry/sentry-cli
6
6
  Author: Sentry
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry_cli
3
- Version: 2.32.2
3
+ Version: 2.33.1
4
4
  Summary: A command line utility to work with Sentry.
5
5
  Home-page: https://github.com/getsentry/sentry-cli
6
6
  Author: Sentry
@@ -130,6 +130,7 @@ src/utils/auth_token/auth_token_impl.rs
130
130
  src/utils/auth_token/error.rs
131
131
  src/utils/auth_token/mod.rs
132
132
  src/utils/auth_token/org_auth_token.rs
133
+ src/utils/auth_token/redacting.rs
133
134
  src/utils/auth_token/test.rs
134
135
  src/utils/auth_token/user_auth_token.rs
135
136
  src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_default_twenty.snap
@@ -24,9 +24,9 @@ pub(in crate::api) enum ApiErrorKind {
24
24
  OrganizationNotFound,
25
25
  #[error("resource not found")]
26
26
  ResourceNotFound,
27
- #[error("Project not found. Please check that you entered the project and organization slugs correctly.")]
27
+ #[error("Project not found. Ensure that you configured the correct project and organization.")]
28
28
  ProjectNotFound,
29
- #[error("release not found")]
29
+ #[error("Release not found. Ensure that you configured the correct release, project, and organization.")]
30
30
  ReleaseNotFound,
31
31
  #[error("chunk upload endpoint not supported by sentry server")]
32
32
  ChunkUploadNotSupported,
@@ -37,6 +37,7 @@ use lazy_static::lazy_static;
37
37
  use log::{debug, info, warn};
38
38
  use parking_lot::Mutex;
39
39
  use regex::{Captures, Regex};
40
+ use secrecy::ExposeSecret;
40
41
  use sentry::protocol::{Exception, Values};
41
42
  use serde::de::DeserializeOwned;
42
43
  use serde::{Deserialize, Serialize};
@@ -454,7 +455,7 @@ impl<'a> AuthenticatedApi<'a> {
454
455
  self.api.put(path, body)
455
456
  }
456
457
 
457
- /// Convinience method to call self.api.request.
458
+ /// Convenience method to call self.api.request.
458
459
  fn request(&self, method: Method, url: &str) -> ApiResult<ApiRequest> {
459
460
  self.api.request(method, url, None)
460
461
  }
@@ -496,15 +497,15 @@ impl<'a> AuthenticatedApi<'a> {
496
497
  )
497
498
  };
498
499
 
499
- let mut checkums_qs = String::new();
500
+ let mut checksums_qs = String::new();
500
501
  for checksum in checksums.iter() {
501
- checkums_qs.push_str(&format!("&checksum={}", QueryArg(checksum)));
502
+ checksums_qs.push_str(&format!("&checksum={}", QueryArg(checksum)));
502
503
  }
503
504
  // We have a 16kb buffer for reach request configured in nginx,
504
505
  // so do not even bother trying if it's too long.
505
506
  // (16_384 limit still leaves us with 384 bytes for the url itself).
506
- if !checkums_qs.is_empty() && checkums_qs.len() <= 16_000 {
507
- path.push_str(&checkums_qs);
507
+ if !checksums_qs.is_empty() && checksums_qs.len() <= 16_000 {
508
+ path.push_str(&checksums_qs);
508
509
  }
509
510
 
510
511
  let resp = self.get(&path)?;
@@ -1687,7 +1688,10 @@ impl ApiRequest {
1687
1688
  }
1688
1689
  Auth::Token(ref token) => {
1689
1690
  debug!("using token authentication");
1690
- self.with_header("Authorization", &format!("Bearer {token}"))
1691
+ self.with_header(
1692
+ "Authorization",
1693
+ &format!("Bearer {}", token.raw().expose_secret()),
1694
+ )
1691
1695
  }
1692
1696
  }
1693
1697
  }
@@ -1,6 +1,6 @@
1
1
  use crate::utils::auth_token::AuthToken;
2
- use crate::utils::value_parsers::kv_parser;
3
- use clap::{command, value_parser, ArgAction::SetTrue, Parser, Subcommand};
2
+ use crate::utils::value_parsers::{auth_token_parser, kv_parser};
3
+ use clap::{command, ArgAction::SetTrue, Parser, Subcommand};
4
4
 
5
5
  use super::send_metric::SendMetricArgs;
6
6
 
@@ -13,7 +13,7 @@ pub(super) struct SentryCLI {
13
13
  #[arg(help = "Custom headers that should be attached to all requests{n}in key:value format")]
14
14
  pub(super) headers: Vec<(String, String)>,
15
15
 
16
- #[arg(global=true, long, value_parser=value_parser!(AuthToken))]
16
+ #[arg(global=true, long, value_parser=auth_token_parser)]
17
17
  #[arg(help = "Use the given Sentry auth token")]
18
18
  pub(super) auth_token: Option<AuthToken>,
19
19
 
@@ -1,22 +1,23 @@
1
1
  //! This module implements the root command of the CLI tool.
2
2
 
3
- use std::env;
4
- use std::io;
5
- use std::process;
6
-
7
3
  use anyhow::{bail, Result};
8
4
  use clap::{value_parser, Arg, ArgAction, ArgMatches, Command};
9
5
  use clap_complete::{generate, Generator, Shell};
10
6
  use log::{debug, info, set_logger, set_max_level, LevelFilter};
7
+ use std::borrow::Cow;
8
+ use std::io;
9
+ use std::process;
10
+ use std::{env, iter};
11
11
 
12
12
  use crate::api::Api;
13
13
  use crate::config::{Auth, Config};
14
14
  use crate::constants::{ARCH, PLATFORM, VERSION};
15
- use crate::utils::auth_token::AuthToken;
15
+ use crate::utils::auth_token::{redact_token_from_string, AuthToken};
16
16
  use crate::utils::logging::set_quiet_mode;
17
17
  use crate::utils::logging::Logger;
18
18
  use crate::utils::system::{init_backtrace, load_dotenv, print_error, QuietExit};
19
19
  use crate::utils::update::run_sentrycli_update_nagger;
20
+ use crate::utils::value_parsers::auth_token_parser;
20
21
 
21
22
  mod derive_parser;
22
23
 
@@ -81,6 +82,9 @@ const UPDATE_NAGGER_CMDS: &[&str] = &[
81
82
  "sourcemaps",
82
83
  ];
83
84
 
85
+ /// The long auth token argument (--auth-token).
86
+ const AUTH_TOKEN_ARG: &str = "auth-token";
87
+
84
88
  fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
85
89
  generate(gen, cmd, cmd.get_name().to_string(), &mut io::stdout());
86
90
  }
@@ -163,9 +167,9 @@ fn app() -> Command {
163
167
  .arg(
164
168
  Arg::new("auth_token")
165
169
  .value_name("AUTH_TOKEN")
166
- .long("auth-token")
170
+ .long(AUTH_TOKEN_ARG)
167
171
  .global(true)
168
- .value_parser(value_parser!(AuthToken))
172
+ .value_parser(auth_token_parser)
169
173
  .help("Use the given Sentry auth token."),
170
174
  )
171
175
  .arg(
@@ -280,8 +284,26 @@ pub fn execute() -> Result<()> {
280
284
  info!(
281
285
  "sentry-cli was invoked with the following command line: {}",
282
286
  env::args()
283
- .map(|a| format!("\"{a}\""))
284
- .collect::<Vec<String>>()
287
+ // Check whether the previous argument is "--auth-token"
288
+ .zip(
289
+ iter::once(false)
290
+ .chain(env::args().map(|arg| arg == format!("--{AUTH_TOKEN_ARG}")))
291
+ )
292
+ .map(|(a, is_auth_token_arg)| {
293
+ let redact_replacement = "[REDACTED]";
294
+
295
+ // Redact anything that comes after --auth-token
296
+ let redacted = if is_auth_token_arg {
297
+ Cow::Borrowed(redact_replacement)
298
+ } else if a.starts_with(&format!("--{AUTH_TOKEN_ARG}=")) {
299
+ Cow::Owned(format!("--{AUTH_TOKEN_ARG}={redact_replacement}"))
300
+ } else {
301
+ redact_token_from_string(&a, redact_replacement)
302
+ };
303
+
304
+ format!("\"{redacted}\"")
305
+ })
306
+ .collect::<Vec<_>>()
285
307
  .join(" ")
286
308
  );
287
309
 
@@ -135,7 +135,7 @@ fn fetch_release_artifacts(org: &str, project: &str, release: &str) -> Result<Ve
135
135
  }
136
136
 
137
137
  // Try to find an artifact which matches the path part of the url extracted from the stacktrace frame,
138
- // prefixed with the default `~/`, which is a "glob-like" pattern for matchin any hostname.
138
+ // prefixed with the default `~/`, which is a "glob-like" pattern for matching any hostname.
139
139
  fn find_matching_artifact(artifacts: &[Artifact], path: &str) -> Result<Artifact> {
140
140
  let full_match = artifacts.iter().find(|a| a.name == path);
141
141
  let partial_match = artifacts
@@ -348,7 +348,7 @@ fn resolve_sourcemap_url(abs_path: &str, sourcemap_location: &str) -> Result<Str
348
348
  .map_err(|e| e.into())
349
349
  }
350
350
 
351
- // Unify url to be prefixed with the default `~/`, which is a "glob-like" pattern for matchin any hostname.
351
+ // Unify url to be prefixed with the default `~/`, which is a "glob-like" pattern for matching any hostname.
352
352
  //
353
353
  // We only need the `pathname` portion of the url, so if it's absolute, just extract it.
354
354
  // If it's relative however, parse any random url (example.com) and join it with our relative url,
@@ -12,6 +12,7 @@ use ini::Ini;
12
12
  use lazy_static::lazy_static;
13
13
  use log::{debug, info, set_max_level, warn};
14
14
  use parking_lot::Mutex;
15
+ use secrecy::ExposeSecret;
15
16
  use sentry::types::Dsn;
16
17
 
17
18
  use crate::constants::CONFIG_INI_FILE_PATH;
@@ -181,8 +182,11 @@ impl Config {
181
182
  self.cached_base_url = token_url.to_string();
182
183
  }
183
184
 
184
- self.ini
185
- .set_to(Some("auth"), "token".into(), val.to_string());
185
+ self.ini.set_to(
186
+ Some("auth"),
187
+ "token".into(),
188
+ val.raw().expose_secret().clone(),
189
+ );
186
190
  }
187
191
  Some(Auth::Key(ref val)) => {
188
192
  self.ini
@@ -339,7 +343,7 @@ impl Config {
339
343
  .get_from(Some("defaults"), "org")
340
344
  .map(str::to_owned)
341
345
  .ok_or_else(|| {
342
- format_err!("An organization slug is required (provide with --org)")
346
+ format_err!("An organization ID or slug is required (provide with --org)")
343
347
  }),
344
348
  (None, Some(cli_org)) => Ok(cli_org),
345
349
  (Some(token_org), None) => Ok(token_org.to_string()),
@@ -407,7 +411,7 @@ impl Config {
407
411
  .get_from(Some("defaults"), "project")
408
412
  .map(str::to_owned)
409
413
  })
410
- .ok_or_else(|| format_err!("A project slug is required (provide with --project)"))
414
+ .ok_or_else(|| format_err!("A project ID or slug is required (provide with --project)"))
411
415
  }
412
416
 
413
417
  /// Return the default pipeline env.
@@ -4,7 +4,10 @@ use clap::{Arg, ArgAction, Command};
4
4
 
5
5
  fn validate_org(v: &str) -> Result<String, String> {
6
6
  if v.contains('/') || v == "." || v == ".." || v.contains(' ') {
7
- Err("Invalid value for organization. Use the URL slug and not the name!".to_string())
7
+ Err(
8
+ "Invalid value for organization. Use the URL slug or the ID and not the name!"
9
+ .to_string(),
10
+ )
8
11
  } else {
9
12
  Ok(v.to_owned())
10
13
  }
@@ -19,7 +22,7 @@ pub fn validate_project(v: &str) -> Result<String, String> {
19
22
  || v.contains('\t')
20
23
  || v.contains('\r')
21
24
  {
22
- Err("Invalid value for project. Use the URL slug and not the name!".to_string())
25
+ Err("Invalid value for project. Use the URL slug or the ID and not the name!".to_string())
23
26
  } else {
24
27
  Ok(v.to_owned())
25
28
  }
@@ -90,7 +93,7 @@ impl<'a: 'b, 'b> ArgExt for Command {
90
93
  .short('o')
91
94
  .value_parser(validate_org)
92
95
  .global(true)
93
- .help("The organization slug"),
96
+ .help("The organization ID or slug."),
94
97
  )
95
98
  }
96
99
 
@@ -107,7 +110,7 @@ impl<'a: 'b, 'b> ArgExt for Command {
107
110
  } else {
108
111
  ArgAction::Set
109
112
  })
110
- .help("The project slug."),
113
+ .help("The project ID or slug."),
111
114
  )
112
115
  }
113
116
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  use super::AuthTokenPayload;
4
4
  use super::{OrgAuthToken, UserAuthToken};
5
- use std::fmt::{Display, Formatter, Result};
5
+ use secrecy::SecretString;
6
6
 
7
7
  /// Represents a (soft) validated Sentry auth token.
8
8
  #[derive(Debug, Clone)]
@@ -21,8 +21,14 @@ impl AuthToken {
21
21
  }
22
22
 
23
23
  /// Retrieves a reference to the auth token string.
24
- fn as_str(&self) -> &str {
25
- self.0.as_str()
24
+ pub fn raw(&self) -> &SecretString {
25
+ self.0.raw()
26
+ }
27
+
28
+ /// Returns whether the auth token follows a recognized format. If this function returns false,
29
+ /// that indicates that the auth token might not be valid, since it failed our soft validation.
30
+ pub fn format_recognized(&self) -> bool {
31
+ !matches!(self.0, AuthTokenInner::Unknown(_))
26
32
  }
27
33
  }
28
34
 
@@ -42,14 +48,6 @@ impl From<&str> for AuthToken {
42
48
  }
43
49
  }
44
50
 
45
- impl Display for AuthToken {
46
- /// Displays the auth token string.
47
- fn fmt(&self, f: &mut Formatter<'_>) -> Result {
48
- write!(f, "{}", self.as_str())?;
49
- Ok(())
50
- }
51
- }
52
-
53
51
  /// Inner representation of AuthToken type, containing all possible auth token types.
54
52
  #[derive(Debug, Clone)]
55
53
  enum AuthTokenInner {
@@ -60,7 +58,7 @@ enum AuthTokenInner {
60
58
  User(UserAuthToken),
61
59
 
62
60
  /// Represents an auth token that has an unrecognized format.
63
- Unknown(String),
61
+ Unknown(SecretString),
64
62
  }
65
63
 
66
64
  impl AuthTokenInner {
@@ -72,10 +70,7 @@ impl AuthTokenInner {
72
70
  } else if let Ok(user_auth_token) = UserAuthToken::try_from(auth_string.clone()) {
73
71
  AuthTokenInner::User(user_auth_token)
74
72
  } else {
75
- log::warn!(
76
- "Unrecognized auth token format!\n\tHint: Did you copy your token correctly?"
77
- );
78
- AuthTokenInner::Unknown(auth_string)
73
+ AuthTokenInner::Unknown(auth_string.into())
79
74
  }
80
75
  }
81
76
 
@@ -89,10 +84,10 @@ impl AuthTokenInner {
89
84
  }
90
85
 
91
86
  /// Retrieves a reference to the auth token string.
92
- fn as_str(&self) -> &str {
87
+ fn raw(&self) -> &SecretString {
93
88
  match self {
94
- AuthTokenInner::Org(ref org_auth_token) => org_auth_token.as_str(),
95
- AuthTokenInner::User(user_auth_token) => user_auth_token.as_str(),
89
+ AuthTokenInner::Org(ref org_auth_token) => org_auth_token.raw(),
90
+ AuthTokenInner::User(user_auth_token) => user_auth_token.raw(),
96
91
  AuthTokenInner::Unknown(auth_string) => auth_string,
97
92
  }
98
93
  }
@@ -3,10 +3,12 @@
3
3
  mod auth_token_impl;
4
4
  mod error;
5
5
  mod org_auth_token;
6
+ mod redacting;
6
7
  mod user_auth_token;
7
8
 
8
9
  pub use auth_token_impl::AuthToken;
9
10
  pub use org_auth_token::AuthTokenPayload;
11
+ pub use redacting::redact_token_from_string;
10
12
 
11
13
  use error::{AuthTokenParseError, Result};
12
14
  use org_auth_token::OrgAuthToken;
@@ -14,3 +16,6 @@ use user_auth_token::UserAuthToken;
14
16
 
15
17
  #[cfg(test)]
16
18
  mod test;
19
+
20
+ const ORG_AUTH_TOKEN_PREFIX: &str = "sntrys_";
21
+ const USER_TOKEN_PREFIX: &str = "sntryu_";
@@ -1,13 +1,13 @@
1
- use super::{AuthTokenParseError, Result};
1
+ use super::{AuthTokenParseError, Result, ORG_AUTH_TOKEN_PREFIX};
2
+ use secrecy::SecretString;
2
3
  use serde::{Deserialize, Deserializer};
3
4
 
4
- const ORG_AUTH_TOKEN_PREFIX: &str = "sntrys_";
5
5
  const ORG_TOKEN_SECRET_BYTES: usize = 32;
6
6
 
7
7
  /// Represents a valid org auth token.
8
8
  #[derive(Debug, Clone)]
9
9
  pub struct OrgAuthToken {
10
- auth_string: String,
10
+ auth_string: SecretString,
11
11
  pub payload: AuthTokenPayload,
12
12
  }
13
13
 
@@ -76,6 +76,8 @@ impl OrgAuthToken {
76
76
  return Err(AuthTokenParseError);
77
77
  }
78
78
 
79
+ let auth_string = auth_string.into();
80
+
79
81
  Ok(OrgAuthToken {
80
82
  auth_string,
81
83
  payload,
@@ -83,7 +85,7 @@ impl OrgAuthToken {
83
85
  }
84
86
 
85
87
  /// Retrieves a reference to the auth token string.
86
- pub fn as_str(&self) -> &str {
88
+ pub fn raw(&self) -> &SecretString {
87
89
  &self.auth_string
88
90
  }
89
91
  }
@@ -0,0 +1,66 @@
1
+ use crate::utils::auth_token::{AuthToken, ORG_AUTH_TOKEN_PREFIX, USER_TOKEN_PREFIX};
2
+ use lazy_static::lazy_static;
3
+ use regex::Regex;
4
+ use std::borrow::Cow;
5
+
6
+ pub fn redact_token_from_string<'r>(to_redact: &'r str, replacement: &'r str) -> Cow<'r, str> {
7
+ if AuthToken::from(to_redact).format_recognized() {
8
+ // The string is itself an auth token, redact the whole thing
9
+ Cow::Borrowed(replacement)
10
+ } else {
11
+ // Redact any substrings consisting of non-whitespace characters starting with the org or
12
+ // user auth token prefixes, as these are likely to be auth tokens. Note that this will
13
+ // miss old-style user auth tokens that do not contain the prefix.
14
+ lazy_static! {
15
+ static ref AUTH_TOKEN_REGEX: Regex = Regex::new(&format!(
16
+ "(({ORG_AUTH_TOKEN_PREFIX})|({USER_TOKEN_PREFIX}))\\S+"
17
+ ))
18
+ .unwrap();
19
+ }
20
+
21
+ AUTH_TOKEN_REGEX.replace_all(to_redact, replacement)
22
+ }
23
+ }
24
+
25
+ #[cfg(test)]
26
+ mod tests {
27
+ use crate::utils::auth_token::redacting::redact_token_from_string;
28
+
29
+ #[test]
30
+ fn test_no_redaction() {
31
+ let input = "This string should remain unchanged.";
32
+
33
+ let output = redact_token_from_string(input, "[REDACTED]");
34
+ assert_eq!(input, output);
35
+ }
36
+
37
+ #[test]
38
+ fn test_redaction() {
39
+ let input = "Here we have a usersntryu_user/auth@#tok3n\\which_should.be3redacted and a sntrys_org_auth_token,too.";
40
+ let expected_output = "Here we have a user[REDACTED] and a [REDACTED]";
41
+
42
+ let output = redact_token_from_string(input, "[REDACTED]");
43
+ assert_eq!(expected_output, output);
44
+ }
45
+
46
+ #[test]
47
+ fn test_redaction_org_auth_token() {
48
+ let input = "sntrys_\
49
+ eyJpYXQiOjE3MDQyMDU4MDIuMTk5NzQzLCJ1cmwiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJyZ\
50
+ Wdpb25fdXJsIjoiaHR0cDovL2xvY2FsaG9zdDo4MDAwIiwib3JnIjoic2VudHJ5In0=_\
51
+ lQ5ETt61cHhvJa35fxvxARsDXeVrd0pu4/smF4sRieA";
52
+ let expected_output = "[REDACTED]";
53
+
54
+ let output = redact_token_from_string(input, "[REDACTED]");
55
+ assert_eq!(expected_output, output);
56
+ }
57
+
58
+ #[test]
59
+ fn test_redaction_old_user_token() {
60
+ let input = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
61
+ let expected_output = "[REDACTED]";
62
+
63
+ let output = redact_token_from_string(input, "[REDACTED]");
64
+ assert_eq!(expected_output, output);
65
+ }
66
+ }