Closed yatharthranjan closed 7 years ago
@dennyverbeeck I understand what you are saying but the data fetched from MP needs to be formatted in Rest API to make it consistent. For example, the login
in MP is subjectId
in Rest API. Also the data fetched from MP is just of the subjects. This information will be used by the REST API to query the MongoDb for more results using the subject data received from MP. This is just to get subject information from MP so that the Rest API does not use the find() query on MongoDb as it is not performant.
The requirement here is not to just output the data from MP endpoint. We also want to process it and use it for other purposes. What do you think?
Aha ok, there were always discussions about 'forwarding requests to MP', i did not know there were requirements to translate some of the properties as well. Ok never mind then :smile: Btw, not sure if you know about it but, all the way at the bottom of the Readme for MP there is a small section on generating a complete client for MP automatically. Sorry if you didn't know about it, i didn't realize it. But it can be useful moving forward!
@dennyverbeeck I saw the client after someone mentioned it in a meeting, but by then I had already implemented this. We can look into it when we need more functionality but for now I think this PR should suffice. Thanks for the feedback. The client seems really helpful 👍
@blootsvoets if you have a spare moment could you please review this one.
This PR is to resolve the issue #33 and is in accordance with the guidelines specified in #42
Some major changes are as follows-
oauth-client-util
library for authentication with the Management Portal.mp_info.yml
build-utility.gradle
file to includemp_info.yml
in integration and end-to-end tests.The following endpoints are active-
/api/mp/subjects
Get all subjects/api/mp/subjects/{id}
Get subject by id/api/mp/projects/{name}/subjects
Get subjects from a project/api/mp/projects/{name}
Get project by nameThe following have been implemented but do not provided intended results because of this issue of MP issue 18. Once this issue is resolved, this should work.
/api/mp/projects
Get all projectsA separate endpoint (
/mp
) has been created for exposing data retrieved from the MP for now. This can later be merged into (/api
) Here {id} of subject in Rest-API = {login} of subject in MP All of this data is retrieved from the MP and handled and exposed through REST-API.