Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 1c1282f

Browse files
author
Sachin Maheshwari
committed
changes in serverless and removing conf vars which not needed
1 parent c94ff2a commit 1c1282f

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

config/default.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
module.exports = {
2-
// The valid issuer of tokens, a json array contains valid issuer.
3-
VALID_ISSUERS: process.env.VALID_ISSUERS || '["https://api.topcoder-dev.com", "https://api.topcoder.com", "https://topcoder-dev.auth0.com/", "https://auth.topcoder-dev.com/"]',
4-
// Auth0 token cache time, used to get TC M2M token
5-
TOKEN_CACHE_TIME: process.env.TOKEN_CACHE_TIME,
62
// Proxy Auth0 URL, used to get TC M2M token
73
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,
84
// Auth0 URL, used to get TC M2M token

serverless.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
service: lambda-member-v5user-skill-sync
2-
disabledDeprecations:
3-
- LOAD_VARIABLES_FROM_ENV_FILES
42
provider:
53
name: aws
64
stage: ${opt:stage, 'dev'}
5+
role: ${file(./config/${self:provider.stage}.json):LAMBDA_ROLE}
76
runtime: nodejs12.x
87
memorySize: 256
9-
timeout: 100
10-
lambdaHashingVersion: 20201221
11-
12-
package:
13-
patterns:
14-
- src/**
15-
- '!.git/**'
16-
- '!test/**'
17-
18-
plugins:
19-
- serverless-dotenv-plugin
8+
timeout: 15
9+
environment:
10+
DB_AGGREGATED_SKILLS_STREAM: ${file(./config/${self:provider.stage}.json):DB_AGGREGATED_SKILLS_STREAM}
11+
DB_ENTERED_SKILLS_STREAM: ${file(./config/${self:provider.stage}.json):DB_ENTERED_SKILLS_STREAM}
12+
TC_API_URL: ${file(./config/${self:provider.stage}.json):TC_API_URL}
13+
AUTH0_PROXY_SERVER_URL: ${file(./config/${self:provider.stage}.json):AUTH0_PROXY_SERVER_URL}
14+
AUTH0_URL: ${file(./config/${self:provider.stage}.json):AUTH0_URL}
15+
AUTH0_TOPCODER_AUDIENCE: ${file(./config/${self:provider.stage}.json):AUTH0_TOPCODER_AUDIENCE}
16+
AUTH0_UBAHN_AUDIENCE: ${file(./config/${self:provider.stage}.json):AUTH0_UBAHN_AUDIENCE}
17+
AUTH0_CLIENT_ID: ${file(./config/${self:provider.stage}.json):AUTH0_CLIENT_ID}
18+
AUTH0_CLIENT_SECRET: ${file(./config/${self:provider.stage}.json):AUTH0_CLIENT_SECRET}
19+
UBAHN_API_URL: ${file(./config/${self:provider.stage}.json):UBAHN_API_URL}
20+
SKILL_PROVIDER_NAME: ${file(./config/${self:provider.stage}.json):SKILL_PROVIDER_NAME}
2021

2122
functions:
22-
syncSkills:
23-
handler: index.handle
24-
name: member-v5user-skill-sync
25-
description: member-v5user-skill-sync
23+
handler:
24+
handler: index.handle
25+
name: member-v5user-skill-sync # optional, Deployed Lambda name
26+
description: member-v5user-skill-sync # The description of your function.
27+
events:
28+
- http: ANY /

src/common/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ const m2mAuth = require('tc-core-library-js').auth.m2m
1010

1111
const m2mForTopcoder = m2mAuth({
1212
AUTH0_AUDIENCE: config.AUTH0_TOPCODER_AUDIENCE,
13-
..._.pick(config, ['AUTH0_URL', 'TOKEN_CACHE_TIME', 'AUTH0_CLIENT_ID', 'AUTH0_CLIENT_SECRET', 'AUTH0_PROXY_SERVER_URL'])
13+
..._.pick(config, ['AUTH0_URL', 'AUTH0_CLIENT_ID', 'AUTH0_CLIENT_SECRET', 'AUTH0_PROXY_SERVER_URL'])
1414
})
1515

1616
const m2mForUbahn = m2mAuth({
1717
AUTH0_AUDIENCE: config.AUTH0_UBAHN_AUDIENCE,
18-
..._.pick(config, ['AUTH0_URL', 'TOKEN_CACHE_TIME', 'AUTH0_CLIENT_ID', 'AUTH0_CLIENT_SECRET', 'AUTH0_PROXY_SERVER_URL'])
18+
..._.pick(config, ['AUTH0_URL', 'AUTH0_CLIENT_ID', 'AUTH0_CLIENT_SECRET', 'AUTH0_PROXY_SERVER_URL'])
1919
})
2020

2121
/**

0 commit comments

Comments
 (0)