Compare commits

..

1 Commits

Author SHA1 Message Date
d1ce242dc9 feat: initial version
Some checks failed
Test Stalwart Installation Action / Error Handling Tests (pull_request) Successful in 16s
Test Stalwart Installation Action / Basic Installation (No Config) (pull_request) Successful in 49s
Test Stalwart Installation Action / Full Configuration (Domains + Users) (pull_request) Failing after 49s
Test Stalwart Installation Action / Test Summary (pull_request) Failing after 3s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-15 09:12:12 -05:00

View File

@@ -204,11 +204,25 @@ jobs:
run: | run: |
echo "Testing unauthenticated JMAP endpoint..." echo "Testing unauthenticated JMAP endpoint..."
# Call without authentication # Call without authentication (follow redirects with -L)
JMAP_RESPONSE=$(curl -sf "http://localhost:8080/.well-known/jmap") HTTP_CODE=$(curl -s -L \
-o /tmp/jmap_response_no_auth.json \
-w "%{http_code}" \
"http://localhost:8080/.well-known/jmap")
echo "HTTP Status Code: $HTTP_CODE"
echo "JMAP Response:"
cat /tmp/jmap_response_no_auth.json
# Check if request succeeded
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::JMAP endpoint returned HTTP $HTTP_CODE for unauthenticated request"
cat /tmp/jmap_response_no_auth.json || true
exit 1
fi
# Verify username is empty (no authentication) # Verify username is empty (no authentication)
USERNAME=$(echo "$JMAP_RESPONSE" | jq -r '.username // empty') USERNAME=$(cat /tmp/jmap_response_no_auth.json | jq -r '.username // empty')
if [ -z "$USERNAME" ]; then if [ -z "$USERNAME" ]; then
echo "✓ Unauthenticated access returns empty username" echo "✓ Unauthenticated access returns empty username"
@@ -221,13 +235,15 @@ jobs:
echo "Testing user authentication via JMAP endpoint..." echo "Testing user authentication via JMAP endpoint..."
# Test user1@test1.local authentication (follow redirects with -L) # Test user1@test1.local authentication (follow redirects with -L)
HTTP_CODE=$(curl -s -L -o /tmp/jmap_response.json -w "%{http_code}" \ HTTP_CODE=$(curl -s -L \
-o /tmp/jmap_response_auth.json
-w "%{http_code}" \
-u "user1@test1.local:UserPass123!" \ -u "user1@test1.local:UserPass123!" \
"http://localhost:8080/.well-known/jmap") "http://localhost:8080/.well-known/jmap")
echo "HTTP Status Code: $HTTP_CODE" echo "HTTP Status Code: $HTTP_CODE"
echo "JMAP Response:" echo "JMAP Response:"
cat /tmp/jmap_response.json | jq '.' || cat /tmp/jmap_response.json cat /tmp/jmap_response_auth.json
# Check if request succeeded # Check if request succeeded
if [ "$HTTP_CODE" != "200" ]; then if [ "$HTTP_CODE" != "200" ]; then
@@ -236,7 +252,7 @@ jobs:
fi fi
# Verify username field contains our test user # Verify username field contains our test user
USERNAME=$(cat /tmp/jmap_response.json | jq -r '.username // empty') USERNAME=$(cat /tmp/jmap_response_auth.json | jq -r '.username // empty')
if [ "$USERNAME" = "user1@test1.local" ]; then if [ "$USERNAME" = "user1@test1.local" ]; then
echo "✓ User authentication successful: $USERNAME" echo "✓ User authentication successful: $USERNAME"
@@ -246,7 +262,7 @@ jobs:
fi fi
# Verify accounts object is not empty (means user is authenticated) # Verify accounts object is not empty (means user is authenticated)
ACCOUNTS=$(cat /tmp/jmap_response.json | jq '.accounts // {}') ACCOUNTS=$(cat /tmp/jmap_response_auth.json | jq '.accounts // {}')
if [ "$ACCOUNTS" != "{}" ]; then if [ "$ACCOUNTS" != "{}" ]; then
echo "✓ User has active accounts" echo "✓ User has active accounts"
else else