Skip to content

Commit

Permalink
Upgrade secret-scrubber-js to 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed May 8, 2024
1 parent 389ba74 commit a94fd10
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"engineStrict": true,
"dependencies": {
"@zapier/secret-scrubber": "^1.0.8",
"@zapier/secret-scrubber": "^1.1.1",
"bluebird": "3.7.2",
"content-disposition": "0.5.4",
"dotenv": "12.0.4 ",
Expand Down
45 changes: 45 additions & 0 deletions packages/core/test/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const prepareTestRequest = ({
reqBody = {},
resBody = {},
reqQueryParams = '',
resHeaders = {},
} = {}) =>
prepareRequestLog(
{
Expand All @@ -37,6 +38,7 @@ const prepareTestRequest = ({
status: 200,
headers: {
'content-type': 'application/json',
...resHeaders,
},

content: resBody,
Expand Down Expand Up @@ -335,6 +337,49 @@ describe('logger', () => {
]);
});

it('should replace set-cookie header', async () => {
const event = {
method: 'authentication.sessionConfig.perform',
};
const logger = createlogger(event, options);

const { message, data } = prepareTestRequest({
reqBody: {
username: 'user1234',
password: 'password1234',
},
resBody: '"new_access_token_is_secret"',
resHeaders: {
'set-cookie':
'_sid=1234567890; domain=password1234.com; HttpOnly; Secure',
},
});

logger(message, data);
const response = await logger.end(1000);
response.status.should.eql(200);

response.content.logs.should.deepEqual([
{
message: '200 POST http://example.com',
data: {
log_type: 'http',
request_type: 'devplatform-outbound',
request_url: 'http://example.com',
request_method: 'POST',
request_headers: 'accept: application/json',
request_data:
'{"username":"user1234","password":":censored:12:60562c5b6c:"}',
request_via_client: true,
response_status_code: 200,
response_headers:
'content-type: application/json\nset-cookie: :censored:58:a5f1e7f860:',
response_content: '":censored:26:fea118210f:"',
},
},
]);
});

it('should leave response content of null uncensored', async () => {
const event = {
method: 'authentication.sessionConfig.perform',
Expand Down
40 changes: 8 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2300,11 +2300,12 @@
js-yaml "^3.10.0"
tslib "^2.4.0"

"@zapier/secret-scrubber@^1.0.8":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@zapier/secret-scrubber/-/secret-scrubber-1.0.8.tgz#f757ea475243c408789803b99f6c5fc0a5465187"
integrity sha512-6vVhOwlwfbETEhLCS+eY/OzXLANzf71O1XnfPpKAx29JMxZV4S1Sefp9F5jBQGTmL0BVYu34rNS7Uej1x/rcsQ==
"@zapier/secret-scrubber@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@zapier/secret-scrubber/-/secret-scrubber-1.1.1.tgz#ccb7b75e320d5662efd2ff23eb66cf7fea764a39"
integrity sha512-4w0lsz8lpsl/+c1u8h5LDNioCdLloPobryH7voawgO6hoPkwJxYhXB1xZYLAxycFSZmCXajRmzZyzma26pdIOQ==
dependencies:
create-hash "^1.2.0"
lodash.isplainobject "^4.0.6"

"@zkochan/[email protected]":
Expand Down Expand Up @@ -10790,7 +10791,7 @@ [email protected]:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0":
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -10808,15 +10809,6 @@ string-width@^1.0.1:
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"

"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
Expand Down Expand Up @@ -10918,7 +10910,7 @@ [email protected]:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -10953,13 +10945,6 @@ strip-ansi@^6.0.0:
dependencies:
ansi-regex "^5.0.0"

strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -11963,7 +11948,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -11990,15 +11975,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit a94fd10

Please sign in to comment.