accordproject / template-archive

Smart Legal Contracts & Templating System
https://accordproject.org/projects/cicero/
Apache License 2.0
280 stars 119 forks source link

feat(server) Add new /archive/:template endpoint implementation #751

Closed mehmettokgoz closed 1 year ago

mehmettokgoz commented 2 years ago

Changes

Flags

Demo

Sample request.body:

{
    "target": "ergo"
}

Response to sample request:

Stream of buffer containing the created archive file.

Author Checklist

coveralls commented 1 year ago

Coverage Status

Coverage increased (+0.1%) to 93.724% when pulling 1ae4bd9c07ce46f131ffdc598cb8bac8363b4a76 on mehmettokgoz:archive into 62a2f44c40e26cd417c6502933f63f467e8fa579 on accordproject:master.

mehmettokgoz commented 1 year ago

FYI, currently we require P12 files to present with the server itself and read it from the given path when Keystore is present. We can change this behavior by taking the base64 encoded version of the P12 file as an argument and using it directly. In this case, the client must encode the file and send it inside the request body.

I think taking encoded data is more appropriate for running Cicero Server independently without relying on any file system. Feedbacks are welcome.