From f2a3c28fbf12064a6070609804746f8f8b23d1c9 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Wed, 25 Mar 2020 10:57:39 +0100 Subject: [PATCH] fix: Revert bad string replacements Fixes changes introduced in 8c60b1e55b234bb419f8c5a7c1dcc4dd6f2524b6. Global string replacement was too eager and broke things in raven-node (although development head is actually in the 4.x branch). Other than that, this commit fixes doc comments and an entry in packages/typescript/package.json. --- packages/raven-node/CHANGELOG.md | 2 +- packages/raven-node/lib/client.js | 2 +- packages/raven-node/lib/utils.js | 2 +- packages/raven-node/test/exit/capture.js | 2 +- .../raven-node/test/exit/capture_callback.js | 2 +- .../exit/capture_with_second_domain_error.js | 2 +- .../test/exit/capture_with_second_error.js | 2 +- .../raven-node/test/exit/domain_capture.js | 2 +- .../test/exit/domain_capture_callback.js | 2 +- .../exit/domain_capture_with_second_error.js | 2 +- .../test/exit/domain_throw_on_send.js | 2 +- .../raven-node/test/exit/throw_on_fatal.js | 2 +- .../raven-node/test/exit/throw_on_send.js | 2 +- .../raven-node/test/manual/context-memory.js | 2 +- .../raven-node/test/manual/express-patient.js | 2 +- packages/raven-node/test/raven.client.js | 20 +++++++++---------- packages/raven-node/test/raven.utils.js | 10 +++++----- packages/types/src/dsn.ts | 4 ++-- packages/typescript/package.json | 2 +- packages/utils/src/dsn.ts | 4 ++-- packages/utils/src/misc.ts | 2 +- 21 files changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/raven-node/CHANGELOG.md b/packages/raven-node/CHANGELOG.md index f533d2fc0c76..6c3dd490ca44 100644 --- a/packages/raven-node/CHANGELOG.md +++ b/packages/raven-node/CHANGELOG.md @@ -31,7 +31,7 @@ - fix: Remove a redundant try-catch block (#445) - fix: Do not override context when capturing non-error exceptions (#444) - fix: Update stack-trace to handle spaces in paths (#437) -- docs: Remove private _DSNs from the docs (#447) +- docs: Remove private DSNs from the docs (#447) - docs: Update Usage docs to include Domains in Promise support (#438) ## 2.4.2 - 2018-02-27 diff --git a/packages/raven-node/lib/client.js b/packages/raven-node/lib/client.js index e273b1c26046..af5a020ef70e 100644 --- a/packages/raven-node/lib/client.js +++ b/packages/raven-node/lib/client.js @@ -341,7 +341,7 @@ extend(Raven.prototype, { 'X-Sentry-Auth': utils.getAuthHeader( timestamp, self.dsn.public_key, - self.dsn.private __key + self.dsn.private_key ), 'Content-Type': 'application/octet-stream', 'Content-Length': message.length diff --git a/packages/raven-node/lib/utils.js b/packages/raven-node/lib/utils.js index ea72f00fa0e7..21d02d8a931b 100644 --- a/packages/raven-node/lib/utils.js +++ b/packages/raven-node/lib/utils.js @@ -188,7 +188,7 @@ module.exports.parseDSN = function parseDSN(dsn) { }; if (parsed.auth.split(':')[1]) { - response.private __key = parsed.auth.split(':')[1]; + response.private_key = parsed.auth.split(':')[1]; } if (~response.protocol.indexOf('+')) { diff --git a/packages/raven-node/test/exit/capture.js b/packages/raven-node/test/exit/capture.js index 281f2eb384fa..fdb0537fc293 100644 --- a/packages/raven-node/test/exit/capture.js +++ b/packages/raven-node/test/exit/capture.js @@ -1,6 +1,6 @@ 'use strict'; var Raven = require('../../'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/capture_callback.js b/packages/raven-node/test/exit/capture_callback.js index b761d84f1f25..db5664ff8d02 100644 --- a/packages/raven-node/test/exit/capture_callback.js +++ b/packages/raven-node/test/exit/capture_callback.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/capture_with_second_domain_error.js b/packages/raven-node/test/exit/capture_with_second_domain_error.js index a27a45193907..f9770dde4e16 100644 --- a/packages/raven-node/test/exit/capture_with_second_domain_error.js +++ b/packages/raven-node/test/exit/capture_with_second_domain_error.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/capture_with_second_error.js b/packages/raven-node/test/exit/capture_with_second_error.js index 97038859d21a..d228c8ebe2c9 100644 --- a/packages/raven-node/test/exit/capture_with_second_error.js +++ b/packages/raven-node/test/exit/capture_with_second_error.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/domain_capture.js b/packages/raven-node/test/exit/domain_capture.js index a3fb33d5b3c3..ce189eb1714d 100644 --- a/packages/raven-node/test/exit/domain_capture.js +++ b/packages/raven-node/test/exit/domain_capture.js @@ -1,6 +1,6 @@ 'use strict'; var Raven = require('../../'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/domain_capture_callback.js b/packages/raven-node/test/exit/domain_capture_callback.js index 74aa0fb4f3e1..0bdc71cc3261 100644 --- a/packages/raven-node/test/exit/domain_capture_callback.js +++ b/packages/raven-node/test/exit/domain_capture_callback.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/domain_capture_with_second_error.js b/packages/raven-node/test/exit/domain_capture_with_second_error.js index 9c70c551fc47..d155b2a461da 100644 --- a/packages/raven-node/test/exit/domain_capture_with_second_error.js +++ b/packages/raven-node/test/exit/domain_capture_with_second_error.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/domain_throw_on_send.js b/packages/raven-node/test/exit/domain_throw_on_send.js index f0d4a84bea57..45ec3ccfe4b0 100644 --- a/packages/raven-node/test/exit/domain_throw_on_send.js +++ b/packages/raven-node/test/exit/domain_throw_on_send.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; Raven.config(dsn).install(function(err, sendErr) { assert.ok(err instanceof Error); diff --git a/packages/raven-node/test/exit/throw_on_fatal.js b/packages/raven-node/test/exit/throw_on_fatal.js index 9a8b2a9a2125..b6757f6db9b2 100644 --- a/packages/raven-node/test/exit/throw_on_fatal.js +++ b/packages/raven-node/test/exit/throw_on_fatal.js @@ -1,6 +1,6 @@ 'use strict'; var Raven = require('../../'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var nock = require('nock'); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/exit/throw_on_send.js b/packages/raven-node/test/exit/throw_on_send.js index 13d609842f96..021799684f5d 100644 --- a/packages/raven-node/test/exit/throw_on_send.js +++ b/packages/raven-node/test/exit/throw_on_send.js @@ -1,7 +1,7 @@ 'use strict'; var Raven = require('../../'); var assert = require('assert'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; Raven.config(dsn).install(function(err, sendErr) { assert.ok(err instanceof Error); diff --git a/packages/raven-node/test/manual/context-memory.js b/packages/raven-node/test/manual/context-memory.js index 851c87d7f5c2..0643794b6853 100644 --- a/packages/raven-node/test/manual/context-memory.js +++ b/packages/raven-node/test/manual/context-memory.js @@ -1,6 +1,6 @@ 'use strict'; var Raven = require('../../'); -Raven.config('https://public:private _@app.getsentry.com/12345').install(); +Raven.config('https://public:private@app.getsentry.com/12345').install(); // We create a bunch of contexts, capture some breadcrumb data in all of them, // then watch memory usage. It'll go up to ~40 megs then after 10 or 20 seconds diff --git a/packages/raven-node/test/manual/express-patient.js b/packages/raven-node/test/manual/express-patient.js index 4a432091bd67..0d1acba66cb9 100644 --- a/packages/raven-node/test/manual/express-patient.js +++ b/packages/raven-node/test/manual/express-patient.js @@ -5,7 +5,7 @@ console.log = function () {}; var Raven = require('../../'); -var sentryDsn = 'https://public:private _@app.getsentry.com/269'; +var sentryDsn = 'https://public:private@app.getsentry.com/269'; Raven.config(sentryDsn, { autoBreadcrumbs: true }).install(); diff --git a/packages/raven-node/test/raven.client.js b/packages/raven-node/test/raven.client.js index 9434aec87150..bd0ba591b187 100644 --- a/packages/raven-node/test/raven.client.js +++ b/packages/raven-node/test/raven.client.js @@ -11,7 +11,7 @@ var raven = require('../'), zlib = require('zlib'), child_process = require('child_process'); -var dsn = 'https://public:private _@app.getsentry.com/269'; +var dsn = 'https://public:private@app.getsentry.com/269'; var _oldConsoleWarn = console.warn; @@ -53,7 +53,7 @@ describe('raven.Client', function() { var expected = { protocol: 'https', public_key: 'public', - private __key: 'private _', + private_key: 'private', host: 'app.getsentry.com', path: '/', project_id: '269', @@ -70,7 +70,7 @@ describe('raven.Client', function() { var expected = { protocol: 'https', public_key: 'abc', - private __key: '123', + private_key: '123', host: 'app.getsentry.com', path: '/', project_id: '1', @@ -86,7 +86,7 @@ describe('raven.Client', function() { var expected = { protocol: 'https', public_key: 'abc', - private __key: '123', + private_key: '123', host: 'app.getsentry.com', path: '/', project_id: '1', @@ -208,7 +208,7 @@ describe('raven.Client', function() { }); it('should allow for attaching stacktrace', function(done) { - var dsn = 'https://public:private _@app.getsentry.com:8443/269'; + var dsn = 'https://public:private@app.getsentry.com:8443/269'; var client = new raven.Client(dsn, { stacktrace: true }); @@ -317,7 +317,7 @@ describe('raven.Client', function() { .post('/api/269/store/', '*') .reply(200, 'OK'); - var dsn = 'https://public:private _@app.getsentry.com:8443/269'; + var dsn = 'https://public:private@app.getsentry.com:8443/269'; var client = new raven.Client(dsn); client.on('logged', function() { scope.done(); @@ -364,7 +364,7 @@ describe('raven.Client', function() { return 'OK'; }); - var dsn = 'https://public:private _@app.getsentry.com:8443/269'; + var dsn = 'https://public:private@app.getsentry.com:8443/269'; var client = new raven.Client(dsn); client.on('logged', function() { scope.done(); @@ -998,13 +998,13 @@ describe('raven.Client', function() { var expected = { protocol: 'https', public_key: 'public', - private __key: 'private _', + private_key: 'private', host: 'app.getsentry.com', path: '/', project_id: '269', port: 443 }; - var dsn = 'heka+https://public:private _@app.getsentry.com/269'; + var dsn = 'heka+https://public:private@app.getsentry.com/269'; var client = new raven.Client(dsn, { transport: 'some_heka_instance' }); @@ -1013,7 +1013,7 @@ describe('raven.Client', function() { }); it('should use a DSN subpath when sending requests', function(done) { - var dsn = 'https://public:private _@app.getsentry.com/some/path/269'; + var dsn = 'https://public:private@app.getsentry.com/some/path/269'; var client = new raven.Client(dsn); var scope = nock('https://app.getsentry.com') diff --git a/packages/raven-node/test/raven.utils.js b/packages/raven-node/test/raven.utils.js index 6b6f5a1b33e2..c747847892a5 100644 --- a/packages/raven-node/test/raven.utils.js +++ b/packages/raven-node/test/raven.utils.js @@ -30,7 +30,7 @@ describe('raven.utils', function() { var expected = { protocol: 'https', public_key: '8769c40cf49c4cc58b51fa45d8e2d166', - private __key: '296768aa91084e17b5ac02d3ad5bc7e7', + private_key: '296768aa91084e17b5ac02d3ad5bc7e7', host: 'app.getsentry.com', path: '/', project_id: '269', @@ -46,7 +46,7 @@ describe('raven.utils', function() { var expected = { protocol: 'http', public_key: '8769c40cf49c4cc58b51fa45d8e2d166', - private __key: '296768aa91084e17b5ac02d3ad5bc7e7', + private_key: '296768aa91084e17b5ac02d3ad5bc7e7', host: 'mysentry.com', path: '/some/other/path/', project_id: '269', @@ -62,7 +62,7 @@ describe('raven.utils', function() { var expected = { protocol: 'https', public_key: '8769c40cf49c4cc58b51fa45d8e2d166', - private __key: '296768aa91084e17b5ac02d3ad5bc7e7', + private_key: '296768aa91084e17b5ac02d3ad5bc7e7', host: 'mysentry.com', path: '/some/other/path/', project_id: '269', @@ -91,7 +91,7 @@ describe('raven.utils', function() { var expected = { protocol: 'https', public_key: '8769c40cf49c4cc58b51fa45d8e2d166', - private __key: '296768aa91084e17b5ac02d3ad5bc7e7', + private_key: '296768aa91084e17b5ac02d3ad5bc7e7', host: 'mysentry.com', path: '/some/other/path/', project_id: '269', @@ -100,7 +100,7 @@ describe('raven.utils', function() { dsn.should.eql(expected); }); - it('should parse DSN without private _key', function() { + it('should parse DSN without private key', function() { var dsn = raven.utils.parseDSN( 'https://8769c40cf49c4cc58b51fa45d8e2d166@mysentry.com:8443/some/other/path/269' ); diff --git a/packages/types/src/dsn.ts b/packages/types/src/dsn.ts index 1f109de1910e..c697c275e553 100644 --- a/packages/types/src/dsn.ts +++ b/packages/types/src/dsn.ts @@ -7,7 +7,7 @@ export interface DsnComponents { protocol: DsnProtocol; /** Public authorization key. */ user: string; - /** private _authorization key (deprecated, optional). */ + /** Private authorization key (deprecated, optional). */ pass?: string; /** Hostname of the Sentry instance. */ host: string; @@ -28,7 +28,7 @@ export interface Dsn extends DsnComponents { * Renders the string representation of this Dsn. * * By default, this will render the public representation without the password - * component. To get the deprecated private _representation, set `withPassword` + * component. To get the deprecated private representation, set `withPassword` * to true. * * @param withPassword When set to true, the password will be included. diff --git a/packages/typescript/package.json b/packages/typescript/package.json index a9687a1af38c..db418053c11a 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/getsentry/raven-js/tree/master/packages/typescript", "author": "Sentry", "license": "BSD-3-Clause", - "private _": false, + "private": false, "publishConfig": { "access": "public" }, diff --git a/packages/utils/src/dsn.ts b/packages/utils/src/dsn.ts index 29807dd68d67..54149036f8a8 100644 --- a/packages/utils/src/dsn.ts +++ b/packages/utils/src/dsn.ts @@ -14,7 +14,7 @@ export class Dsn implements DsnComponents { public protocol!: DsnProtocol; /** Public authorization key. */ public user!: string; - /** private _authorization key (deprecated, optional). */ + /** Private authorization key (deprecated, optional). */ public pass!: string; /** Hostname of the Sentry instance. */ public host!: string; @@ -40,7 +40,7 @@ export class Dsn implements DsnComponents { * Renders the string representation of this Dsn. * * By default, this will render the public representation without the password - * component. To get the deprecated private _representation, set `withPassword` + * component. To get the deprecated private representation, set `withPassword` * to true. * * @param withPassword When set to true, the password will be included. diff --git a/packages/utils/src/misc.ts b/packages/utils/src/misc.ts index a2541549afab..cc63caa8f165 100644 --- a/packages/utils/src/misc.ts +++ b/packages/utils/src/misc.ts @@ -21,7 +21,7 @@ interface SentryGlobal { } /** - * Requires a module which is protected _against bundler minification. + * Requires a module which is protected against bundler minification. * * @param request The module path to resolve */