Skip to content

This is a proof of concept implementation of a capport api based on the draft specification 'draft-donnelly-capport-detection'.

Notifications You must be signed in to change notification settings

joyrex2001/capport-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CAPPORT API proof of concept

This is a proof of concept implementation of a capport api based on the draft specification draft-donnelly-capport-detection. Note that this is not an exact implementation of this draft, but actually implements the comments that were given on this draft.

Running the capport

The capport api is written in Python, and uses MySQL/mariadb for the storage of the sessions. The accompanied docker-compose file will set-up a complete environment, however the capport-api can also run without it.

Run with docker-compose

To start with docker-compose: docker-compose up --force-recreate.

Run without docker compose

This proof of concept can also run without docker, but requires some manual installation of the dependencies.

On centos7, install the following:

yum -y install epel-release gcc gcc-c++ python-devel mariadb-devel mariadb-server
yum -y install python-pip
pip install -r capport-api/requirements.txt

Create the database, and add a default user:

sudo systemctl start mariadb
sudo mysql
MariaDB [(none)]> CREATE DATABASE capport CHARACTER SET utf8 COLLATE
utf8_unicode_ci;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON capport.* TO 'capport'@'%' IDENTIFIED
BY 'capport';

Finally, to start the service: cd capport-api; python app.py.

Accessing the api

The following curl commands will be helpful;

curl -H'Accept: application/json' http://localhost:5000/capport
curl -H'Accept: application/json' http://localhost:5000/capport/sessions -d '{"identity": "1234567890"}'
curl -H'Accept: application/json' http://localhost:5000/capport/sessions/9d09f746-10c7-11e7-a298-0242ac1b0003
curl -H'Accept: application/json' -X DELETE http://localhost:5000/capport/sessions/9d09f746-10c7-11e7-a298-0242ac1b0003

References

About

This is a proof of concept implementation of a capport api based on the draft specification 'draft-donnelly-capport-detection'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published