This issue describes the integration of the new anon-creds related endpoints using the rust library as a proxy for the API calls. The spec doc can be found here: https://docs.google.com/document/d/1weAHcXPJZGMOls35rg6sj-jDnuEcbHHucIkUCAwpgXo/edit?usp=sharing
The workflow for performing these operations are as follows:
-
Upon app launch (after onboarding), if the data is not already stored locally in the device, the probe shall:
- request the current version of the manifest and store it locally
- perform a request to
userauth_register with the manifest public parameters and update/store the credential we get in the response
If any of the above fail due to networking problems, the probe should re-attempt performing them on app load or prior to running tests.
-
When a measurement is run, instead of uploading it using the "normal" report endpoint the userauth_submit should be called together with the credentials of the user. If the credentials failed to be generated due to networking issues, the probe should failover to using the legacy measurement upload method (eventually we should probably cache them and re-attempt upload later similar to network failures in measurement upload now).
The rust code makes use of uniffi to generate kotlin/swift bindings to be exposed to the app. The udl spec for the same can be found here: https://github.com/ooni/ooniprobe-rs/blob/900c3760d241ec0457a4af4f10665a16e80df131/ooniprobe-ffi/src/ooniprobe.udl. The function calls to integrate for anonymous credentials are:
This issue describes the integration of the new anon-creds related endpoints using the rust library as a proxy for the API calls. The spec doc can be found here: https://docs.google.com/document/d/1weAHcXPJZGMOls35rg6sj-jDnuEcbHHucIkUCAwpgXo/edit?usp=sharing
The workflow for performing these operations are as follows:
Upon app launch (after onboarding), if the data is not already stored locally in the device, the probe shall:
userauth_registerwith the manifest public parameters and update/store the credential we get in the responseIf any of the above fail due to networking problems, the probe should re-attempt performing them on app load or prior to running tests.
When a measurement is run, instead of uploading it using the "normal" report endpoint the
userauth_submitshould be called together with the credentials of the user. If the credentials failed to be generated due to networking issues, the probe should failover to using the legacy measurement upload method (eventually we should probably cache them and re-attempt upload later similar to network failures in measurement upload now).The rust code makes use of
uniffito generate kotlin/swift bindings to be exposed to the app. The udl spec for the same can be found here: https://github.com/ooni/ooniprobe-rs/blob/900c3760d241ec0457a4af4f10665a16e80df131/ooniprobe-ffi/src/ooniprobe.udl. The function calls to integrate for anonymous credentials are:client_getto/api/v1/manifestThis should give a generic
HttpResponseresult which has to be deserialized by the client. The json string body of the response is thebody_textkey, which the client receives. This should contain the api result: https://ooniprobe.dev.ooni.io/docs#/anonymous_credentials/manifest_api_v1_manifest_getuserauth_registerto/api/v1/sign_credentialThe result is a
CredentialResultcontaining the generic http api responseresponseand the credential to save (credential): https://github.com/ooni/ooniprobe-rs/pull/11/changes#diff-31033e6f25eddb8d737212f31df4c2791b7b0b2c87507cbceaf3d7a999f4f446R68-R71. The API response is documented here: https://ooniprobe.dev.ooni.io/docs#/anonymous_credentials/sign_credential_api_v1_sign_credential_postuserauth_submitto/api/v1/submit_measurement/{report_id}The result is a
CredentialResultcontaining the generic http api responseresponseand the credential to save (credential): https://github.com/ooni/ooniprobe-rs/pull/11/changes#diff-31033e6f25eddb8d737212f31df4c2791b7b0b2c87507cbceaf3d7a999f4f446R68-R71. The API response is documented here: https://ooniprobe.dev.ooni.io/docs#/anonymous_credentials/submit_measurement_api_v1_submit_measurement__report_id__post