diff --git a/scripts/e2e/lib.sh b/scripts/e2e/lib.sh index 5985c87..07b814e 100644 --- a/scripts/e2e/lib.sh +++ b/scripts/e2e/lib.sh @@ -159,9 +159,11 @@ e2e_pair() { code="$(jq -r '.code // empty' <<<"$created")" [ -n "$code" ] || e2e_fail "pair.create returned no code: $created" + # Redeeming is the *public* half of pairing: the code is the capability, so + # this call carries no authorization (ADR 0001, docs/protocol.md §3.1). token="$(curl -sS --max-time 10 -X POST -H 'Content-Type: application/json' \ -d "{\"code\":\"$code\",\"deviceName\":\"$name\",\"kind\":\"laptop\"}" \ - "$E2E_BASE/api/v1/pair" | jq -r '.token // empty')" + "$E2E_BASE/api/v1/pair/redeem" | jq -r '.token // empty')" [ -n "$token" ] || e2e_fail "pair redeem failed" E2E_DEVICE_TOKEN="$token" E2E_PAIR_CODE="$code" diff --git a/scripts/e2e/visual.sh b/scripts/e2e/visual.sh index 2ca2f77..482ed82 100755 --- a/scripts/e2e/visual.sh +++ b/scripts/e2e/visual.sh @@ -46,7 +46,7 @@ done echo "instance: $ST workspace: $WSID" CODE=$(cmd '{"method":"pair.create","params":{}}' | jq -r '.code') -DEVTOKEN=$(curl -fsS -X POST "$BASE/api/v1/pair" -H 'Content-Type: application/json' \ +DEVTOKEN=$(curl -fsS -X POST "$BASE/api/v1/pair/redeem" -H 'Content-Type: application/json' \ -d "{\"code\":\"$CODE\",\"deviceName\":\"Playwright\",\"kind\":\"laptop\"}" | jq -r '.token') echo "paired device token: ${DEVTOKEN:0:8}…"