Skip to content

Commit a04f2cf

Browse files
committed
chore: enable masking emails for invites
1 parent 39b2343 commit a04f2cf

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/util.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import config from 'config';
1616
import urlencode from 'urlencode';
1717
import elasticsearch from 'elasticsearch';
1818
import AWS from 'aws-sdk';
19-
// import jp from 'jsonpath';
19+
import jp from 'jsonpath';
2020
import Promise from 'bluebird';
2121
import models from './models';
2222

@@ -617,16 +617,7 @@ _.assignIn(util, {
617617
*
618618
* @return {Object} data has been processed
619619
*/
620-
maskInviteEmails: (jsonPath, data, req) => { // eslint-disable-line
621-
// temporary disable this feature, because it has some side effects
622-
// see relative issues:
623-
// - https://github.com/topcoder-platform/tc-project-service/issues/420
624-
// - https://github.com/appirio-tech/connect-app/issues/3412
625-
// - https://github.com/topcoder-platform/tc-project-service/issues/422
626-
// - https://github.com/appirio-tech/connect-app/issues/3413
627-
// uncomment code below, to enable masking emails again
628-
629-
/*
620+
maskInviteEmails: (jsonPath, data, req) => {
630621
const isAdmin = util.hasPermission({ topcoderRoles: ADMIN_ROLES }, req.authUser);
631622
if (isAdmin) {
632623
return data;
@@ -639,7 +630,6 @@ _.assignIn(util, {
639630
// isString or null
640631
return util.maskEmail(value);
641632
});
642-
*/
643633
return data;
644634
},
645635

src/util.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('Util method', () => {
4343
});
4444
});
4545

46-
xdescribe('maskInviteEmails', () => {
46+
describe('maskInviteEmails', () => {
4747
it('should mask emails when passing data like for a project list endpoint for non-admin user', () => {
4848
const list = [
4949
{
@@ -70,6 +70,7 @@ describe('Util method', () => {
7070
};
7171
util.maskInviteEmails('$..invites[?(@.email)]', list, res).should.deep.equal(list2);
7272
});
73+
7374
it('should mask emails when passing data like for a project details endpoint for non-admin user', () => {
7475
const detail = {
7576
id: 1,

0 commit comments

Comments
 (0)