The scenario: several clinics share one media project
A platform may support clinic-owned media projects as well as a shared project serving several clinics. A webhook signature can establish which project secret signed a message, but the project identity does not necessarily select one clinic. The application still needs to decide which consultation room the event belongs to and whether that clinic owns it.
The inspected Movo-X verifier and handler separate signature matching from authoritative event attribution. Four selected webhook tests passed with ephemeral synthetic signatures and mocked service responses. They establish selected verification, mapping and candidate iteration; they do not process an actual provider event or validate production clinic ownership.
Verify the received body before acting on its fields
The reviewed verifier checks the accepted token algorithm and representation, the issuer field, the expiry conditions and a digest of the raw body. It then compares the signature against candidate project secrets. Only after successful verification does it parse the event fields used by the handler.
The isolated fixture accepts a correctly signed synthetic event and rejects a signature from the wrong fixture secret, a modified body, missing authorization and selected malformed input. That directly tests the exercised verification boundary. It does not establish that the candidate lookup is authorized correctly or that every possible malformed input and transport condition has been covered.
Keep signature matching tied to its project candidate
The verifier returns which candidate secret matched. The handler retains the related project references so it can pass project context along with the selected event, room and participant identity to the service responsible for recording the event. It does not select a clinic merely because the body names a plausible room.
A selected fixture exercises a platform-signed event and a clinic-project event and checks the different forwarded connection references. The project secret stays inside the injected signing/verification side. This is a local attribution contract, not evidence that the current deployed project connections, secret rotation or webhook destination have been verified.
Handle shared secrets without choosing the first clinic blindly
When multiple clinic candidates share the secret that verified the event, the inspected handler treats them as possible project references rather than assuming the first candidate owns the room. It asks the authoritative service with a candidate reference and can continue when the response explicitly indicates a connection mismatch.
The shared-project test supplies two synthetic clinics with the same secret. Its fake service refuses the first candidate as a mismatch and accepts the second; the test checks that both were tried in that order. The service is mocked, so this establishes the handler’s iteration rule. Actual room-to-clinic ownership and refusal need independent database acceptance.
Make unsupported events and unavailable recording distinct
The handler recognizes a selected set of participant and room lifecycle events. A successfully verified event outside that set can be acknowledged as ignored, while a supported event still needs the event identifier, room and available recording service. A failed recording dependency is different from a bad signature.
The rerun handler test checks an unsupported synthetic event and a disabled feature response as selected cases. A wider acceptance should inspect missing recording dependencies, temporary database failure and provider retries. A successful HTTP acknowledgement must be interpreted according to whether the event was recorded or intentionally ignored, rather than used as a universal success label.
Bound accepted expiry without claiming complete replay prevention
The inspected verification requires an expiry claim and refuses an expiry too far in the future relative to the supplied current time. Its selected expiry test checks missing expiry and an excessive future value. The source also applies an accepted clock-skew allowance when evaluating expiration.
Those checks do not by themselves establish one-time event consumption or reconstruct the original token lifetime. Event identifiers and authoritative deduplication are a separate responsibility. The four rerun cases do not execute database replay prevention. A complete acceptance should submit an approved synthetic event repeatedly and inspect the retained audit state, including retries after an uncertain recording response.
Log reasons rather than capabilities or event bodies
The inspected rejection path records reason codes instead of printing authorization tokens, the raw event or participant identity. Its test captures routine log output and checks the absence of selected distinctive synthetic identity/token markers. This makes the intended logging boundary visible and testable.
The assertion is limited to the exercised handler paths and supplied markers. It is not a full audit of infrastructure access logs, provider traces or every error destination. A production handover should define safe correlation fields and retention separately. Real room identifiers and capability material should not be copied into a public case study merely to make the example feel concrete.
A practical webhook ownership handover
Deliver the accepted signature/body representation, candidate-project mapping, supported event set and authoritative room-ownership contract. Include shared-project, wrong-secret, changed-body and expiry fixtures. Add real ownership, duplicate-event and retry-after-recording tests in an approved synthetic environment.
For a CTO, the useful lesson is that authentication and ownership answer different questions. Verification identifies the signer of the received bytes; the responsible service determines whether the event belongs to the intended clinic and consultation. The pinned code and four isolated cases support that separation without claiming a real webhook was recorded, a live room was attributed correctly or production replay protection was proven.
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
verified = verify_signature_and_raw_body(request, candidate_project_secrets)
if not verified:
refuse_without_logging_token_or_body()
for project_reference in candidates_sharing_verified_secret:
result = authoritative_record_event(event, project_reference)
if result.explicit_connection_mismatch:
continue
return_result_for_recorded_or_failed_event(result)
# Verified project signature does not independently establish clinic ownership.About this engineering series
Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.
Explore the Movo-X engineering series → · Related implementation experience →
Discuss a similar engineering problem
Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.
Discuss your project on WhatsApp ↗