DIGIT CORE
Search…
Adding MDMS Configuration
MDMS data is the master data used by the application. New modules with master data need to be configured inside the /data/<tenant>/ folder of the MDMS repo. Each tenant should have a unique ID and sub-tenants can be configured in the format state.cityA, state.cityB etc..Further hierarchies are also possible with tenancy.
For more information on MDMS see here. To read about how to design for MDMS, please see the design guide.
In the birth registration use case, we will use the following master data:
1. tenantId = "pb"
2. User roles - CITIZEN and EMPLOYEE roles configured in roles.json (see below section for more info)
3. Actions - URIs to be exposed via Zuul (see below section for more info)
4. Role-action mapping - for access control (see below section for more info)
Make sure to add data to the correct branch of the MDMS repository. i.e. if you have setup CD CI to deploy the DEV branch of the repository to the dev environment (default), then make sure to add the information in the DEV branch. If you are testing in staging or some other environment, make sure to add the master data to the corresponding branch of MDMS.
Create a folder called "pb" in the data folder of the MDMS repository "DEV" branch. You will have a new folder path as follows:
<MDMS repo URL path>/data/pb
Once data is added to MDMS repository, MDMS service in the dev environment where DIGIT is running has to be restarted which will then load the newly added/updated MDMS configs. A sample MDMS config file can be viewed here - Sample MDMS data file.

API Access Control Configuration

URIs (actions), roles and URI-role mapping will be defined in MDMS. These will apply when the module is deployed into an environment where Zuul is involved (not while locally running the app). In this sample app, we have used "pb" as a tenantId. In your environment, you can choose to define a new one or work with an existing one.
All folders mentioned below need to be created under the data/pb folder in MDMS.
You can choose to use some other tenantId. Make sure to change the tenant ID everywhere.

Actions

Actions need to be defined inside the /data/pb/ACCESS-CONTROL-ACTIONS/actions.json file. Below are the actions for the birth registration module. Append this to the bottom of the actions.json file. Make sure the "id" field in the JSON is incremented. It needs to be unique in your environment.
// Some code
{
"id": 2382,
"name": "Birth registration module create",
"url": "/birth-registration/birth-services/v1/registration/_create",
"parentModule": "",
"displayName": "Birth registration",
"orderNumber": 0,
"enabled": true,
"serviceCode": "BTR",
"code": "null",
"path": ""
},
{
"id": 2383,
"name": "Birth registration module update",
"url": "/birth-registration/birth-services/v1/registration/_update",
"parentModule": "",
"displayName": "Birth registration",
"orderNumber": 0,
"enabled": true,
"serviceCode": "BTR",
"code": "null",
"path": ""
},
{
"id": 2384,
"name": "Birth registration module search",
"url": "/birth-registration/birth-services/v1/registration/_search",
"parentModule": "",
"displayName": "Birth registration",
"orderNumber": 0,
"enabled": true,
"serviceCode": "BTR",
"code": "null",
"path": ""
}
Note that the IDs in the actions.json config are manually generated

Roles configuration

Roles config happens at a state level. For birth registration, we need only CITIZEN and EMPLOYEE roles in the /data/pb/ACCESSCONTROL-ROLES/roles.json file.Here are some sample roles that can be defined in an environment. If these roles are already present in the file, then there is no need to add them in again.

Role-action mapping

Append the below code to the "roleactions" key in the /data/pb/ACCESSCONTROL-ROLEACTIONS/roleactions.json. Note that other role-action mappings may already be defined in your DIGIT environment. So please make sure to append the below. The actionid refers to the URI ID defined in the actions.json file.
{
"rolecode": "CITIZEN",
"actionid": 2382,
"actioncode": "",
"tenantId": "pb"
},
{
"rolecode": "CITIZEN",
"actionid": 2383,
"actioncode": "",
"tenantId": "pb"
},
{
"rolecode": "CITIZEN",
"actionid": 2384,
"actioncode": "",
"tenantId": "pb"
}
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
Copy link
On this page
API Access Control Configuration