Local noconfirm + referrer test
Docs: docs/POSPRINT-URL.md.
Loopback (127.0.0.1 / localhost) is allowed for referrer verification.
1. Start the verify server
python scripts/test-noconfirm/server.py
GET http://127.0.0.1:8765/verify?code=84923→ 200GET http://127.0.0.1:8765/verify?code=wrong→ 403
2. Build and open the test URL
cargo build
$base = cargo run --quiet -- link examples/noconfirm-demo.pos
$ref = [uri]::EscapeDataString("http://127.0.0.1:8765/verify?code=84923")
$url = "$base&noconfirm=1&referrer=$ref"
$url
# Prefer the built GUI binary (no console flash):
Start-Process ".\target\debug\posprint.exe" $url
First run: trust dialog for 127.0.0.1. After Trust and print, the next open should print without asking (while the server still returns 200).
Bad code (should fail verification):
$refBad = [uri]::EscapeDataString("http://127.0.0.1:8765/verify?code=nope")
Start-Process ".\target\debug\posprint.exe" "$base&noconfirm=1&referrer=$refBad"
Source
| 1 | # Local noconfirm + referrer test |
| 2 | |
| 3 | Docs: [docs/POSPRINT-URL.md](../../docs/POSPRINT-URL.md). |
| 4 | |
| 5 | Loopback (`127.0.0.1` / `localhost`) is allowed for referrer verification. |
| 6 | |
| 7 | ## 1. Start the verify server |
| 8 | |
| 9 | ```powershell |
| 10 | python scripts/test-noconfirm/server.py |
| 11 | ``` |
| 12 | |
| 13 | - `GET http://127.0.0.1:8765/verify?code=84923` → **200** |
| 14 | - `GET http://127.0.0.1:8765/verify?code=wrong` → **403** |
| 15 | |
| 16 | ## 2. Build and open the test URL |
| 17 | |
| 18 | ```powershell |
| 19 | cargo build |
| 20 | $base = cargo run --quiet -- link examples/noconfirm-demo.pos |
| 21 | $ref = [uri]::EscapeDataString("http://127.0.0.1:8765/verify?code=84923") |
| 22 | $url = "$base&noconfirm=1&referrer=$ref" |
| 23 | $url |
| 24 | # Prefer the built GUI binary (no console flash): |
| 25 | Start-Process ".\target\debug\posprint.exe" $url |
| 26 | ``` |
| 27 | |
| 28 | First run: trust dialog for `127.0.0.1`. After **Trust and print**, the next open should print without asking (while the server still returns 200). |
| 29 | |
| 30 | Bad code (should fail verification): |
| 31 | |
| 32 | ```powershell |
| 33 | $refBad = [uri]::EscapeDataString("http://127.0.0.1:8765/verify?code=nope") |
| 34 | Start-Process ".\target\debug\posprint.exe" "$base&noconfirm=1&referrer=$refBad" |
| 35 | ``` |