Skip to content

allow normal topcoder members to create jobs and update/delete the jobs #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

imcaizheng
Copy link
Contributor

Test updated access rule for jobs

Postman collection is updated. Please run the following requests in Postman from top to bottom for verification.

jobs > create job with booking manager
jobs > create job with member success
jobs > put job with member 403
jobs > put job with member success
jobs > patch job with member 403
jobs > patch job with member success
jobs > delete job with member 403
jobs > delete job with member success

Test if user not found issue got fixed in JobService

You should first create a member token with userId that can be found in v3/users while missing in v5/users.
Then update the member token in Postman environment and run request jobs > create job with member success for verification.

For example, I was using this token for test:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik5VSkZORGd4UlRVME5EWTBOVVkzTlRkR05qTXlRamxETmpOQk5UYzVRVUV3UlRFeU56TTJRUSJ9.eyJodHRwczovL3RvcGNvZGVyLWRldi5jb20vcm9sZXMiOlsiVG9wY29kZXIgVXNlciJdLCJodHRwczovL3RvcGNvZGVyLWRldi5jb20vdXNlcklkIjoiMTA2NjIwIiwiaHR0cHM6Ly90b3Bjb2Rlci1kZXYuY29tL2hhbmRsZSI6InBzaGFoX21hbmFnZXIiLCJodHRwczovL3RvcGNvZGVyLWRldi5jb20vdXNlcl9pZCI6ImF1dGgwfDQwMTUyODU2IiwiaHR0cHM6Ly90b3Bjb2Rlci1kZXYuY29tL3Rjc3NvIjoiNDAxNTI4NTZ8ODEzNGY0OGViZTExYTg0OGEzNzU5ZTVlZjllOTJmMjE0NjkyZTIxMTMwNDBjODJiNWQ4ZjU4MWM2ZGZjY2M4OCIsImh0dHBzOi8vdG9wY29kZXItZGV2LmNvbS9hY3RpdmUiOnRydWUsIm5pY2tuYW1lIjoicHNoYWhfbWFuYWdlciIsIm5hbWUiOiJ2aWthcy5hZ2Fyd2FsK3BzaGFoX21hbmFnZXJAdG9wY29kZXIuY29tIiwicGljdHVyZSI6Imh0dHBzOi8vcy5ncmF2YXRhci5jb20vYXZhdGFyLzkyYWZiMmYwZWQ1MmZkZmFlMWYzNzEwMjFhZTY1MDEzP3M9NDgwJnI9cGcmZD1odHRwcyUzQSUyRiUyRmNkbi5hdXRoMC5jb20lMkZhdmF0YXJzJTJGdmkucG5nIiwidXBkYXRlZF9hdCI6IjIwMjAtMTAtMjRUMDg6Mjg6MjQuMTg0WiIsImVtYWlsIjoidmlrYXMuYWdhcndhbCtwc2hhaF9tYW5hZ2VyQHRvcGNvZGVyLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpc3MiOiJodHRwczovL2F1dGgudG9wY29kZXItZGV2LmNvbS8iLCJzdWIiOiJhdXRoMHw0MDE1Mjg1NiIsImF1ZCI6IkJYV1hVV25pbFZVUGROMDF0MlNlMjlUdzJaWU5HWnZIIiwiaWF0IjoxNjAzNTQzMzM4LCJleHAiOjMzMTYwNDUyNzM4LCJub25jZSI6IlIxQTJjell1VlRabWJqWkhSRzkyVmw5RFNVSjZVbGx2UVhjM1JIaDVTM1pXZFdaRGNETlhNRVoxWHc9PSJ9.tITquDuBrdiw40NFg2tkjwEPhWqHviS1LRV2FIhEASQ

The token is for userId 106620.

The jobs > create job with member success request ran successfully with the token and here is example console logs:

[2020-12-01T19:04:08.235Z] helper getUserIds DEBUG : response body: []
[2020-12-01T19:04:10.545Z] helper getTopcoderUserById DEBUG : response body: {"id":"-42f21d41:1761cae229a:-3cec","result":{"success":true,"status":200,"metadata":null,"content":[{"id":"106620","modifiedBy":null,"modifiedAt":"2010-03-17T17:14:05.000Z","createdBy":null,"createdAt":"2001-03-13T15:48:54.000Z","handle":"caveman","email":"email@domain.com.z","firstName":"F_NAME","lastName":"L_NAME","credential":{"activationCode":"1CZB3JWG","resetToken":null,"hasPassword":true},"status":"A","country":null,"regSource":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"roles":null,"ssoLogin":false,"active":true,"profile":null,"emailActive":true}]},"version":"v3"}
[2020-12-01T19:04:15.255Z] helper createUbhanUser DEBUG : response body: {"id":"2471d4ef-dc56-4e1d-8723-c3b27382710c","created":"2020-12-01T19:04:11.849Z","updated":null,"createdBy":null,"updatedBy":null,"handle":"caveman","firstName":"F_NAME","lastName":"L_NAME"}
[2020-12-01T19:04:17.080Z] helper createUserExternalProfile DEBUG : response body: {"id":"d1f5f25e-d902-4eb3-a822-11b8d438ea0f","created":"2020-12-01T19:04:16.722Z","updated":null,"createdBy":null,"updatedBy":null,"userId":"2471d4ef-dc56-4e1d-8723-c3b27382710c","organizationId":"36ed815b-3da1-49f1-a043-aaed0a4e81ad","externalId":"106620","uri":null,"isInactive":false}
[2020-12-01T19:04:17.153Z] helper postEvent DEBUG : Posting event to Kafka topic taas.job.create, {"projectId":111,"externalId":"1212","description":"Dummy Description","startDate":"2020-09-27T04:17:23.131Z","endDate":"2020-09-27T04:17:23.131Z","numPositions":13,"resourceType":"Dummy Resource Type","rateType":"hourly","skills":["23e00d92-207a-4b5b-b3c9-4c5662644941","7d076384-ccf6-4e43-a45d-1b24b1e624aa","cbac57a3-7180-4316-8769-73af64893158","a2b4bc11-c641-4a19-9eb7-33980378f82e"],"id":"ac14abf8-e591-402f-8f53-ce35fc80da14","createdAt":"2020-12-01T19:04:06.535Z","createdBy":"2471d4ef-dc56-4e1d-8723-c3b27382710c","status":"sourcing"}
[2020-12-01T19:04:19.766Z] JobService createJob DEBUG : output arguments: { projectId: 111, externalId: '1212', description: 'Dummy Description', startDate: '2020-09-27T04:17:23.131Z', endDate: '2020-09-27T04:17:23.131Z', numPositions: 13, resourceType: 'Dummy Resource Type', rateType: 'hourly', skills: [ '23e00d92-207a-4b5b-b3c9-4c5662644941', '7d076384-ccf6-4e43-a45d-1b24b1e624aa', 'cbac57a3-7180-4316-8769-73af64893158', 'a2b4bc11-c641-4a19-9eb7-33980378f82e' ], id: 'ac14abf8-e591-402f-8f53-ce35fc80da14', createdAt: '2020-12-01T19:04:06.535Z', createdBy: '2471d4ef-dc56-4e1d-8723-c3b27382710c', status: 'sourcing' }

Notice the createUbhanUser function was called since the userId 106620 initially was not in v5/users.

@nkumar-topcoder nkumar-topcoder merged commit 9fd9e66 into topcoder-platform:feature/integration-test-fix Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants