pluto / parser-attestor

Circuits for parsing, locking, and extracting from various widely-used formats including JSON and HTTP.
Apache License 2.0
11 stars 1 forks source link

feat(http): proof template body structure parses (e.g., JSON) #57

Open Autoparallel opened 4 weeks ago

devloper commented 3 weeks ago

On the request side, for efficiency sake, I think we should not support assertions on the JSON content out the gate. Perhaps purely substring match or some type of template-based matching?

Given template: { "user_id": [[match_expression_1]], "query": true, "thing", "my favorite thing" }

and: match_expression_1(len=64, content_type=base64, value_type="string")

Roughly my thinking here is on the request side we can guarantee a certain structure because our SDK should be preparing the request, so instead of parsing the full object (which is less efficient), we might be able to get away with a reduce string match and some type of basic templating.

I'm open to the idea that his is premature optimization, just wanted to share the thinking.

Autoparallel commented 1 week ago

@lonerapier @devloper

What do we think of this issue? I'm tempted to close it or have it explained better. We currently extract the body of a HTTP req/resp as needed, though we probably need codegen for that.