@sentry/cli 1.72.0 → 1.73.0

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  "You know what they say. Fool me once, strike one, but fool me twice... strike three." — Michael Scott
4
4
 
5
+ ## Unreleased
6
+
7
+ ## 1.73.0
8
+
9
+ * feat: Add checksum validation for installed binaries (set `SENTRYCLI_SKIP_CHECKSUM_VALIDATION` to opt-out) (#1123)
10
+ * fix: Detect unwind and debug information in files linked with `gold` (#1124)
11
+ * ref: Silence progress bar in CI environments by default (#1122)
12
+
13
+ ## 1.72.2
14
+
15
+ * feat: Use default xcode values for plist struct (#1111)
16
+ * fix: Fixes a panic when inspecting debug files larger than 4GB (#1117)
17
+ * ref: Update log message when bundle ID is missing (#1113)
18
+
19
+ ## 1.72.1
20
+
21
+ * fix: Dont include `debug_id` during assemble when not PDBs are not supported (#1110)
22
+ * ref: Remove all release files instantaneously with `--all` flag (#1108)
23
+
5
24
  ## 1.72.0
6
25
 
7
26
  * feat: Add `CUSTOM_HEADER` support to JS wrapper (#1077)
package/checksums.txt ADDED
@@ -0,0 +1,9 @@
1
+ sentry-cli-Darwin-arm64=8a66ee7778d6e0fa1d26e89e69d9ede39b1a3d935c6dbbaeed07242e7608ad10
2
+ sentry-cli-Darwin-universal=392fdfa1af128420a513de98e596b83c08e7242be4f3435e6f2b9665dec15811
3
+ sentry-cli-Darwin-x86_64=7386d7c1e4e9e756f4f95eb6b2202945063961eb585dd2433ad8c268fe880988
4
+ sentry-cli-Linux-aarch64=9ae2a36e491dfea3b6c113ec5084680867a361a58671e21eb163fa553a8dde15
5
+ sentry-cli-Linux-armv7=5b3f36babcc10c232783ec76f48eac9a8ec2a77db7626604127799c2f445c73f
6
+ sentry-cli-Linux-i686=90eaf2f259999becdf2d127489c71b2c33952b0c67f13215306abecbdf893ddd
7
+ sentry-cli-Linux-x86_64=ad9b2a8caf3f05cfc51024a9d10650dbffaa005abd8f407801f318c4924d366d
8
+ sentry-cli-Windows-i686.exe=e691047003f9e10a1e1a6d689010d076374952ab2cd08afb2252f9d9da5437d2
9
+ sentry-cli-Windows-x86_64.exe=31b212913c1ffa0bfc1cf6823d0bcb699adf4bf0ef9f9c6e2218215aba9bc3ec
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "1.72.0",
3
+ "version": "1.73.0",
4
4
  "description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/",
5
5
  "homepage": "https://docs.sentry.io/hosted/learn/cli/",
6
6
  "license": "BSD-3-Clause",
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "https-proxy-agent": "^5.0.0",
39
39
  "mkdirp": "^0.5.5",
40
- "node-fetch": "^2.6.0",
40
+ "node-fetch": "^2.6.7",
41
41
  "npmlog": "^4.1.2",
42
42
  "progress": "^2.0.3",
43
43
  "proxy-from-env": "^1.1.0"
@@ -48,8 +48,9 @@ function shouldRenderProgressBar() {
48
48
  const silentFlag = process.argv.some(v => v === '--silent');
49
49
  const silentConfig = process.env.npm_config_loglevel === 'silent';
50
50
  const silentEnv = process.env.SENTRY_NO_PROGRESS_BAR;
51
+ const ciEnv = process.env.CI === 'true';
51
52
  // If any of possible options is set, skip rendering of progress bar
52
- return !(silentFlag || silentConfig || silentEnv);
53
+ return !(silentFlag || silentConfig || silentEnv || ciEnv);
53
54
  }
54
55
 
55
56
  function getDownloadUrl(platform, arch) {
@@ -149,6 +150,45 @@ function getTempFile(cached) {
149
150
  .slice(2)}.tmp`;
150
151
  }
151
152
 
153
+ function validateChecksum(tempPath, name) {
154
+ let storedHash;
155
+ try {
156
+ const checksums = fs.readFileSync(path.join(__dirname, '../checksums.txt'), 'utf8');
157
+ const entries = checksums.split('\n');
158
+ for (let i = 0; i < entries.length; i++) {
159
+ const [key, value] = entries[i].split('=');
160
+ if (key === name) {
161
+ storedHash = value;
162
+ break;
163
+ }
164
+ }
165
+ } catch (e) {
166
+ npmLog.info(
167
+ 'Checksums are generated when the package is published to npm. They are not available directly in the source repository. Skipping validation.'
168
+ );
169
+ return;
170
+ }
171
+
172
+ if (!storedHash) {
173
+ npmLog.info(`Checksum for ${name} not found, skipping validation.`);
174
+ return;
175
+ }
176
+
177
+ const currentHash = crypto
178
+ .createHash('sha256')
179
+ .update(fs.readFileSync(tempPath))
180
+ .digest('hex');
181
+
182
+ if (storedHash !== currentHash) {
183
+ fs.unlinkSync(tempPath);
184
+ throw new Error(
185
+ `Checksum validation for ${name} failed.\nExpected: ${storedHash}\nReceived: ${currentHash}`
186
+ );
187
+ } else {
188
+ npmLog.info('Checksum validation passed.');
189
+ }
190
+ }
191
+
152
192
  function downloadBinary() {
153
193
  const arch = os.arch();
154
194
  const platform = os.platform();
@@ -216,6 +256,9 @@ function downloadBinary() {
216
256
  .on('error', e => reject(e))
217
257
  .on('close', () => resolve());
218
258
  }).then(() => {
259
+ if (process.env.SENTRYCLI_SKIP_CHECKSUM_VALIDATION !== '1') {
260
+ validateChecksum(tempPath, name);
261
+ }
219
262
  fs.copyFileSync(tempPath, cachedPath);
220
263
  fs.copyFileSync(tempPath, outputPath);
221
264
  fs.unlinkSync(tempPath);