Installing Health-Id Server

This is a service which provides below operations related to Health-Ids for MCI and other Organizations.

  • Generation and allocation of HelthIds for an Organization.
  • Tracking of a particular Health-Id allocated to an Organization.

Ansible establishes a SSH connection to install services on other machines with a given user (vagrant for local environments). Before installing services on a fresh box it is recommended to perform a SSH from provisioner box to target box with vagrant user.

Below are the steps to install Health-Id Server.

  1. Make sure a vagrant box is running with the same IP given in inventories/local for tr-server i.e. 192.168.33.19.
  2. Go to Freeshr-Playbooks folder. Start the vagrant box and ssh into it.
  3. Put the health-id server RPM into /tmp/ folder. Under development version can be built locally or can be downloaded from CI-Server. Released versions are published to github-releases.
  4. Start the provision

    cd /vagrant/
    cp group_vars/all_example group_vars/all #make sure this is not commited
    touch ~/.vaultpass.txt
    ansible-playbook mci.yml -i inventories/local -t healthid-server  --vault-password-file ~/.vaultpass.txt -k -vvvv

    The above will install the HealthId Server.

  5. Generate few HealthIds:-
    1. Login to IdP as an SHR System Admin

      curl -X POST http://192.168.33.19:8084/signin -H "X-Auth-Token:local-shr-system-admin_auth_token" -H "client_id:18700" --form "email=local-shr-system-admin@test.com" --form "password=password"
    2. With the above token for SHR System Admin, now you can POST to the http://192.168.33.19:8086/healthIds/generateBlock?start=9800000000&totalHIDs=100 to generate Health IDs with below headers

      1. X-Auth-Token:{the token you received in the previous step}
      2. client_id:18700 { this is client id for the user who signed in}
      3. From: local-shr-system-admin@test.com

    3. The above should return you a message saying "Generated 100 HIDs".
    4. You can login to cassandra and check the same

      cqlsh 192.168.33.19 -ucassandra -ppassword
      use healthid ;
      select count(*) from mci_healthid ;
      #Above should return count as 100.

      The stub IdP doesn't expire the token unless the Identity-Service is restarted. So you can keep using the "access_token". In reality, the access_token is short-lived and also can be invalidated.