Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Koa framework also gives us some convenience ctx.request and ctx.respose objects that are designed to be used for web applications but they are equally useful for handling web services.

Logical Architecture

Design

The OpenHIM-core will use Koa middleware to act on HTTP requests and Responses. Koa allows you to setup a stack of middleware, each middleware is called in order and gets an opportunity to do something with the request (going down the stack) and is then suspended. Once the end of the stack is reached Koa traverses back up the stack allowing each middelware to do something with the response.

Each row in the diagram representing the OepnHIM-core is a middleware component. Each of the components of the OpenHIM-core will be described further in the following sections. The OpenHIM-core will also have a REST API that will allow a web UI to be created for easy of management. 

Image AddedImage Removed

Authentication and Authorization

...

The OpenHIM only performs simple authorisation based on the path that is being requested. It should be able to restrict access to certain paths to applications with particular roles. Roles are identified in each applications details. The channel description shown in the router section below shows that each path has one or more allowed roles or applications associated with it. The authorisation component will check if the authenticated application has the authority to access the current path. If authorized the request will be passed on, else, the request will be denied and a HTTP 401 message will be returned.

PersistenceMessage persistence

Each request and response will be persisted so that it can be logged and so that error'd transaction may be re-run. This persistence occurs at two stages. Firstly, once a request is authenticated and authorised and secondly once a response has been received from the external service. All the metadata about a transaction is stored in a single document in MongoDB. The relevant sections are just updated as new information is received. The structure of this information is shown below.

...