|
6 | 6 | [](https://cim.etsi.org/NGSI-LD/official/front-page.html) |
7 | 7 | [](https://w3c.github.io/json-ld-syntax/) |
8 | 8 |
|
9 | | -Simple nodejs express application for use with the FIWARE Step-by-Step tutorials. This component can be used to proxy and amend requests. |
| 9 | +Simple nodejs express application for use with the FIWARE Step-by-Step tutorials. This is a **Context Provider** that can |
| 10 | +be used to proxy and amend requests to a Context Broker. |
10 | 11 |
|
11 | | -This application provides various sources of context and demonstrates various aspects of FIWARE To run the application |
12 | | -in debug mode add `DEBUG=broker:*` |
| 12 | +This application provides various sources of context and demonstrates various aspects of FIWARE. Its main features include: |
13 | 13 |
|
14 | | -## Target Context Broker |
| 14 | +* **Proxying**: Forwards requests to a target Context Broker. |
| 15 | +* **Header Injection**: Can automatically inject headers such as `NGSILD-Tenant` and Wallet information |
| 16 | + (`Wallet-type`, `Wallet-Token`, `Wallet-address`) into proxied requests. |
| 17 | +* **Verification**: Optionally verifies tokens using Verifiable Credentials, integrating with a Credentials Config |
| 18 | + Service and Trusted Issuer Registry. |
| 19 | +* **Event Emission**: Emits events to a companion Tutorial Web App. |
15 | 20 |
|
16 | | -- `CONTEXT_BROKER` - location of the Context Broker |
| 21 | +To run the application in debug mode add `DEBUG=broker:*`. |
17 | 22 |
|
18 | | -## Additional Request Headers |
| 23 | +## Environment Variables |
19 | 24 |
|
20 | | -- `TENANT` - sets an NGSI-LD Tenant header |
21 | | -- `WALLET_TYPE` - Sets a Wallet Type for Canis Major |
22 | | -- `WALLET_TOKEN` - Sets a Wallet Token for Canis Major |
23 | | -- `WALLET_ADDRESS` - Sets a Wallet Address for Canis Major |
24 | | -- `ACCEPT_ENCODING` - sets an Accept-Encoding header |
| 25 | +### Core Configuration |
25 | 26 |
|
26 | | -## Verifiable Credentials Verifier |
| 27 | +- `PORT` - Port the application listens on. Default: `80`. |
| 28 | +- `DEBUG` - Debug level. Set to `broker:*` for full output. |
27 | 29 |
|
28 | | -- `VERIFY_CREDENTIALS` - set to `true` to enable verification |
29 | | -- `CONFIG_SERVICE` - location of the Credentials Config Service |
30 | | -- `WEB_APP_HOST` - location of the Tutorial App to display on screen |
31 | | -- `WEB_APP_PORT` - port of the Tutorial App |
| 30 | +### Proxy Target |
| 31 | + |
| 32 | +- `CONTEXT_BROKER` - URL of the target Context Broker. Default: `http://orion:1026`. |
| 33 | + |
| 34 | +### Header Injection |
| 35 | + |
| 36 | +These variables configure headers to be added to proxied requests: |
| 37 | + |
| 38 | +- `TENANT` - Sets the `NGSILD-Tenant` header. |
| 39 | +- `WALLET_TYPE` - Sets the `Wallet-type` header (for Canis Major). |
| 40 | +- `WALLET_TOKEN` - Sets the `Wallet-Token` header (for Canis Major). |
| 41 | +- `WALLET_ADDRESS` - Sets the `Wallet-address` header (for Canis Major). |
| 42 | +- `ACCEPT_ENCODING` - Sets the `accept-encoding` header. |
| 43 | + |
| 44 | +### Verifiable Credentials Verification |
| 45 | + |
| 46 | +- `VERIFY_CREDENTIALS` - Set to `true` to enable credential verification. Default: `false`. |
| 47 | +- `CONFIG_SERVICE` - Host and port of the Credentials Config Service. Default: `localhost:8081`. |
| 48 | +- `TRUSTED_ISSUER_LIST` - URL of the Trusted Issuer List. If set, this overrides the list obtained from the Config |
| 49 | + Service. |
| 50 | + |
| 51 | +### Event Emission |
| 52 | + |
| 53 | +- `WEB_APP_HOST` - Hostname of the Tutorial Web App to emit events to. Default: `localhost`. |
| 54 | +- `WEB_APP_PORT` - Port of the Tutorial Web App. Default: `3000`. |
| 55 | + |
| 56 | +### Healthcheck |
| 57 | + |
| 58 | +- `HEALTHCHECK_PATH` - Path for the healthcheck endpoint. Default: `/health`. |
| 59 | +- `HEALTHCHECK_CODE` - HTTP Code expected for a healthy response. Default: `200`. |
32 | 60 |
|
33 | 61 | ## How to build your own image |
34 | 62 |
|
@@ -70,3 +98,9 @@ COPY app /usr/src/app |
70 | 98 | ``` |
71 | 99 |
|
72 | 100 | Full instructions can be found within the `Dockerfile` itself. |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## License |
| 105 | + |
| 106 | +[MIT](LICENSE) © 2020-2026 FIWARE Foundation e.V. |
0 commit comments