Prd/components/dialer-patch/tests/HelpdeskHttpClientIT.java
Lucy Doupalů be9f14ce34 Helpdesk - operator console + patched GrapheneOS Dialer for call handling
A small helpdesk system: an office Pixel running a patched GrapheneOS Dialer
answers technician calls, records both call legs as separate channels, and a
Ruby backend transcribes them through Whisper and files an AI summary against
the caller.

Squashed to a single commit for sharing. No credentials are included; secrets
live outside the repo in /etc/helpdesk/env on the server or a gitignored
.claude/env.local locally. See .claude/env.local.example for the shape.

Start at README.md, then docs/architecture.md.
2026-07-27 18:50:32 +02:00

24 lines
1.4 KiB
Java

package com.android.dialer.helpdesk.http;
/**
* Integration check for {@link HelpdeskHttpClient} against the running backend prototype (started by
* tests/integration.sh). Proves the full device→backend auth path end-to-end: a correctly-signed
* webhook is accepted (200), a wrong secret or wrong token is rejected (401).
*/
public class HelpdeskHttpClientIT {
public static void main(String[] args) {
String base = args.length > 0 ? args[0] : "http://localhost:4000/api/v1";
String body = "{\"call_id\":\"it-" + System.nanoTime() + "\",\"ts\":\"2026-07-08T10:00:00Z\","
+ "\"number\":\"+420601234567\",\"presentation\":\"allowed\","
+ "\"dialed_did\":\"+420800111222\",\"device_id\":\"it-device\"}";
HelpdeskHttpClient good = new HelpdeskHttpClient(base, new DeviceAuthSigner("dev-device-token", "dev-device-secret"));
System.out.println("VALID_STATUS=" + good.send("POST", "/calls/incoming", body).status);
HelpdeskHttpClient wrongSecret = new HelpdeskHttpClient(base, new DeviceAuthSigner("dev-device-token", "WRONG-secret"));
System.out.println("TAMPERED_STATUS=" + wrongSecret.send("POST", "/calls/incoming", body).status);
HelpdeskHttpClient wrongToken = new HelpdeskHttpClient(base, new DeviceAuthSigner("WRONG-token", "dev-device-secret"));
System.out.println("BADTOKEN_STATUS=" + wrongToken.send("POST", "/calls/incoming", body).status);
}
}