Introduction
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# go to soajs directory cd /opt/soajs/node_modules # install urac npm install soajs.urac # go to urac directory cd /opt/soajs/node_modules/soajs.urac # export necessary environment variables export SOAJS_PROFILE=/opt/soajs/node_modules/soajs.utilities/data/getStarted/profile.js export SOAJS_ENV=test export SOAJS_SRVIP=127.0.0.1 # run urac node . |
URAC is now running on http://127.0.0.1:4001 and will be used to login with different users. Therefore, its maintenance port is 5001.
Next, a heartbeat request is sent to check the health of the URAC service.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -X GET "http://127.0.0.1:5001/heartbeat" |
...
Code Block | ||||
---|---|---|---|---|
| ||||
# go to correct directory cd /opt/soajs/node_modules/soajs.examples/example03/ # export necessary environment variables export SOAJS_PROFILE=/opt/soajs/node_modules/soajs.utilities/data/getStarted/profile.js export SOAJS_ENV=test export SOAJS_SRVIP=127.0.0.1 # start service node . |
The service is now running and listens on port 4012. Therefore, its maintenance port is 5012.
Next, a heartbeat request is sent to check the health of the service.
Code Block | ||||
---|---|---|---|---|
| ||||
curl -X GET "http://127.0.0.1:5012/heartbeat" |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{"result": true,"data": {"tenantName": "Client One","fullName": "John Smith"},"soajsauth": "Basic c29hanM6czAxOXI0OGxIa2RLV0Q0RXlHN2l0SWpidHZWbVo5R1g3R3A="} |
Clearly, the response generated proves that the second application has access to the API, and the response came back with a positive result to the tenant's query.
...
User | tenant | Overrides Package | Overrides Tenant | buildName | testGet | Custom Tenant Information |
---|---|---|---|---|---|---|
User1 | Tenant1 | NO | NO | NO | NO | NA |
User2 | Tenant1 | YES | NO | YES | YES | Changes the tenant name |
User3 | Tenant1 | NO | YES | YES | NO | Changes the tenant name |
The above table shows three users. Each user has the ability to override the permissions their tenant, and its attributed package.
The examples that follow aim to present how a user can override the ACL permissions of the tenant it belongs to AND/OR the package that the tenant is using.
In addition to that, the examples will show that the user also has the ability to change these configurations, which, in this case, is "tenant name".
User1 Tests
URAC Login
Before using the service APIs, a user must be authenticated to the service. Each of the three users has a password. The first step would be to login to URAC
...
The corresponding response prove the above statement. User2 overrode the package ACL and obtained full access to the service's APIs
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{"result":true,"data":{"firstName":"John","lastName":"Smith"},"soajsauth":"Basic c29hanM6QzAyWWNjQXdaSDBYSnhTMkJ5ejAzZG5RZ1BOdXFFd0d4UmM="} |
...