Skip to content

Commit

Permalink
chore: scanner friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjake committed Jan 4, 2022
1 parent bdeedcc commit a5c90b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ await connect({
host: 'example.com',
port: 3306,
user: 'john',
password: 'doe',
password: 'inputYourCodeHere',
db: 'tmall',
models: [Shop]
});
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ await connect({
host: 'example.com',
port: 3306,
user: 'john',
password: 'doe',
password: 'inputYourCodeHere',
db: 'tmall',
models: [Shop]
});
Expand Down
6 changes: 3 additions & 3 deletions test/unit/adapters/sequelize.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,20 +1342,20 @@ describe('Model scope', () => {
describe('Model.init with getterMethods and setterMethods', () => {

const algorithm = 'aes-256-ctr';
const password = '12Tvzr3p67VC61jMw54rIHu1545x4Tlx';
const key = '12Tvzr3p67VC61jMw54rIHu1545x4Tlx';
const iv = 'iceiceiceiceicei';

function encrypt(text){
if (!text) return null;
const cipher = crypto.createCipheriv(algorithm, password, iv);
const cipher = crypto.createCipheriv(algorithm, key, iv);
let crypted = cipher.update(text,'utf8','hex');
crypted += cipher.final('hex');
return crypted;
}

function decrypt(text){
if (!text) return null;
const decipher = crypto.createCipheriv(algorithm, password, iv);
const decipher = crypto.createCipheriv(algorithm, key, iv);
let dec = decipher.update(text,'hex','utf8');
dec += decipher.final('utf8');
return dec;
Expand Down
12 changes: 6 additions & 6 deletions test/unit/drivers/abstract/logger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ describe('=> Logger', function() {
it('should mask values when INSERT', async () => {
const sets = {
name: 'Golum',
password: 'My precious',
confirm_password: 'My precious',
password: 'inputYourCodeHere',
confirm_password: 'inputYourCodeHere',
};
const sql = logger.format(
'INSERT INTO users (name, password, confirm_password) VALUES (?, ?, ?)',
Expand All @@ -29,8 +29,8 @@ describe('=> Logger', function() {
it('should mask values when INSERT ... ON DUPLICATE KEY UPDATE ...', async () => {
const sets = {
id: 1,
password: 'hakuna matata',
confirm_password: 'hakuna matata',
password: 'inputYourCodeHere',
confirm_password: 'inputYourCodeHere',
};
const sql = logger.format(
heresql(`
Expand All @@ -51,8 +51,8 @@ describe('=> Logger', function() {

it('should mask values when UPDATE', async () => {
const sets = {
password: 'hakuna matata',
confirm_password: 'hakuna matata',
password: 'inputYourCodeHere',
confirm_password: 'inputYourCodeHere',
};
const sql = logger.format(
'UPDATE users SET password = ?, confirm_password = ? WHERE id = ?',
Expand Down

0 comments on commit a5c90b3

Please sign in to comment.