This repository contains the source code of the privacy observatory platform.
It consits of the following components:
- PostgreSQL
- RESTful API
- Worker
To setup the privacy observatory, the git repository shall be cloned and the combined docker-compose.yaml should be build and started:
docker compose up -d --build
Afterwards, as long as no user is existent in the database, all requests can be made unauthenticated. To define the first user account, use the following account:
docker exec -it prvobs-orchestrator-db-1 psql -U postgres -d postgres -c "INSERT INTO Users (name, email, timestamp, password_hash) VALUES('test','[email protected]', '2023-11-01 09:00', 'hashed_password');"
The hashed passwort can be generated using the following commands inside the /webapp folder (needed to get the application context for the password generation):
$ python3
from passlib.apps import custom_app_context as pwd_context
print(pwd_context.encrypt('password_of_the_user').replace("$", "\$"))
Afterwards, the host of the RestAPI server needs to be defined in the /webapp/js/app/api.js file:
api_prototype.api_host = 'https://example.com/api';
This document presents the specifications for the API interface of the privacy observatory platform.
The following routes will be available.
Individual studies are performed on a regular basis and are performed with a specific domainset.
-
GET /studies Retrieve a list of all avaiable studies
-
PUT /studies, { 'name': , 'author': , 'composefile': , 'output_format': , 'domainset_id': , 'limit_domains': , 'cron_schedule': } Create a new study
-
POST /studies/{study_id} Update a study
-
DELETE /studies/{study_id}
Domains for collected measurements of the studies.
-
GET /domains List all domains
-
GET /domains/{domain_id} Get all measurement series for a particular domain.
-
PUT /domains, { 'domain': }
Domainsets deliver the list of domains dynaimcally generated by a custom python3 code to reach run of a study.
-
GET /domainsets Retrieve all available domainsets
-
PUT /domainsets, { 'name': , 'generator', } Create a new domainset
-
POST /domainsets/{domainset_id}, { 'name': , 'generator', } Update a domainset
-
DELETE /domainsets/{domainset_id} Delete a domainset object
Measurements gathered from studies
-
GET /measurements/{study_id} Retrieve all measurments from a particular study.
-
PUT /measurements/{study_id}, { 'date': , 'key': , 'value': , 'domain_id': / } Store a new measurement for a study, in case no domain_id is supplied, it is a global aggregated statistic.
-
DELETE /measurements/{study_id}/{measurement_id} Delete a specific measurement of a specific study.