This repository provides a Python test script for verifying access permissions (admin, write, read) against a FIWARE Context Broker secured with Keycloak authentication. The script tests entity creation, reading, deletion, and subscription notification handling for different tenants and roles.
- Tests write, read, and delete permissions for each tenant
- Validates subscription notification delivery
-
Install dependencies:
- Install required packages using pip:
pip install -r requirements.txt
- Install required packages using pip:
-
Create
config.json:- In the project root, create a file named
config.jsonwith the following structure:{ "client_id": "<your_client_id>", "client_secret": "<your_client_secret>", "username": "<your_username>", "password": "<your_password>" } - Replace the values with your Keycloak client credentials and user login.
- In the project root, create a file named
| Tenant | Role | Description |
|---|---|---|
| securitytest1 | admin | Full access: create, read, delete |
| securitytest2 | write | Write and read access only |
| securitytest3 | read | Read-only access |
Run the test script with:
python main.py
The script will output the results of each permission test for all configured tenants.