Versions Compared

Key

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

...


Client_typePurposeaccess_over_broker

Auth_FE

Auth frontEnd
MSPMedical service providerTRUE
MISMedical information system
NHS_AdminAdmin console of the NHS
MITHRIL ADMINAdmin console of the Mithril itself
PHARMACYPharmacyTRUE
UADDRESSES ADMINAdmin of UA adresses


Send & Get API-key

MIS All clients (all client_types) must be send (mandatory) own API API-key as a attribute `API-key` in HEADER all request.

Example:

Code Block
curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer mF_9.B5f-4.1JqM" \
     --header "API-key: d09vQUFlWTZ6Q0RXRDJISldUOVQ3dz09" \
     --data-binary "{
  \"medication_request_request\": { 
....


Manage MIS transfer scope 

For some clients (client_type = MIS) which provide transfer for call API - we need mandatory validate possibility access to API endpoints.

Proposed use new column `validate_broker_scopes` (boolean) in table `client_types`.

Client_typePurposevalidate_broker_scopes

Auth_FE

Auth frontEnd
MSPMedical service provider
MISMedical information systemTRUE
NHS_AdminAdmin console of the NHS
MITHRIL ADMINAdmin console of the Mithril itself
PHARMACYPharmacy
UADDRESSES ADMINAdmin of UA adresses

 

For clients (client_type = MIS) on which we will check access for call API endpoint - we need describe the list `broker_scopes`. 
Proposed manage & store list  `broker_scopes` in attribute `settings` in table `clients`. 

Example:

Code Block
languagejs
{
  "allowed_grant_types": [
    	"password",
    	"access_token"
  ],
  "broker_scopes": 
  		"legal_entity:read
		 declaration:read
		 employee:read"
}

In case of need complex disconnect MIS for transfer of call API endpoints - we need full clear him `broker_scopes`.

Validate MIS transfer scope

When MSP call specific API endpoint over (transfer) MIS we need validate possibility to access.

  1. Get `client_id` from `token`
  2. Read `clients` for `client_id`.   (further in the text - `REQUEST_CLIENT`)
  3. Read  `API-key` from  `API-key`
  4. Validate  `API-key`.
    1. Validate exists `secret` in table `clients`
      1. if invalid - return error  "Not found API-key!" (!!! TBD)
    2. Read `client_types` for REQUEST_CLIENTValidate `access_over_broker`=TRUE 
      1. If invalid - break validation.
    3. Read `clients` with `secret`(API-key) in header.  (further in the text - `BROKER_CLIENT`)
      Read `client_types` for this BROKER_CLIENT
      Validate `validate_broker_scopes`=TRUE 
      1. if invalid - return error  "Incorrect API-key!" (!!! TBD)
  5. Get `broker_scopes` from  `settings` in table `clients` for `BROKER_CLIENT`
  6. Read needed scopes for call API Endpoint (read from GateWay configuration)
  7. Validate exist all needed scopes in `broker_scopes` of `BROKER_CLIENT`.
    1. if invalid - return error "Conflict !" (!!! TBD)