amplify-cli-logger
Advanced tools
Comparing version 1.2.2 to 1.2.3-lazyload-no-graphql15.0
@@ -6,2 +6,18 @@ # Change Log | ||
## [1.2.3-lazyload-no-graphql15.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-logger@1.2.2...amplify-cli-logger@1.2.3-lazyload-no-graphql15.0) (2023-01-25) | ||
### Bug Fixes | ||
* update redactor scanning logic ([#11622](https://github.com/aws-amplify/amplify-cli/issues/11622)) ([c7bb7cc](https://github.com/aws-amplify/amplify-cli/commit/c7bb7cca89662019b6d5dfd789d08945d64d2fb0)) | ||
### Reverts | ||
* Revert "chore: fixing main to dev merge conflicts (#11696)" ([00fec46](https://github.com/aws-amplify/amplify-cli/commit/00fec4608096390b5ae2563b5c69453cd48bfa45)), closes [#11696](https://github.com/aws-amplify/amplify-cli/issues/11696) | ||
## [1.2.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-logger@1.2.1...amplify-cli-logger@1.2.2) (2023-01-03) | ||
@@ -8,0 +24,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.stringMasker = exports.Redactor = void 0; | ||
const containsToRedact = ['key', 'id', 'password', 'name', 'arn', 'address', 'app', 'bucket', 'token']; | ||
const containsToRedact = ['key', 'id', 'password', 'name', 'arn', 'address', 'app', 'bucket', 'token', 'secret']; | ||
const quotes = '\\\\?"'; | ||
@@ -6,0 +6,0 @@ const keyMatcher = `\\w*?(${containsToRedact.join('|')})\\w*?`; |
{ | ||
"name": "amplify-cli-logger", | ||
"version": "1.2.2", | ||
"version": "1.2.3-lazyload-no-graphql15.0", | ||
"description": "Amplify CLI Logger", | ||
@@ -47,3 +47,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "dea54cd4bc5745ba7645808964d29f5a395fe6f7" | ||
"gitHead": "4d58b3ca509e522fe90c13344a5ec40a6993dd30" | ||
} |
@@ -1,3 +0,3 @@ | ||
import _ from 'lodash'; | ||
import { Redactor } from '../Redactor'; | ||
describe('input-redaction', () => { | ||
@@ -9,7 +9,24 @@ const input = { | ||
SMS: { Enabled: true }, | ||
Email: { Enabled: true, FromAddress: 'xxx@amzon.com', Identity: 'identityArn', RoleArn: 'roleArn' }, | ||
APNS: { Enabled: true, DefaultAuthenticationMethod: 'Certificate', P12FilePath: 'p12filePath', Password: 'p12FilePasswordIfAny' }, | ||
Email: { | ||
Enabled: true, | ||
// eslint-disable-next-line spellcheck/spell-checker | ||
FromAddress: 'xxx@amzon.com', | ||
Identity: 'identityArn', | ||
RoleArn: 'roleArn', | ||
}, | ||
APNS: { | ||
Enabled: true, | ||
DefaultAuthenticationMethod: 'Certificate', | ||
P12FilePath: 'p12filePath', | ||
Password: 'p12FilePasswordIfAny', | ||
}, | ||
// eslint-disable-next-line spellcheck/spell-checker | ||
FCM: { Enabled: true, ApiKey: 'fcmapikey' }, | ||
}, | ||
}, | ||
auth: { | ||
resourceName: { | ||
hostedUIProviderCreds: '"ProviderName":"Facebook","client_id":"facebookClientIdTest","client_secret":"facebookClientSecretTest"', | ||
}, | ||
}, | ||
}, | ||
@@ -21,5 +38,4 @@ }; | ||
const redactedInput = JSON.parse(redactedInputString); | ||
const path = ['categories', 'notifications', 'Pinpoint']; | ||
const redactedPinpoint = _.get(redactedInput, path); | ||
const originalPinpoint = _.get(input, path); | ||
const redactedPinpoint = redactedInput.categories.notifications.Pinpoint; | ||
const originalPinpoint = input.categories.notifications.Pinpoint; | ||
expect(redactedPinpoint.APNS.Password).not.toEqual(originalPinpoint.APNS.Password); | ||
@@ -30,3 +46,8 @@ expect(redactedPinpoint.Email.FromAddress).not.toEqual(originalPinpoint.Email.FromAddress); | ||
expect(redactedPinpoint.FCM.ApiKey).not.toEqual(originalPinpoint.FCM.ApiKey); | ||
const redactedAuth = redactedInput.categories.auth.resourceName; | ||
expect(redactedAuth.hostedUIProviderCreds).toMatchInlineSnapshot( | ||
`"\\"ProviderName\\":\\"[***]book\\",\\"client_id\\":\\"[***]ntIdTest\\",\\"client_secret\\":\\"[***]SecretTest\\""`, | ||
); | ||
}); | ||
}); |
@@ -1,2 +0,2 @@ | ||
const containsToRedact = ['key', 'id', 'password', 'name', 'arn', 'address', 'app', 'bucket', 'token']; | ||
const containsToRedact = ['key', 'id', 'password', 'name', 'arn', 'address', 'app', 'bucket', 'token', 'secret']; | ||
const quotes = '\\\\?"'; | ||
@@ -28,2 +28,3 @@ const keyMatcher = `\\w*?(${containsToRedact.join('|')})\\w*?`; | ||
// replace value using string Masker | ||
// eslint-disable-next-line no-param-reassign | ||
arg = arg?.replace(val, stringMasker); | ||
@@ -30,0 +31,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
113283
687
1