LAB-MI / deplacement-covid-19

Service de génération de l'attestation de déplacement dérogatoire à présenter dans le cadre du confinement lié au virus covid-19

Home Page:https://media.interieur.gouv.fr/deplacement-covid-19

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add REST API

eramox opened this issue · comments

Hello,

Would it be possible to add a REST API in order to be able to generate the certificate from any other development language? It would:

  • increase it's usability using curl/python/cobol...
  • reduce the bandwidth required (save the planet)
  • All coders will be grateful

Thanks for your commitment.

Yes indeed it would be a very useful feature

I don't really understand why it's necessary (or even useful) as you can generate a qr code (offline) with so much apis.

The certificate is a service, and every service should have a REST API to my opinion, to make it sleek and scalable

I think this project is only about giving an alternative to a paper travel certificate which does not require a REST API. I don't know what is displayed on a police officer's phone but I suppose that it is only the info given by the QR code. Therefore, a REST API may be useless and may generate an unnecessary traffic.

Nota Bene: I agree with you on the fact that a REST API is generally better but in this case I think it may create concerns about data collections. I thank the team working on this project for their whish to bring transparency.

The idea of the REST API was only to provide the fields as json to generate the QR code and the pdf. In this case there is no collection of data.
I did not wanted to create side apps for the service but extend it.

Hi @eramox @vartur,

Please take into account that this project has a limited lifetime. The goal of Johann Pardanaud and after that, the Interior Ministry was to quickly publish a simple, reliable tool to generate the form.
There is no point in asking to develop such feature, as well as asking for optimisation or useless features.
It don't see any reason that the Ministry would like to invest more time in a service that is actually functional and will be forgotten in a few weeks.

Keep in mind that the website and the project will not be used more than one or two months in the future.

Best regards,
Adam

Also noting that an API will resolve these issues;
#98
#96
#92

It looks like the objective is to generate the certificates on the client side, so that no data hits the server. API will create traces on servers.

and even if it was hitting a server, a form-url-encoded POST would also qualify as "REST" , REST != Json API , but as it's not the case, having an API would actually require more infrastructure and be less environment-friendly.

At the opposite yes having the format of the json that is then qrcode encode would be nice so that one can implement it in whichever language he wants without doing any network call :)

I’m working on a proof-of-concept hack to use the url instead of an additional POST request.
All customization entirely done in the browser
Nginx server on Ubuntu 18.04 with config something like:

server {
    listen       80;
    server_name  *.example.org;
    ...
}

The catch-all may or may not be a security issue, I’m not a sys admin...
I’d be glad to post a link if anyone is interested

commented

I've done that in the same nature : https://oeil.github.io/deplacement-covid-19/

I'm using Siri to generate my certificate each time I need.

I've done that in the same nature : https://oeil.github.io/deplacement-covid-19/

I'm using Siri to generate my certificate each time I need.

Perfect thank you 🍻