Skip to content

PatriceKast/privacy-observatory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Privacy Obsercatory Orchestrator

This repository contains the source code of the privacy observatory platform.

It consits of the following components:

  • PostgreSQL
  • RESTful API
  • Worker

Initial Configuration

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','test@example.com', '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';

Component Documentation

RESTful API

This document presents the specifications for the API interface of the privacy observatory platform.

The following routes will be available.

Studies

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

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

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

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.

About

The source code of the Privacy Observatory.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published