interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / social / tests / onebox.sh

23 lines · 1845 bytes Raw Blame History
1#!/bin/bash
2# One-box sign-in (2026-11-15): the page shows one command and one box; the pasted block is the
3# account id line followed by the signature. Checks the page, a valid paste, a paste whose id line
4# names another key (refused), and a paste with no id line (refused). Helpers: tests/lib.sh.
5. "$(dirname "$0")/lib.sh"
6start
7login_get
8grep -q "curl -fsSL https://interplane.io/signin.sh | sh -s -- interplane-forge-login:$NONCE:$TS</pre>" "$T/body" && ok "page shows the one command with the challenge" || bad "one command not in page"
9grep -q "name=\"did\"" "$T/body" && bad "page still has a DID field" || ok "page has no DID field"
10[ "$(grep -c "<textarea" "$T/body")" = 1 ] && ok "page has one box" || bad "page boxes"
11# NEGATIVE: id line of k2 over a signature by k1 -> 403
12sign "$T/k1"; { echo "$D2"; cat "$T/sig"; } > "$T/blk"; mv "$T/blk" "$T/sig"; c=$(login_post ""); check "$c" 403 "NEG one-box paste with another key id refused"
13# NEGATIVE: signature only, no id line -> 400
14login_get; sign "$T/k1"; c=$(login_post ""); check "$c" 400 "NEG one-box paste without the id line refused"
15# POSITIVE: id line + signature, CRLF line ends as a browser sends them
16login_get; sign "$T/k1"; { echo "$D1"; cat "$T/sig"; } | sed "s/\$/\r/" > "$T/blk"; mv "$T/blk" "$T/sig"; c=$(login_post ""); check "$c" 303 "one-box paste signs in"
17SES=$(hdr set-cookie | sed -n "s/^__Host-forge_session=\([0-9a-f]*\);.*/\1/p"); [ ${#SES} = 64 ] && ok "session cookie issued" || bad "no session cookie"
18# POSITIVE: the output of signin.sh itself
19if [ -f "$(dirname "$0")/../signin.sh" ]; then
20 login_get; INTERPLANE_KEY="$T/k2" sh "$(dirname "$0")/../signin.sh" "interplane-forge-login:$NONCE:$TS" > "$T/sig" 2> /dev/null; c=$(login_post ""); check "$c" 303 "the block signin.sh prints signs in"
21fi
22echo "---- $PASS passed, $FAIL failed"
23[ "$FAIL" = 0 ]