OpenFn / adaptors

The new home for OpenFn adaptors; re-usable connectors for the most common DPGs and DPI building blocks.
GNU General Public License v3.0
5 stars 8 forks source link

Implement OpenFn adaptor for OpenLIMS #533

Closed christad92 closed 1 month ago

christad92 commented 4 months ago

Implement an OpenFn adaptor for OpenLIMS that will enable users to authorize connection via Oauth and perform requisition and fulfillment operations.

To start, this adaptor should:

Later we can consider adding more abstraction and specific helper functions. Use cases we want to support...

Requisition (API):

Fulfilment (API):

Demo Server Credentials: URL: https://demo-v3.openlmis.org/#!/home username: administrator password: password

OpenLMIS API requests are authenticated by an OAuth2 access token passed as a query parameter. See a sample API request below:

GET /api/reports/templates/requisitions/{id}?access_token=
9a556033-ed13-4dde-9561-158469d15134

URI Parameters
id: required (string)

Query Parameters
access_token: required (string)
OAuth2 access token

Link to test OAuth2 token here: https://github.com/OpenLMIS/openlmis-auth/blob/master/src/main/resources/db/demo-data/auth.api_keys.csv

aleksa-krolls commented 3 months ago

@christad92 @taylordowns2000 we cannot work on an adaptor unless we have credentials to a demo system. I don't see demo system login details provided for OpenLMIS. Do you have a way to get these?

christad92 commented 2 months ago

@aleksa-krolls we have access to a demo system with tokens we can use to authenticate API requests. The issue description has been updated with the credentials.

aleksa-krolls commented 2 months ago

@christad92 great! Noted for backlog planning in the coming 2 weeks

aleksa-krolls commented 1 month ago

hey @mtuchi after you go through the other issues prioritized in this sprint, pls confirm if you'll have space to also take on this issue... and whether this issue should be broken up into smaller issues. (For example, I think we might create follow-up issues to implement specific helper functions for the Fufilment and Requisition use cases that Ayodele detailed above.) I think you'll have space this week, but let @AishaHassen know on Monday and she can adjust the sprint scheduling accordingly.

If you have any questions about about this app and the adaptor requirements, then pls sync with Ayodele. FYI we will probably use this adaptor later this month for upcoming work for New Horizons.

mtuchi commented 1 month ago

@aleksa-krolls I think this issue should be split into 3 small issues

  1. https://github.com/OpenFn/adaptors/issues/670
  2. https://github.com/OpenFn/adaptors/issues/671
  3. https://github.com/OpenFn/adaptors/issues/672
aleksa-krolls commented 1 month ago

hey @christad92 - fyi last week @mtuchi has implemented the first issue from the list below, which is in review. We don't think it's a good idea to work on the 2nd and 3rd issues until we actually have a real use case to work on to help us understand these APIs and integration use cases. With some upcoming NH client work, I think we will get to these other helper functions soon - but for now, we are going to put them in backlog.

@aleksa-krolls I think this issue should be split into 3 small issues

  1. openLMIS Add OAuth support and generic helpers (get, post, put) #670
  2. openLMIS Requisition operations #671
  3. openLMIS Fulfillment operations  #672
christad92 commented 1 month ago

Yeah, this works for me and thanks for the update.

christad92 commented 1 month ago

@mtuchi What is the status of the OpenLIMS Adaptor? Is it ready to be published?

mtuchi commented 1 month ago

@christad92 still under review #675

josephjclark commented 1 month ago

Hi @aleksa-krolls @christad92

The basic generic adaptor is nearly ready, but I have a question about auth

Right now the adpator either accepts an oauth token or a "user based" token (username & password). OpenLMIS also supports API keys which allows auth with a code, rather than user/password pair.

Are we happy to just support user tokens or do we want to add API token support too? Do we know what NH will need?

aleksa-krolls commented 1 month ago

@josephjclark we don't know what NH needs... and I suspect it will be months before we learn about nigeria-specific requirements, so I'd vote to cut a release for what we have now, and then add an issue to backlog for apiKey support

josephjclark commented 1 month ago

That's great, just wanted to check it. No need for an issue at this stage. Thanks!