RalphTro / epcis-event-hash-generator

ALGORITHM and SOFTWARE PROTOTYPE to uniquely identify/validate the integrity of any EPCIS event through a common, syntax-agnostic approach based on hashing. Takes an EPCIS Document (formatted in either XML or JSON-LD) and returns the corresponding hash value(s).
MIT License
8 stars 4 forks source link

flask based REST api for generating event hash #27

Closed dakbhavesh closed 4 years ago

dakbhavesh commented 4 years ago

Hi @RalphTro and @Echsecutor,

As part of EPCIS 2.0 prototype, we intend to integrate this event hash generator. It would be nice to treat it as an internal micro service which exposes REST endpoint for generating hash of EPCIS event passed as part of request.

To be able to achieve that, I have added flask based REST api under webapi directory and also added required files to prepare docker container which will make the deployment in various environments consistent.

Please suggest if any parts required improvement or not in-line with normal python development.

Looking forward to your feedback.

Cheers, Bhavesh

Echsecutor commented 4 years ago

Many thanks for adding this web service functionality which is much better than the simpler container which just whatches a folder for new files and hashes them.

dakbhavesh commented 4 years ago

Hi @Echsecutor, Thank you so much for taking time to review the changes and providing valuable feedback. I am glad that you are finding webapi more convenient for end users. All your suggestions are incorporated.

I will raise separate PR to supply hashing algorithm as part of POST request. Thinking to pass it as URL query param. Let me know if prefer to do it via request header.

Whenever you find time please review the commit again.