Skip to content

Commit 925b8dc

Browse files
Merge pull request #5592 from topcoder-platform/recruit-proxy-api-aggapi
Recruit proxy api and aggapi change
2 parents 717a07d + 4eeb45c commit 925b8dc

File tree

22 files changed

+1475
-130
lines changed

22 files changed

+1475
-130
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ workflows:
340340
filters:
341341
branches:
342342
only:
343-
- develop
343+
- recruit-proxy-api-aggapi
344344
# This is alternate dev env for parallel testing
345345
- "build-test":
346346
context : org-global
@@ -368,7 +368,7 @@ workflows:
368368
filters: &filters-staging
369369
branches:
370370
only:
371-
- develop
371+
- recruit-proxy-api-aggapi
372372
# Production builds are exectuted
373373
# when PR is merged to the master
374374
# Don't change anything in this configuration

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ ARG TC_M2M_GRANT_TYPE
6464
ARG TC_M2M_AUTH0_PROXY_SERVER_URL
6565
ARG TC_M2M_AUTH0_URL
6666
ARG AUTH_SECRET
67+
ARG VALID_ISSUERS
6768

6869
ARG COMMUNITY_APP_URL
6970
ARG GSHEETS_API_KEY
@@ -124,6 +125,7 @@ ENV TC_M2M_GRANT_TYPE=$TC_M2M_GRANT_TYPE
124125
ENV TC_M2M_AUTH0_PROXY_SERVER_URL=$TC_M2M_AUTH0_PROXY_SERVER_URL
125126
ENV TC_M2M_AUTH0_URL=$TC_M2M_AUTH0_URL
126127
ENV AUTH_SECRET=$AUTH_SECRET
128+
ENV VALID_ISSUERS=$VALID_ISSUERS
127129

128130
ENV CONTENTFUL_MANAGEMENT_TOKEN=$CONTENTFUL_MANAGEMENT_TOKEN
129131
ENV CONTENTFUL_EDU_SPACE_ID=$CONTENTFUL_EDU_SPACE_ID

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ docker build -t $TAG \
5151
--build-arg GROWSURF_CAMPAIGN_ID=$GROWSURF_CAMPAIGN_ID \
5252
--build-arg GSHEETS_API_KEY=$GSHEETS_API_KEY \
5353
--build-arg OPTIMIZELY_SDK_KEY=$OPTIMIZELY_SDK_KEY \
54-
--build-arg COMMUNITY_APP_URL=$COMMUNITY_APP_URL .
54+
--build-arg COMMUNITY_APP_URL=$COMMUNITY_APP_URL \
55+
--build-arg VALID_ISSUERS=$VALID_ISSUERS .
5556

5657
# Copies "node_modules" from the created image, if necessary for caching.
5758
docker create --name app $TAG

config/custom-environment-variables.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ module.exports = {
8383

8484
JWT_AUTH: {
8585
SECRET: 'AUTH_SECRET',
86+
AUTH_SECRET: 'AUTH_SECRET',
8687
VALID_ISSUERS: 'VALID_ISSUERS',
8788
},
8889

config/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,5 +429,5 @@ module.exports = {
429429
OPTIMIZELY: {
430430
SDK_KEY: '7V4CJhurXT3Y3bnzv1hv1',
431431
},
432-
PLATFORM_SITE_URL: 'https://platform.topcoder.com',
432+
PLATFORM_SITE_URL: 'https://platform.topcoder-dev.com',
433433
};

config/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,5 @@ module.exports = {
214214
TC_EDU_SEARCH_PATH: '/search',
215215
TC_EDU_SEARCH_BAR_MAX_RESULTS_EACH_GROUP: 3,
216216
ENABLE_RECOMMENDER: true,
217+
PLATFORM_SITE_URL: 'https://platform.topcoder.com',
217218
};

docs/postman/Community APP.postman_collection.json

Lines changed: 549 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"id": "c92b4b6b-ed64-4879-91de-e293128256b0",
3+
"name": "Community APP",
4+
"values": [
5+
{
6+
"key": "URL",
7+
"value": "localhost:3000/api",
8+
"enabled": true
9+
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bmlsVlVQZE4wMXQyU2UyOVR3MlpZTkdadkgiLCJpYXQiOjE2MjQxMjUzMzYsImV4cCI6MTYyNDEyODMzNiwibm9uY2UiOiJjVE5DTFVwRlpXMVJhMm94WkhSdE5WaGpVbk5IVkZGVFdWTjRiRzFCYVVaQ1dHZGpSVWhZVTB0RVZnPT0ifQ.SfKTYecx7A2qbqM3v8lJaC1GSdctNhkTx6laAhe2BJYVX5LdVL82ZM3_9yWqqZDPWHS9ku408Jt1DUMo5vRev34Av0iwJpYIT_4BbmMLeWQGQ3aRB78zp_emkZ5TE1vOnfSJvfsPoQoiLIwohyOUaDzz9MGdjrgYuSEAA1RGdjhVcamFlNNbR-lNMffnWYs0oWi89N5kgvv37JZjpDPAvQbotNT80Vs0JrLr1p71JLFcLFTQJ-bthFmt0922dj47-1MSjUQgOzFMN4JNjZKGtExyLGR7s_ipCQxg9lxHjMD-JNwg0liI20YGfTXZv9QQQ_K2jPkXiatHBQq_v2_Qjg",
13+
"enabled": true
14+
},
15+
{
16+
"key": "invalid_token_1",
17+
"value": "eyJ",
18+
"enabled": true
19+
},
20+
{
21+
"key": "invalid_token_2",
22+
"value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJjb3BpbG90IiwiQ29ubmVjdCBTdXBwb3J0Il0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJHaG9zdGFyIiwiZXhwIjoxNTQ5ODAwMDc3LCJ1c2VySWQiOiIxNTE3NDMiLCJpYXQiOjE1NDk3OTk0NzcsImVtYWlsIjoiZW1haWxAZG9tYWluLmNvbS56IiwianRpIjoiMTJjMWMxMGItOTNlZi00NTMxLTgzMDUtYmE2NjVmYzRlMWI0In0.2n8k9pb16sE7LOLF_7mjAvEVKgggzS-wS3_8n2-R4RU",
23+
"enabled": true
24+
},
25+
{
26+
"key": "invalid_token_3",
27+
"value": "",
28+
"enabled": true
29+
},
30+
{
31+
"key": "invalid_token_4",
32+
"value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJjb3BpbG90IiwiQ29ubmVjdCBTdXBwb3J0Il0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJHaG9zdGFyIiwiZXhwIjoxNTQ5ODAwMDc3LCJ1c2VySWQiOiIxNTE3NDMiLCJpYXQiOjE1NDk3OTk0NzcsImVtYWlsIjoiZW1haWxAZG9tYWluLmNvbS56IiwianRpIjoiMTJjMWMxMGItOTNlZi00NTMxLTgzMDUtYmE2NjVmYzRlMWI0In0.2n8k9pb16sE7LOLF_7mjAvEVKgggzS-wS3_8n2-R4RU",
33+
"enabled": true
34+
}
35+
],
36+
"_postman_variable_scope": "environment",
37+
"_postman_exported_at": "2021-06-19T18:52:31.778Z",
38+
"_postman_exported_using": "Postman/8.6.2"
39+
}

docs/postman/resume.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
My Resume

docs/swagger.yaml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Community APP
4+
description: Community APP
5+
version: 1.0.0
6+
servers:
7+
- url: http://local.topcoder-dev.com:3000
8+
tags:
9+
- name: Profile
10+
paths:
11+
/api/recruit/profile:
12+
get:
13+
tags:
14+
- Profile
15+
description: |
16+
Get Profile of current user
17+
18+
**Authorization** All topcoder members are allowed.
19+
security:
20+
- bearerAuth: []
21+
responses:
22+
"200":
23+
description: OK
24+
content:
25+
application/json:
26+
schema:
27+
type: array
28+
items:
29+
$ref: "#/components/schemas/Profile"
30+
"401":
31+
description: Not authenticated
32+
content:
33+
application/json:
34+
schema:
35+
$ref: "#/components/schemas/AuthError"
36+
"403":
37+
description: Forbidden
38+
content:
39+
application/json:
40+
schema:
41+
$ref: "#/components/schemas/AuthError"
42+
"404":
43+
description: Not Found
44+
content:
45+
application/json:
46+
schema:
47+
$ref: "#/components/schemas/Profile"
48+
"500":
49+
description: Internal Server Error
50+
content:
51+
text/plain::
52+
schema:
53+
type: string
54+
post:
55+
tags:
56+
- Profile
57+
description: |
58+
Update Profile details of current user
59+
**Authorization** All topcoder members are allowed.
60+
security:
61+
- bearerAuth: []
62+
requestBody:
63+
content:
64+
multipart/form-data:
65+
schema:
66+
$ref: "#/components/schemas/ProfileUpdate"
67+
responses:
68+
"204":
69+
description: OK
70+
"400":
71+
description: Bad request
72+
content:
73+
application/json:
74+
schema:
75+
oneOf:
76+
- $ref: "#/components/schemas/JoiError"
77+
- $ref: "#/components/schemas/Error"
78+
"401":
79+
description: Not authenticated
80+
content:
81+
application/json:
82+
schema:
83+
$ref: "#/components/schemas/AuthError"
84+
"403":
85+
description: Forbidden
86+
content:
87+
application/json:
88+
schema:
89+
$ref: "#/components/schemas/AuthError"
90+
"404":
91+
description: Not Found
92+
content:
93+
application/json:
94+
schema:
95+
$ref: "#/components/schemas/Error"
96+
"500":
97+
description: Internal Server Error
98+
content:
99+
text/plain::
100+
schema:
101+
type: string
102+
components:
103+
securitySchemes:
104+
bearerAuth:
105+
type: http
106+
scheme: bearer
107+
bearerFormat: JWT
108+
schemas:
109+
Profile:
110+
required:
111+
- availability
112+
properties:
113+
phone:
114+
type: string
115+
description: "The phone number of the user"
116+
example: "+1123226666"
117+
resume:
118+
type: string
119+
description: "The resume of the user"
120+
availability:
121+
type: boolean
122+
description: "The availability of the user"
123+
default: true
124+
example: true
125+
hasProfile:
126+
type: boolean
127+
description: "Whether has profile for the user"
128+
ProfileUpdate:
129+
required:
130+
- phone
131+
- availability
132+
- city
133+
- countryName
134+
properties:
135+
phone:
136+
type: string
137+
description: "The phone number of the user"
138+
example: "(123) 456-7890"
139+
city:
140+
type: string
141+
description: "The member's city"
142+
countryName:
143+
type: string
144+
description: "The member's country"
145+
resume:
146+
type: string
147+
format: binary
148+
description: "The resume file of the user"
149+
availability:
150+
type: boolean
151+
description: "The availability of the user"
152+
example: true
153+
Error:
154+
properties:
155+
error:
156+
type: boolean
157+
example: true
158+
status:
159+
type: integer
160+
example: 404
161+
url:
162+
type: string
163+
format: uri
164+
errObj:
165+
type: object
166+
JoiError:
167+
required:
168+
- message
169+
properties:
170+
message:
171+
type: string
172+
AuthError:
173+
properties:
174+
version:
175+
type: string
176+
result:
177+
type: object
178+
properties:
179+
success:
180+
type: boolean
181+
example: false
182+
status:
183+
type: integer
184+
example: 403
185+
content:
186+
type: object
187+
properties:
188+
message:
189+
type: string

0 commit comments

Comments
 (0)