https://github.com/polyconseil/mds-agency-validator
HTTP validator for MDS Agency API
https://github.com/polyconseil/mds-agency-validator
Last synced: 7 months ago
JSON representation
HTTP validator for MDS Agency API
- Host: GitHub
- URL: https://github.com/polyconseil/mds-agency-validator
- Owner: Polyconseil
- License: gpl-3.0
- Created: 2020-02-05T11:28:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T09:36:16.000Z (about 5 years ago)
- Last Synced: 2025-01-22T10:16:57.134Z (over 1 year ago)
- Language: Python
- Size: 70.3 KB
- Stars: 1
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: Changelog.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
MDS Agency Validator
====================
This projet allows you to run a headless service that accepts incoming HTTPS
POST request and check the payload format against MDS Agency API specifications.
Currently, only version 0.4.0 is supported.
Installation
------------
First of all, clone the repository :
.. code-block:: sh
git clone https://github.com/Polyconseil/mds-agency-validator.git
You may then install the project's dependencies.
.. code-block:: sh
pip install -e .
Use
---
Run the following command to start the flask service from the project repository
.. code-block:: sh
make serve
You can now post data to test your Agency API implementation.
.. code-block:: sh
curl -d '{"invalid": "payload"}' -H "Content-Type: application/json" -X POST http://127.0.0.1:5000/v0.4.0
Warnings
--------
Sadly mds-agency-validator currently does not handle HTTPS request as
self-signed certificates are not accepted when posting request with curl.
It does not handle oauth2 token generation either yet (since it's not really
usefull without HTTPS).
You may generate a fake token to put in the request headers with this command :
.. code-block:: python
import jwt
import uuid
jwt.encode({'provider_id': str(uuid.uuid4())}, 'secret')