From 140cbb440e45b0c39d09b3ab427bd66fe4c92ade Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Thu, 11 Jun 2026 03:06:47 +0200 Subject: [PATCH] chore(test): fix deprecated call or syntax --- tests/api/grants_nested_groups.hurl | 2 +- tests/api/nc_auth_failures.hurl | 4 ++-- tests/common/server.env | 2 +- tests/webdav/test_chunked_upload_dedup.sh | 4 ++-- tests/webdav/test_dedup_webdav_multichunk.sh | 12 ++++++------ tests/webdav/test_dedup_webdav_ref_count.sh | 8 ++++---- tests/webdav/test_nextcloud_chunked_upload_cap.sh | 4 ++-- tests/webdav/test_nextcloud_put_blake3.sh | 4 ++-- tests/webdav/test_thumbnail_update.sh | 8 ++++---- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/api/grants_nested_groups.hurl b/tests/api/grants_nested_groups.hurl index 0acf11a1..e11c6282 100644 --- a/tests/api/grants_nested_groups.hurl +++ b/tests/api/grants_nested_groups.hurl @@ -365,7 +365,7 @@ Authorization: Bearer {{henry_token}} HTTP 200 [Asserts] jsonpath "$.items[?(@.resource.id=='{{perm_folder_id}}')].resource_type" == "folder" -jsonpath "$.items[?(@.resource.id=='{{perm_folder_id}}')].permissions" includes "read" +jsonpath "$.items[?(@.resource.id=='{{perm_folder_id}}')].permissions" contains "read" # ── Mutations still denied (Viewer has no Update/Create/Delete) ─ POST {{base_url}}/api/folders diff --git a/tests/api/nc_auth_failures.hurl b/tests/api/nc_auth_failures.hurl index f88ce297..3033d933 100644 --- a/tests/api/nc_auth_failures.hurl +++ b/tests/api/nc_auth_failures.hurl @@ -12,7 +12,7 @@ # 6 wrong attempts from spoofed X-Forwarded-For: IP1 # lock (admin, IP1), but the SAME correct credential # from spoofed X-Forwarded-For: IP2 still succeeds. -# Depends on OXICLOUD_TRUST_PROXY_HEADERS=true in +# Depends on OXICLOUD_TRUST_PROXY_CIDR=0.0.0.0/0 in # tests/common/server.env so the server honours the # X-Forwarded-For header on localhost. # @@ -191,7 +191,7 @@ header "WWW-Authenticate" contains "Basic" # (admin, 10.0.0.2 — released by the success), neither of # which any other test touches. # -# Requires: OXICLOUD_TRUST_PROXY_HEADERS=true in +# Requires: OXICLOUD_TRUST_PROXY_CIDR=0.0.0.0/0 in # tests/common/server.env. # ───────────────────────────────────────────────────────────── diff --git a/tests/common/server.env b/tests/common/server.env index c780751d..979625d5 100644 --- a/tests/common/server.env +++ b/tests/common/server.env @@ -60,4 +60,4 @@ OXICLOUD_MAGIC_LINK_SEND_PER_EMAIL_PER_HOUR=2 OXICLOUD_MAGIC_LINK_SEND_PER_IP_PER_HOUR=50 # permits IP spoofing for tests -OXICLOUD_TRUST_PROXY_HEADERS=true +OXICLOUD_TRUST_PROXY_CIDR=0.0.0.0/0 diff --git a/tests/webdav/test_chunked_upload_dedup.sh b/tests/webdav/test_chunked_upload_dedup.sh index c9cd10d7..877e0d4b 100755 --- a/tests/webdav/test_chunked_upload_dedup.sh +++ b/tests/webdav/test_chunked_upload_dedup.sh @@ -43,8 +43,8 @@ dedup_check() { curl -s -H "Authorization: Bearer $TOKEN" "$base_url/api/dedup/c purge_from_trash() { local name="$1" local tid - tid=$(rest_get "/api/trash" \ - | jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty') + tid=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') [[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true } diff --git a/tests/webdav/test_dedup_webdav_multichunk.sh b/tests/webdav/test_dedup_webdav_multichunk.sh index dd742afc..68e0b7af 100755 --- a/tests/webdav/test_dedup_webdav_multichunk.sh +++ b/tests/webdav/test_dedup_webdav_multichunk.sh @@ -73,8 +73,8 @@ dedup_check() { curl -s -H "Authorization: Bearer $TOKEN" "$base_url/api/dedup/c purge_from_trash() { local name="$1" local tid - tid=$(rest_get "/api/trash" \ - | jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty') + tid=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') [[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true } @@ -179,8 +179,8 @@ echo " step 4: trash + permanently delete $FILE_A..." ST=$(rest_delete "/api/files/$FILE_A_ID") [[ "$ST" == "204" ]] || fail "DELETE $FILE_A expected 204, got $ST" -TRASH_A=$(rest_get "/api/trash" \ - | jq -r --arg n "$FILE_A" 'first(.[] | select(.name == $n) | .id) // empty') +TRASH_A=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$FILE_A" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') [[ -n "$TRASH_A" ]] || fail "File A not found in trash" ST=$(rest_delete "/api/trash/$TRASH_A") [[ "$ST" == "200" ]] || fail "Permanent delete file A expected 200, got $ST" @@ -206,8 +206,8 @@ echo " step 6: trash + permanently delete $FILE_B..." ST=$(rest_delete "/api/files/$FILE_B_ID") [[ "$ST" == "204" ]] || fail "DELETE $FILE_B expected 204, got $ST" -TRASH_B=$(rest_get "/api/trash" \ - | jq -r --arg n "$FILE_B" 'first(.[] | select(.name == $n) | .id) // empty') +TRASH_B=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$FILE_B" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') [[ -n "$TRASH_B" ]] || fail "File B not found in trash" ST=$(rest_delete "/api/trash/$TRASH_B") [[ "$ST" == "200" ]] || fail "Permanent delete file B expected 200, got $ST" diff --git a/tests/webdav/test_dedup_webdav_ref_count.sh b/tests/webdav/test_dedup_webdav_ref_count.sh index e1bf400a..a8a9420e 100755 --- a/tests/webdav/test_dedup_webdav_ref_count.sh +++ b/tests/webdav/test_dedup_webdav_ref_count.sh @@ -113,8 +113,8 @@ for REMOTE in "$FILE_A" "$FILE_B"; do echo " cleanup: deleting existing $REMOTE (id=$EXISTING_ID)" rest_delete "/api/files/$EXISTING_ID" > /dev/null fi - STALE=$(rest_get "/api/trash" \ - | jq -r --arg n "$REMOTE" 'first(.[] | select(.name == $n) | .id) // empty') + STALE=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') if [[ -n "$STALE" ]]; then echo " cleanup: purging $REMOTE from trash (id=$STALE)" rest_delete "/api/trash/$STALE" > /dev/null @@ -221,8 +221,8 @@ echo " cleanup..." for REMOTE in "$FILE_A" "$FILE_B"; do ST=$(webdav_delete "$REMOTE") [[ "$ST" == "204" ]] || fail "WebDAV DELETE $REMOTE expected 204, got $ST" - TRASH_ITEM=$(rest_get "/api/trash" \ - | jq -r --arg n "$REMOTE" 'first(.[] | select(.name == $n) | .id) // empty') + TRASH_ITEM=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') if [[ -n "$TRASH_ITEM" ]]; then rest_delete "/api/trash/$TRASH_ITEM" > /dev/null fi diff --git a/tests/webdav/test_nextcloud_chunked_upload_cap.sh b/tests/webdav/test_nextcloud_chunked_upload_cap.sh index 79c14b5a..681a4089 100755 --- a/tests/webdav/test_nextcloud_chunked_upload_cap.sh +++ b/tests/webdav/test_nextcloud_chunked_upload_cap.sh @@ -51,8 +51,8 @@ rest_delete() { curl -s -o /dev/null -w "%{http_code}" -X DELETE -H "Authorizati purge_from_trash() { local name="$1" local tid - tid=$(rest_get "/api/trash" \ - | jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty') + tid=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') [[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true } diff --git a/tests/webdav/test_nextcloud_put_blake3.sh b/tests/webdav/test_nextcloud_put_blake3.sh index c5daf28c..78733814 100755 --- a/tests/webdav/test_nextcloud_put_blake3.sh +++ b/tests/webdav/test_nextcloud_put_blake3.sh @@ -49,8 +49,8 @@ rest_delete() { curl -s -o /dev/null -w "%{http_code}" -X DELETE -H "Authorizati purge_from_trash() { local name="$1" local tid - tid=$(rest_get "/api/trash" \ - | jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty') + tid=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') [[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true } diff --git a/tests/webdav/test_thumbnail_update.sh b/tests/webdav/test_thumbnail_update.sh index 5273507a..284f91bc 100755 --- a/tests/webdav/test_thumbnail_update.sh +++ b/tests/webdav/test_thumbnail_update.sh @@ -132,8 +132,8 @@ else fi echo " cleanup: checking trash for '$REMOTE'..." -STALE=$(rest_get "/api/trash" \ - | jq -r --arg n "$REMOTE" 'first(.[] | select(.name == $n) | .id) // empty') +STALE=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') if [[ -n "$STALE" ]]; then echo " cleanup: found trash item id=$STALE — purging..." ST=$(rest_delete "/api/trash/$STALE") @@ -221,8 +221,8 @@ echo " cleanup: WebDAV DELETE → $STATUS" [[ "$STATUS" == "204" ]] || fail "WebDAV DELETE expected 204, got $STATUS" pass "WebDAV DELETE → 204" -TRASH_ITEM=$(rest_get "/api/trash" \ - | jq -r --arg n "$REMOTE" '.[] | select(.name == $n) | .id // empty') +TRASH_ITEM=$(rest_get "/api/trash/resources" \ + | jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty') if [[ -n "$TRASH_ITEM" ]]; then ST=$(rest_delete "/api/trash/$TRASH_ITEM") echo " cleanup: DELETE /api/trash/$TRASH_ITEM → $ST"