dzejkop/client improvements - #72
Conversation
92bccb1 to
d1149b7
Compare
There was a problem hiding this comment.
Pull request overview
Refactors FaceVerifierClient to support more flexible HTTP customization: callers can modify reqwest::RequestBuilders before sending, and can supply an externally configured reqwest::ClientBuilder, while preserving the client’s required settings (cookie store + timeouts) and keeping the existing high-level new / request_* APIs intact.
Changes:
- Add
with_http_client_builderto allow constructing the client from an externally configuredreqwest::ClientBuilderwhile enforcing required HTTP settings. - Split assignment/match flows into “build request” helpers and “send/verify” helpers (
build_*+request_*_with). - Inline endpoint paths in the new builder helpers (removing the old path constants).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -17,12 +17,6 @@ use getrandom::SysRng; | |||
|
|
|||
| use crate::config::Config; | |||
|
|
|||
| /// Path of the assignment endpoint. | |||
| const ASSIGNMENT_PATH: &str = "/v1/enclave-assignment"; | |||
There was a problem hiding this comment.
Can we keep these constant?
There was a problem hiding this comment.
they're used only to construct the urls? It's easier to read if they're inline imo
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bf0046. Configure here.
b7ea1d0 to
52b566f
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
52b566f to
62b5bf0
Compare

Note
Low Risk
Refactor and new public hooks around the same verify-and-seal logic; no change to attestation or channel crypto behavior beyond call structure.
Overview
Extends
FaceVerifierClientso embedders can tune HTTP before send without bypassing sealing, attestation checks, or response verification.newnow builds throughwith_http_client_builder, which still forces cookie store (ALB affinity), connect timeout, and request timeout on whateverreqwest::ClientBuilderthe caller supplies. Assignment and match flows are split into build helpers (build_assignment_request,build_match_request→ builder +ResponseOpener) and send helpers (request_assignment_with,request_match_with); the one-shotrequest_*methods delegate to those. The privaterequest_match_with_consumerpath is removed in favor of the publicrequest_match_withAPI. Endpoint path constants are inlined as/v1/enclave-assignmentand/v1/matches.Match HTTP tests move from
tests/matches.rsinto an inlinemod testsinclient.rs, using a local helper that exercisesrequest_match_withinstead of the removed private method.Reviewed by Cursor Bugbot for commit 62b5bf0. Bugbot is set up for automated code reviews on this repo. Configure here.