-
Notifications
You must be signed in to change notification settings - Fork 34
Anonymous credentials draft endpoints #1016
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (93.52%) is below the target coverage (95.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #1016 +/- ##
==========================================
+ Coverage 90.25% 93.52% +3.27%
==========================================
Files 42 49 +7
Lines 3663 4512 +849
Branches 298 306 +8
==========================================
+ Hits 3306 4220 +914
+ Misses 283 232 -51
+ Partials 74 60 -14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR adds support for the anonymous credentials protocol to the Ooni API:
ooniauth-pyas a dependency/sign_credential,/manifest,/submitNote that the new measurement
/submitendpoint won't replace the old one, and for now it's meant to be used mostly during developmentAlso updates the fastpath so that it's able to work with the new fields
Migrations
This PR will require some database migrations
Postgres
Adds the following tables to postgres:
ooniprobe_manifest: Describes the manifest that is reported to users when they registerooniprobe_server_state: Defines the key pair (secret_key, public_parameters) that is used for authenticationYou can find the new models here:
backend/ooniapi/services/ooniprobe/src/ooniprobe/models.py
Line 58 in 3b3bfb2
And the migrations:
https://github.com/ooni/backend/blob/userauth-dep/ooniapi/common/src/common/alembic/versions/7e28b5d17a7f_add_server_state_table_for_anonymous_.py
Clickhouse
In clickhouse we need to add the fields necessary for:
As an example of the changes, you can look at the
clickhouse_init.sqlscript in fastpath:backend/fastpath/clickhouse_init.sql
Lines 42 to 46 in 3b3bfb2
These are the alter table statements required to run the migration in production:
Feedback
This is still early work to define the API for the anonymous credentials protocol. Some things that could benefit from a bit of feedback are:
/sign_credentialused to be named/registerbut it clashes with the older/registerone, so I chose a different namecloses #1014 #1015
EDIT: Adding
ON CLUSTERto alter table query after feedback from @hellais