feat: Split read/write scopes into app:read/write scopes

This commit is contained in:
Chris Coutinho
2025-10-24 04:38:49 +02:00
parent d55e5708c7
commit d452684535
45 changed files with 1630 additions and 952 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
import asyncio
import logging
import uuid
import anyio
import pytest
from httpx import HTTPStatusError
@@ -120,7 +120,7 @@ async def test_cookbook_update_recipe(nc_client: NextcloudClient):
assert updated_id == recipe_id
# Verify the update
await asyncio.sleep(1) # Allow propagation
await anyio.sleep(1) # Allow propagation
updated_recipe = await nc_client.cookbook.get_recipe(recipe_id)
assert updated_recipe["description"] == "Updated description"
assert len(updated_recipe["recipeIngredient"]) == 2
@@ -227,7 +227,7 @@ async def test_cookbook_search_recipes(nc_client: NextcloudClient):
try:
# Allow time for indexing
await asyncio.sleep(2)
await anyio.sleep(2)
# Search for the recipe
logger.info(f"Searching for recipes with keyword: {unique_keyword}")
@@ -279,7 +279,7 @@ async def test_cookbook_get_recipes_in_category(nc_client: NextcloudClient):
try:
# Allow time for indexing
await asyncio.sleep(2)
await anyio.sleep(2)
# Get recipes in this category
logger.info(f"Getting recipes in category: {unique_category}")
@@ -335,11 +335,11 @@ async def test_cookbook_get_recipes_with_keywords(nc_client: NextcloudClient):
try:
# Allow extra time for indexing
await asyncio.sleep(3)
await anyio.sleep(3)
# Trigger a reindex to ensure the recipe is indexed
await nc_client.cookbook.reindex()
await asyncio.sleep(2)
await anyio.sleep(2)
# Get recipes with this keyword
logger.info(f"Getting recipes with keyword: {unique_keyword}")
+6 -6
View File
@@ -1,7 +1,7 @@
import asyncio
import logging
import uuid # Keep uuid if needed for generating unique data within tests
import anyio
import pytest
from httpx import HTTPStatusError
@@ -66,7 +66,7 @@ async def test_notes_api_update(nc_client: NextcloudClient, temporary_note: dict
assert updated_note["etag"] != original_etag # Etag must change
# Optional: Verify update by reading again
await asyncio.sleep(1) # Allow potential propagation delay
await anyio.sleep(1) # Allow potential propagation delay
read_updated_note = await nc_client.notes.get_note(note_id=note_id)
assert read_updated_note["title"] == update_title
assert read_updated_note["content"] == update_content
@@ -96,7 +96,7 @@ async def test_notes_api_update_conflict(
new_etag = first_updated_note["etag"]
assert new_etag != original_etag
logger.info(f"Note ID: {note_id} updated, new etag: {new_etag}")
await asyncio.sleep(1)
await anyio.sleep(1)
# Now attempt update with the *original* etag
logger.info(
@@ -155,7 +155,7 @@ async def test_notes_api_append_content_to_existing_note(
assert updated_note["content"] == expected_content
# Verify by reading the note again
await asyncio.sleep(1) # Allow potential propagation delay
await anyio.sleep(1) # Allow potential propagation delay
read_note = await nc_client.notes.get_note(note_id=note_id)
assert read_note["content"] == expected_content
logger.info(f"Successfully appended content to note ID: {note_id}")
@@ -189,7 +189,7 @@ async def test_notes_api_append_content_to_empty_note(nc_client: NextcloudClient
assert updated_note["content"] == append_text
# Verify by reading the note again
await asyncio.sleep(1)
await anyio.sleep(1)
read_note = await nc_client.notes.get_note(note_id=note_id)
assert read_note["content"] == append_text
logger.info(f"Successfully appended content to empty note ID: {note_id}")
@@ -237,7 +237,7 @@ async def test_notes_api_append_content_multiple_times(
assert updated_note["content"] == expected_content_after_second
# Verify by reading the note again
await asyncio.sleep(1)
await anyio.sleep(1)
read_note = await nc_client.notes.get_note(note_id=note_id)
assert read_note["content"] == expected_content_after_second
logger.info(f"Successfully performed multiple appends to note ID: {note_id}")
+4 -4
View File
@@ -1,8 +1,8 @@
import asyncio
import logging
import uuid
from typing import Any, Dict
import anyio
import pytest
from httpx import HTTPStatusError
@@ -264,7 +264,7 @@ async def test_tables_create_row(
assert created_row["tableId"] == table_id
# Verify the row was created by reading it back
await asyncio.sleep(1) # Allow potential propagation delay
await anyio.sleep(1) # Allow potential propagation delay
rows = await nc_client.tables.get_table_rows(table_id)
created_row_id = created_row["id"]
@@ -338,7 +338,7 @@ async def test_tables_update_row(
assert updated_row["id"] == row_id
# Verify the row was updated by reading it back
await asyncio.sleep(1) # Allow potential propagation delay
await anyio.sleep(1) # Allow potential propagation delay
table_id = sample_table_info["table_id"]
rows = await nc_client.tables.get_table_rows(table_id)
@@ -401,7 +401,7 @@ async def test_tables_delete_row(
# The delete response might vary, but it should be successful
# Verify the row was deleted by trying to find it
await asyncio.sleep(1) # Allow potential propagation delay
await anyio.sleep(1) # Allow potential propagation delay
rows = await nc_client.tables.get_table_rows(table_id)
# Ensure the deleted row is not in the results
-3
View File
@@ -9,7 +9,6 @@ logger = logging.getLogger(__name__)
pytestmark = pytest.mark.integration
@pytest.mark.anyio
async def test_create_and_delete_share(nc_client):
"""Test creating and deleting a file share."""
# Create a test user to share with
@@ -68,7 +67,6 @@ async def test_create_and_delete_share(nc_client):
pass
@pytest.mark.anyio
async def test_update_share_permissions(nc_client):
"""Test updating share permissions."""
# Create a test user to share with
@@ -120,7 +118,6 @@ async def test_update_share_permissions(nc_client):
pass
@pytest.mark.anyio
async def test_list_shares(nc_client):
"""Test listing all shares."""
# Create a test user to share with