v0.0.11 - All auth tests working

This commit is contained in:
Your Name
2025-09-10 11:08:33 -04:00
parent 30473100b8
commit 6a4e15670d
10 changed files with 556 additions and 104 deletions

View File

@@ -196,6 +196,22 @@ test_failure_mode() {
-X PUT "$UPLOAD_ENDPOINT" \
-o "$response_file" 2>/dev/null)
# Show detailed error response if test fails unexpectedly
if [[ "$http_status" != "$expected_status" ]]; then
echo ""
echo "=== DETAILED ERROR RESPONSE FOR: $test_name ==="
echo "Expected HTTP Status: $expected_status"
echo "Actual HTTP Status: $http_status"
echo "Response Body:"
if [[ -f "$response_file" && -s "$response_file" ]]; then
cat "$response_file"
else
echo "(No response body or empty response)"
fi
echo "=== END DETAILED ERROR RESPONSE ==="
echo ""
fi
rm -f "$test_file" "$response_file"
# Record result
@@ -361,7 +377,7 @@ create_nip42_auth_event() {
# Create NIP-42 authentication event (kind 22242) using nak for proper signing
nak event -k 22242 -c "" \
--tag "relay=ws://localhost:9001" \
--tag "relay=ginxsom" \
--tag "challenge=$challenge" \
--sec "$privkey"
}
@@ -399,6 +415,24 @@ test_nip42_authentication() {
-X PUT "$UPLOAD_ENDPOINT" \
-o "$response_file" 2>/dev/null)
# Show detailed error response if NIP-42 test fails
if [[ "$http_status" != "200" ]]; then
echo ""
echo "=== DETAILED NIP-42 ERROR RESPONSE ==="
echo "Expected HTTP Status: 200"
echo "Actual HTTP Status: $http_status"
echo "Challenge used: $challenge"
echo "Response Body:"
if [[ -f "$response_file" && -s "$response_file" ]]; then
cat "$response_file"
else
echo "(No response body or empty response)"
fi
echo "Auth Header (first 100 chars): ${nip42_auth_header:0:100}..."
echo "=== END DETAILED NIP-42 ERROR RESPONSE ==="
echo ""
fi
rm -f "$response_file"
# Record result