Skip to content

Commit a9bb684

Browse files
author
vikasrohit
authored
Merge pull request #79 from topcoder-platform/revert-77-revert-75-revert-74-feature/m2m-token
Revert "Reapplying "m2m token support""
2 parents f1c4fed + e7424db commit a9bb684

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

config/custom-environment-variables.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"AUTH_SECRET": "AUTH_SECRET",
2+
"authSecret": "AUTH_SECRET",
33
"logLevel": "LOG_LEVEL",
44
"version": "APP_VERSION",
55
"captureLogs": "CAPTURE_LOGS",
@@ -37,7 +37,7 @@
3737
"minPoolSize": "DB_MIN_POOL_SIZE"
3838
},
3939
"analyticsKey": "ANALYTICS_KEY",
40-
"VALID_ISSUERS": "VALID_ISSUERS",
40+
"validIssuers": "VALID_ISSUERS",
4141
"jwksUri": "JWKS_URI",
4242
"busApiUrl": "BUS_API_URL",
4343
"busApiToken": "BUS_API_TOKEN"

config/default.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"AUTH_SECRET": "secret",
2+
"authSecret": "secret",
3+
"authDomain": "topcoder-dev.com",
34
"logLevel": "info",
45
"version": "v4",
56
"captureLogs": "false",
@@ -41,7 +42,8 @@
4142
"idleTimeout": 1000
4243
},
4344
"analyticsKey": "",
44-
"VALID_ISSUERS": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
45+
"validIssuers": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
46+
"jwksUri": "",
4547
"busApiUrl": "http://api.topcoder-dev.com",
4648
"busApiToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicHJvamVjdC1zZXJ2aWNlIiwiaWF0IjoxNTEyNzQ3MDgyLCJleHAiOjE1MjEzODcwODJ9.PHuNcFDaotGAL8RhQXQMdpL8yOKXxjB5DbBIodmt7RE",
4749
"HEALTH_CHECK_URL": "_health"

config/development.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"authDomain": "topcoder-dev.com",
23
"pubsubQueueName": "dev.project.service",
34
"pubsubExchangeName": "dev.projects",
45
"attachmentsS3Bucket": "topcoder-dev-media"

config/test.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"AUTH_SECRET": "secret",
2+
"authSecret": "secret",
3+
"authDomain": "topcoder-dev.com",
34
"logLevel": "debug",
45
"captureLogs": "false",
56
"logentriesToken": "",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"pg": "^4.5.5",
5656
"pg-native": "^1.10.0",
5757
"sequelize": "^3.23.0",
58-
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.3",
58+
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.2",
5959
"traverse": "^0.6.6",
6060
"urlencode": "^1.1.0"
6161
},

src/util.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ _.assignIn(util, {
7070
* @return {boolean} true/false
7171
*/
7272
hasRole: (req, role) => {
73-
const isMachineToken = _.get(req, 'authUser.isMachine', false);
74-
if (isMachineToken) return true;
7573
let roles = _.get(req, 'authUser.roles', []);
7674
roles = roles.map(s => s.toLowerCase());
7775
return _.indexOf(roles, role.toLowerCase()) >= 0;
@@ -83,8 +81,6 @@ _.assignIn(util, {
8381
* @return {boolean} true/false
8482
*/
8583
hasRoles: (req, roles) => {
86-
const isMachineToken = _.get(req, 'authUser.isMachine', false);
87-
if (isMachineToken) return true;
8884
let authRoles = _.get(req, 'authUser.roles', []);
8985
authRoles = authRoles.map(s => s.toLowerCase());
9086
return _.intersection(authRoles, roles.map(r => r.toLowerCase())).length > 0;
@@ -105,8 +101,6 @@ _.assignIn(util, {
105101
* @return {boolean} true/false
106102
*/
107103
hasAdminRole: (req) => {
108-
const isMachineToken = _.get(req, 'authUser.isMachine', false);
109-
if (isMachineToken) return true;
110104
let roles = _.get(req, 'authUser.roles', []);
111105
roles = roles.map(s => s.toLowerCase());
112106
return _.intersection(roles, ADMIN_ROLES.map(r => r.toLowerCase())).length > 0;

0 commit comments

Comments
 (0)