Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: http + json extended example #91

Merged
merged 21 commits into from
Sep 24, 2024
Merged

feat: http + json extended example #91

merged 21 commits into from
Sep 24, 2024

Conversation

lonerapier
Copy link
Collaborator

@lonerapier lonerapier commented Sep 20, 2024

Closes #8

Adds:

  • codegen for http + json circuit
  • build docs for extended example
  • http docs
  • refactoring codegen to make it more modular for folded circuits
  • test harness
  • add test and lint CI

Run npx mocha -g spotify to run spotify example. Currently, we don't match the output because sym file is too big to be loaded, due to unconstrained signals. However, running circuit manually with circom, snarkjs works.

To run codegen, which will generate circuit in main/spotify_top_artists.circom:

pabuild codegen extended --circuit-name spotify_top_artists --input-file examples/http/spotify_top_artists.json --lockfile examples/http/lockfile/spotify_extended.lock.json -d

and then compile circuits and generate witness using circomkit.

Copy link

@devloper devloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few thoughts

@@ -0,0 +1,3 @@
GET /v1/me/top/artists?time_range=medium_term&limit=1 HTTP/1.1
Host: api.spotify.com
Authorization: Bearer BQBXRpIm2NL08akEiaxB5l42eiq6Zd9Q0S2-0Q4k0CMoa5u8o_ah_Ddjxt6Mv3226AEDyKYcFPpgw_6Asg-Y2hJpcuMya8wzqyqgiV-KH0vcEq7EFzODXoaBxsB0wryVCWDF6p5dqcpIHOz4QJqQa9mUA6sFzYNyECglT-BGcRe_N9f_3aqYTGQ-kkE-devPkPkEfDcbziT6mOzJfGRzLw

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to commit this token...?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It expires every hour, at this point even I can't use it lol. but, yeah, will add this to gh secrets.

"headerName1": "content-type",
"headerValue1": "application/json; charset=utf-8",
"headerName2": "content-encoding",
"headerValue2": "gzip"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. If the content is gzip vs identity, this likely fails.

Copy link
Collaborator Author

@lonerapier lonerapier Sep 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use Accept-Encoding: identity in request and perform LockHeader proof on request, right?

https://httpwg.org/specs/rfc9110.html#field.accept-encoding

@lonerapier lonerapier marked this pull request as ready for review September 23, 2024 21:12
Copy link
Contributor

@Autoparallel Autoparallel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! Lot's of good additions and clean up.

I think my review may be a bit superficial as I want to get to use this outside of this context, that will really be the most telling if we have this working in the best way possible :)

@Autoparallel
Copy link
Contributor

Also note I pushed up a README change.

@Autoparallel
Copy link
Contributor

@lonerapier see #92 to see if that fixes test

@lonerapier lonerapier merged commit 726b6f9 into main Sep 24, 2024
4 checks passed
@lonerapier lonerapier deleted the spotify-example branch September 24, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

example(json): disclose values out of spotify_response.json
3 participants