-
Notifications
You must be signed in to change notification settings - Fork 31
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❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (81.95%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #1016 +/- ##
==========================================
- Coverage 92.81% 90.19% -2.63%
==========================================
Files 17 19 +2
Lines 1281 1560 +279
Branches 65 78 +13
==========================================
+ Hits 1189 1407 +218
- Misses 78 127 +49
- Partials 14 26 +12
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-py
as a dependency/sign_credential
,/manifest
,/submit
Note that the new measurement
/submit
endpoint 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.sql
script 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_credential
used to be named/register
but it clashes with the older/register
one, so I chose a different namecloses #1014 #1015