From e495ed5d4b43dfc97a3a0effb4a831376de945a9 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Fri, 23 Oct 2026 10:29:53 +0200 Subject: [PATCH] Mcp (#1349) * TMerge branch 'master' of github.com:Squidex/squidex into feature/fulltext-search * MCP * Fix tests * Fix tests * Fix tests again * Add missing files * T * Fixes * Fix playwright. * Update node * Fix tests once more. --- .claude/launch.json | 18 + .github/workflows/dev.yml | 4 +- .github/workflows/make-screenshots.yml | 2 +- .github/workflows/release.yml | 4 +- CLAUDE.md | 2 + backend/i18n/frontend_de.json | 8 + backend/i18n/frontend_en.json | 8 + backend/i18n/frontend_fr.json | 8 + backend/i18n/frontend_it.json | 8 + backend/i18n/frontend_nl.json | 8 + backend/i18n/frontend_pt.json | 8 + backend/i18n/frontend_zh.json | 8 + backend/i18n/source/frontend_de.json | 8 + backend/i18n/source/frontend_en.json | 8 + .../Pipeline/AppPermissionClaims.cs | 132 ++++++ .../src/Squidex.Web/Pipeline/AppResolver.cs | 111 +---- .../Areas/Mcp/Config/McpAppMiddleware.cs | 83 ++++ .../Mcp/Config/McpClientSecretHandler.cs | 118 +++++ .../Areas/Mcp/Config/McpEndpointMetadata.cs | 12 + .../Squidex/Areas/Mcp/Config/McpServices.cs | 46 ++ .../src/Squidex/Areas/Mcp/Tools/AssetTools.cs | 91 ++++ .../Squidex/Areas/Mcp/Tools/ContentTools.cs | 85 ++++ .../Squidex/Areas/Mcp/Tools/McpToolBase.cs | 58 +++ .../Squidex/Areas/Mcp/Tools/SchemaTools.cs | 70 +++ .../Authentication/IdentityServerServices.cs | 6 + backend/src/Squidex/Squidex.csproj | 1 + backend/src/Squidex/Startup.cs | 4 + .../client-connect-form.component.html | 40 ++ .../clients/client-connect-form.component.ts | 33 ++ .../TestSuite.ApiTests/AppClientsTests.cs | 6 +- .../AppContributorsTests.cs | 12 +- .../TestSuite.ApiTests/AppRolesTests.cs | 6 +- .../TestSuite/TestSuite.ApiTests/AppTests.cs | 8 +- .../TestSuite.ApiTests/AssetFormatTests.cs | 6 +- .../TestSuite.ApiTests/AssetTests.cs | 28 +- .../TestSuite.ApiTests/GraphQLTests.cs | 10 +- .../TestSuite.ApiTests/McpFixture.cs | 34 ++ .../TestSuite/TestSuite.ApiTests/McpTests.cs | 428 ++++++++++++++++++ .../TestSuite.ApiTests/SchemaTests.cs | 4 +- .../Settings/VerifySettings.cs | 11 + .../TeamContributorTests.cs | 12 +- .../TestSuite/TestSuite.ApiTests/TeamTests.cs | 6 +- .../TestSuite.ApiTests.csproj | 1 + ...pp_with_anonymous_read_access.verified.txt | 24 + ...p_with_anonymous_write_access.verified.txt | 24 + ...ntsTests.Should_create_client.verified.txt | 4 + ...ntsTests.Should_delete_client.verified.txt | 6 + ...ntsTests.Should_update_client.verified.txt | 10 + ...sts.Should_invite_contributor.verified.txt | 5 + ...sts.Should_remove_contributor.verified.txt | 7 + ...eationTests.Should_create_app.verified.txt | 24 + ...uld_create_app_from_templates.verified.txt | 76 ++++ ...ts.Should_add_custom_language.verified.txt | 6 + ...agesTests.Should_add_language.verified.txt | 6 + ...sTests.Should_delete_language.verified.txt | 4 + ...sTests.Should_update_language.verified.txt | 6 + ...Should_update_master_language.verified.txt | 6 + ...RolesTests.Should_create_role.verified.txt | 3 + ...d_create_role_with_buggy_name.verified.txt | 3 + ...RolesTests.Should_update_role.verified.txt | 3 + ...pTests.Should_update_settings.verified.txt | 3 + ...sTests.Should_create_workflow.verified.txt | 2 + ...sTests.Should_delete_workflow.verified.txt | 2 + ...sTests.Should_update_workflow.verified.txt | 4 + ...ersTests.Should_create_folder.verified.txt | 3 + ...ersTests.Should_update_folder.verified.txt | 3 + ...tTests.Should_fix_orientation.verified.txt | 12 + ...Tests.Should_upload_audio_mp3.verified.txt | 12 + ..._image_bmp_and_encode_to_webp.verified.txt | 12 + ...d_upload_image_bmp_and_resize.verified.txt | 12 + ...d_upload_image_gif_and_resize.verified.txt | 12 + ...d_image_gif_without_extension.verified.txt | 15 + ...d_upload_image_jpg_and_resize.verified.txt | 12 + ...d_upload_image_png_and_resize.verified.txt | 12 + ...d_upload_image_tga_and_resize.verified.txt | 12 + ..._upload_image_tiff_and_resize.verified.txt | 12 + ..._upload_image_webp_and_resize.verified.txt | 12 + ...Tests.Should_upload_video_flv.verified.txt | 12 + ...Tests.Should_upload_video_mkv.verified.txt | 12 + ...Tests.Should_upload_video_mp4.verified.txt | 12 + ...ld_annotate_asset_in_parallel.verified.txt | 14 + ...asset_file_name_strategy=Bulk.verified.txt | 12 + ...set_file_name_strategy=Single.verified.txt | 12 + ..._asset_metadata_strategy=Bulk.verified.txt | 12 + ...sset_metadata_strategy=Single.verified.txt | 12 + ...note_asset_slug_strategy=Bulk.verified.txt | 12 + ...te_asset_slug_strategy=Single.verified.txt | 12 + ...note_asset_tags_strategy=Bulk.verified.txt | 12 + ...te_asset_tags_strategy=Single.verified.txt | 12 + ...ould_compute_blur_hash_script.verified.txt | 12 + ...d_protect_asset_strategy=Bulk.verified.txt | 12 + ...protect_asset_strategy=Single.verified.txt | 12 + ...uld_protect_asset_with_script.verified.txt | 12 + ...setTests.Should_replace_asset.verified.txt | 12 + ...ssetTests.Should_upload_asset.verified.txt | 12 + ...d_upload_asset_with_custom_id.verified.txt | 12 + ...s.Should_create_json_with_dot.verified.txt | 12 + ..._create_non_published_content.verified.txt | 10 + ...ld_create_null_localized_text.verified.txt | 12 + ...ould_create_published_content.verified.txt | 12 + ...ts.Should_create_strange_text.verified.txt | 12 + ...Should_get_content_by_version.verified.txt | 12 + ...leton_content_with_special_id.verified.txt | 10 + ...phQLTests.Should_query_assets.verified.txt | 43 +- ...access_if_client_is_anonymous.verified.txt | 10 + ...ent_secret_fullClientId=False.verified.txt | 10 + ...ient_secret_fullClientId=True.verified.txt | 10 + .../McpTests.Should_get_asset.verified.txt | 24 + .../McpTests.Should_get_content.verified.txt | 19 + .../McpTests.Should_get_schema.verified.txt | 304 +++++++++++++ .../McpTests.Should_list_tools.verified.txt | 186 ++++++++ ...published_contents_by_default.verified.txt | 3 + ...Should_query_assets_with_json.verified.txt | 29 ++ ...hould_query_assets_with_odata.verified.txt | 29 ++ ...ould_query_contents_with_json.verified.txt | 27 ++ ...uld_query_contents_with_odata.verified.txt | 49 ++ ...blished_contents_if_requested.verified.txt | 27 ++ ...ror_if_odata_query_is_invalid.verified.txt | 11 + ...urn_error_if_schema_not_found.verified.txt | 11 + ...hould_log_to_console_in_rules.verified.txt | 13 +- .../RuleTests.Should_create_rule.verified.txt | 10 + ...hould_create_rule_with_action.verified.txt | 10 + .../RuleTests.Should_update_rule.verified.txt | 10 + ...hould_create_singleton_schema.verified.txt | 20 + ...schema_with_obsolete_property.verified.txt | 20 + ...sts.Should_invite_contributor.verified.txt | 5 + ...sts.Should_remove_contributor.verified.txt | 7 + .../Fixtures/ClientFixture.cs | 20 +- tools/e2e/package-lock.json | 50 +- tools/e2e/package.json | 2 +- 130 files changed, 2977 insertions(+), 225 deletions(-) create mode 100644 .claude/launch.json create mode 100644 backend/src/Squidex.Web/Pipeline/AppPermissionClaims.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Config/McpAppMiddleware.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Config/McpClientSecretHandler.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Config/McpEndpointMetadata.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Config/McpServices.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Tools/AssetTools.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Tools/ContentTools.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Tools/McpToolBase.cs create mode 100644 backend/src/Squidex/Areas/Mcp/Tools/SchemaTools.cs create mode 100644 tools/TestSuite/TestSuite.ApiTests/McpFixture.cs create mode 100644 tools/TestSuite/TestSuite.ApiTests/McpTests.cs create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_allow_anonymous_access_if_client_is_anonymous.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=False.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=True.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_asset.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_content.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_schema.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_list_tools.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_not_query_unpublished_contents_by_default.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_json.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_odata.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_json.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_odata.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_unpublished_contents_if_requested.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_odata_query_is_invalid.verified.txt create mode 100644 tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_schema_not_found.verified.txt diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 000000000..3a8283d99 --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,18 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "frontend", + "runtimeExecutable": "npm", + "runtimeArgs": ["start", "--prefix", "frontend"], + "port": 3000 + }, + { + "name": "backend", + "runtimeExecutable": "dotnet", + "runtimeArgs": ["run", "--project", "backend/src/Squidex", "--no-launch-profile", "--environment", "Development"], + "url": "https://localhost:5001", + "port": 5001 + } + ] +} diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 9b51efaf0..ad237e4bb 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -72,7 +72,7 @@ jobs: - name: Prepare - Setup Node uses: actions/setup-node@v4.4.0 with: - node-version: 18 + node-version: 22 - name: Build uses: docker/build-push-action@v6.18.0 @@ -198,7 +198,7 @@ jobs: - name: Prepare - Setup Node uses: actions/setup-node@v4.4.0 with: - node-version: 18 + node-version: 22 - name: Build uses: docker/build-push-action@v6.18.0 diff --git a/.github/workflows/make-screenshots.yml b/.github/workflows/make-screenshots.yml index 2e38a20e4..cea735c4b 100644 --- a/.github/workflows/make-screenshots.yml +++ b/.github/workflows/make-screenshots.yml @@ -20,7 +20,7 @@ jobs: - name: Prepare - Setup Node uses: actions/setup-node@v4.4.0 with: - node-version: 18 + node-version: 22 - name: Build - BUILD uses: docker/build-push-action@v6.18.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 287b055cd..b94b32377 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: - name: Prepare - Setup Node uses: actions/setup-node@v4.4.0 with: - node-version: 18 + node-version: 22 - name: Build uses: docker/build-push-action@v6.18.0 @@ -176,7 +176,7 @@ jobs: - name: Prepare - Setup Node uses: actions/setup-node@v4.4.0 with: - node-version: 18 + node-version: 22 - name: Build uses: docker/build-push-action@v6.18.0 diff --git a/CLAUDE.md b/CLAUDE.md index ff0af2c9c..c7c14d664 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -48,6 +48,8 @@ dotnet test --filter "Category!=Dependencies & Category!=TestContainer" - Use xUnit assertions (`Assert.Equal`, `Assert.True`, `Assert.Single`, `Assert.Empty`, ...) for simple properties and values. - Use FluentAssertions (`Should().BeEquivalentTo(...)`) only for deep, structural comparisons of objects and collections. +- In Verify snapshot tests, verify one result per `Verify`/`VerifyJson` call. Do not combine several results into one snapshot. +- Prefer scrubbing (`ScrubInlineGuids`, `AddScrubber`, ...) over ignoring members (`IgnoreMember`) for values that change between runs or environments. Only ignore members if they cannot be scrubbed. ### Best Practices diff --git a/backend/i18n/frontend_de.json b/backend/i18n/frontend_de.json index e6e4826cb..701b5c489 100644 --- a/backend/i18n/frontend_de.json +++ b/backend/i18n/frontend_de.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Verwenden Sie einfach das folgende Token", "clients.connectWizard.manuallyStep3": "Fügen Sie das Token als HTTP-Header zu allen Anfragen hinzu", "clients.connectWizard.manuallyTokenHint": "Tokens laufen normalerweise nach 30 Tagen ab, aber Sie können mehrere Tokens anfordern.", + "clients.connectWizard.mcp": "KI-Agenten verbinden (MCP)", + "clients.connectWizard.mcpHint": "Geben Sie KI-Agenten wie Claude, GitHub Copilot oder Cursor über das Model Context Protocol Zugriff auf die Schemas, Inhalte und Assets dieser App.", + "clients.connectWizard.mcpSecretHint": "Die Konfiguration enthält das Client-Secret und läuft nicht ab. Löschen Sie den Client oder erstellen Sie ein neues Secret, um den Zugriff zu widerrufen.", + "clients.connectWizard.mcpStep1": "Verwenden Sie den MCP-Endpunkt dieser App", + "clients.connectWizard.mcpStep1Hint": "Der Endpunkt verwendet den Streamable-HTTP-Transport. Der Agent hat dieselben Berechtigungen wie dieser Client.", + "clients.connectWizard.mcpStep2": "Fügen Sie den Server zu Claude Code hinzu", + "clients.connectWizard.mcpStep3": "Oder fügen Sie den Server zur MCP-Konfiguration Ihres Clients hinzu", + "clients.connectWizard.mcpStep3Hint": "Dieses Format wird von den meisten Clients verwendet, z. B. Claude Desktop oder Cursor. VS Code verwendet `servers` statt `mcpServers`.", "clients.connectWizard.postManDocs": "Beginnen Sie mit dem Postman-Tutorial in der [Dokumentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Verwenden Sie das offizielle SDK", "clients.connectWizard.sdkHelp": "Benötigen Sie ein anderes SDK?", diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index ef4e094c1..35d8a8769 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Just use the following token", "clients.connectWizard.manuallyStep3": "Add the token as HTTP header to all requests", "clients.connectWizard.manuallyTokenHint": "Tokens usally expire after 30days, but you can request multiple tokens.", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "Start with the Postman tutorial in the [Documentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "You need another SDK?", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index 09858e29e..85691c70a 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Utilisez simplement le jeton suivant", "clients.connectWizard.manuallyStep3": "Ajouter le jeton en tant qu'en-tête HTTP à toutes les requêtes", "clients.connectWizard.manuallyTokenHint": "Les jetons expirent généralement après 30 jours, mais vous pouvez demander plusieurs jetons.", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "Commencez par le tutoriel Postman dans la [Documentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Vous avez besoin d'un autre SDK\u00A0?", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index b8fe639f3..f60ceb0ad 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Utilizza il seguente token", "clients.connectWizard.manuallyStep3": "Aggiungi il token come header HTTP header a tutte le richieste", "clients.connectWizard.manuallyTokenHint": "Solitamente i Token scadono dopo 30 giorni, ma puoi richiedere token multipli.", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "Per il tutorial Postman inizia da questo link [Documentazione](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Hai bisogno di un altro SDK?", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index d902d9dbf..e0be14c7d 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Gebruik gewoon het volgende token", "clients.connectWizard.manuallyStep3": "Voeg het token toe als HTTP-header aan alle verzoeken", "clients.connectWizard.manuallyTokenHint": "Tokens vervallen gewoonlijk na 30 dagen, maar je kunt meerdere tokens aanvragen.", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "Begin met de Postman-tutorial in de [Documentatie] (https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Heb je een andere SDK nodig?", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index b0db79d75..a7b93cdb8 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Basta usar o seguinte token", "clients.connectWizard.manuallyStep3": "Adicione o token como cabeçalho HTTP a todos os pedidos", "clients.connectWizard.manuallyTokenHint": "Tokens normalmente expiram após 30 dias, mas você pode solicitar várias tokens.", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "Comece com o tutorial do Carteiro na [Documentação](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Precisa de outro SDK?", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index d75a06f8e..5d5fa6591 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "只需使用以下令牌", "clients.connectWizard.manuallyStep3": "将令牌作为 HTTP 标头添加到所有请求中", "clients.connectWizard.manuallyTokenHint": "令牌通常会在 30 天后过期,但您可以请求多个令牌。", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "从 [文档](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman) 中的 Postman 教程开始。", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "你需要另一个 SDK?", diff --git a/backend/i18n/source/frontend_de.json b/backend/i18n/source/frontend_de.json index 9b0d9aa79..6e2614ab9 100644 --- a/backend/i18n/source/frontend_de.json +++ b/backend/i18n/source/frontend_de.json @@ -170,6 +170,14 @@ "clients.connectWizard.manuallyStep2": "Verwenden Sie einfach das folgende Token", "clients.connectWizard.manuallyStep3": "Fügen Sie das Token als HTTP-Header zu allen Anfragen hinzu", "clients.connectWizard.manuallyTokenHint": "Tokens laufen normalerweise nach 30 Tagen ab, aber Sie können mehrere Tokens anfordern.", + "clients.connectWizard.mcp": "KI-Agenten verbinden (MCP)", + "clients.connectWizard.mcpHint": "Geben Sie KI-Agenten wie Claude, GitHub Copilot oder Cursor über das Model Context Protocol Zugriff auf die Schemas, Inhalte und Assets dieser App.", + "clients.connectWizard.mcpSecretHint": "Die Konfiguration enthält das Client-Secret und läuft nicht ab. Löschen Sie den Client oder erstellen Sie ein neues Secret, um den Zugriff zu widerrufen.", + "clients.connectWizard.mcpStep1": "Verwenden Sie den MCP-Endpunkt dieser App", + "clients.connectWizard.mcpStep1Hint": "Der Endpunkt verwendet den Streamable-HTTP-Transport. Der Agent hat dieselben Berechtigungen wie dieser Client.", + "clients.connectWizard.mcpStep2": "Fügen Sie den Server zu Claude Code hinzu", + "clients.connectWizard.mcpStep3": "Oder fügen Sie den Server zur MCP-Konfiguration Ihres Clients hinzu", + "clients.connectWizard.mcpStep3Hint": "Dieses Format wird von den meisten Clients verwendet, z. B. Claude Desktop oder Cursor. VS Code verwendet `servers` statt `mcpServers`.", "clients.connectWizard.postManDocs": "Beginnen Sie mit dem Postman-Tutorial in der [Dokumentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Verwenden Sie das offizielle SDK", "clients.connectWizard.sdkHelp": "Benötigen Sie ein anderes SDK?", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index ef4e094c1..35d8a8769 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -176,6 +176,14 @@ "clients.connectWizard.manuallyStep2": "Just use the following token", "clients.connectWizard.manuallyStep3": "Add the token as HTTP header to all requests", "clients.connectWizard.manuallyTokenHint": "Tokens usally expire after 30days, but you can request multiple tokens.", + "clients.connectWizard.mcp": "Connect an AI agent (MCP)", + "clients.connectWizard.mcpHint": "Give AI agents like Claude, GitHub Copilot or Cursor access to the schemas, contents and assets of this app with the Model Context Protocol.", + "clients.connectWizard.mcpSecretHint": "The configuration contains the client secret and does not expire. Delete the client or create a new secret to revoke the access.", + "clients.connectWizard.mcpStep1": "Use the MCP endpoint of this app", + "clients.connectWizard.mcpStep1Hint": "The endpoint uses the Streamable HTTP transport. The agent has the same permissions as this client.", + "clients.connectWizard.mcpStep2": "Add the server to Claude Code", + "clients.connectWizard.mcpStep3": "Or add the server to the MCP configuration of your client", + "clients.connectWizard.mcpStep3Hint": "This format is used by most clients, e.g. Claude Desktop or Cursor. VS Code uses `servers` instead of `mcpServers`.", "clients.connectWizard.postManDocs": "Start with the Postman tutorial in the [Documentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "You need another SDK?", diff --git a/backend/src/Squidex.Web/Pipeline/AppPermissionClaims.cs b/backend/src/Squidex.Web/Pipeline/AppPermissionClaims.cs new file mode 100644 index 000000000..8f22705c2 --- /dev/null +++ b/backend/src/Squidex.Web/Pipeline/AppPermissionClaims.cs @@ -0,0 +1,132 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Security.Claims; +using Squidex.Domain.Apps.Core.Apps; +using Squidex.Domain.Apps.Entities; +using Squidex.Infrastructure.Security; +using Squidex.Shared; +using Squidex.Shared.Identity; + +namespace Squidex.Web.Pipeline; + +public static class AppPermissionClaims +{ + public static void Enrich(App app, ClaimsPrincipal user) + { + var isFrontend = user.IsInClient(DefaultClients.Frontend); + + string? clientId = null; + + var (role, permissions) = FindByOpenIdSubject(app, user, isFrontend); + if (permissions == null) + { + (clientId, role, permissions) = FindByOpenIdClient(app, user, isFrontend); + } + + if (permissions == null) + { + (role, permissions) = FindByUserInfo(app, user, isFrontend); + } + + if (permissions == null) + { + (clientId, role, permissions) = FindAnonymousClient(app, isFrontend); + } + + if (permissions == null) + { + return; + } + + var identity = user.Identities.First(); + + if (!string.IsNullOrWhiteSpace(role)) + { + identity.AddClaim(new Claim(ClaimTypes.Role, role)); + } + + foreach (var permission in permissions) + { + identity.AddClaim(new Claim(SquidexClaimTypes.Permissions, permission.Id)); + } + + if (user.Token() == null && clientId != null) + { + identity.AddClaim(new Claim(OpenIdClaims.ClientId, clientId)); + } + } + + public static bool HasAppPermission(string appName, Context requestContext) + { + return requestContext.UserPermissions.Includes(PermissionIds.ForApp(PermissionIds.App, appName)); + } + + private static (string?, string?, PermissionSet?) FindByOpenIdClient(App app, ClaimsPrincipal user, bool isFrontend) + { + var (appName, clientId) = user.GetClient(); + if (app.Name != appName || clientId == null) + { + return default; + } + + if (app.TryGetClientRole(clientId, isFrontend, out var role)) + { + return (clientId, role.Name, role.Permissions); + } + + return default; + } + + private static (string?, PermissionSet?) FindByUserInfo(App app, ClaimsPrincipal user, bool isFrontend) + { + var (_, appName, roleName) = user.GetUserInfo(); + if (app.Name != appName || roleName == null) + { + return default; + } + + if (app.TryGetRole(roleName, isFrontend, out var role)) + { + return (role.Name, role.Permissions); + } + + return default; + } + + private static (string?, string?, PermissionSet?) FindAnonymousClient(App app, bool isFrontend) + { + var client = app.Clients.FirstOrDefault(x => x.Value.AllowAnonymous); + if (client.Value == null) + { + return default; + } + + if (app.TryGetRole(client.Value.Role, isFrontend, out var role)) + { + return (client.Key, role.Name, role.Permissions); + } + + return default; + } + + private static (string?, PermissionSet?) FindByOpenIdSubject(App app, ClaimsPrincipal user, bool isFrontend) + { + var subjectId = user.OpenIdSubject(); + if (subjectId == null) + { + return default; + } + + if (app.TryGetContributorRole(subjectId, isFrontend, out var role)) + { + return (role.Name, role.Permissions); + } + + return default; + } +} diff --git a/backend/src/Squidex.Web/Pipeline/AppResolver.cs b/backend/src/Squidex.Web/Pipeline/AppResolver.cs index ec73dbdcc..3d26c6380 100644 --- a/backend/src/Squidex.Web/Pipeline/AppResolver.cs +++ b/backend/src/Squidex.Web/Pipeline/AppResolver.cs @@ -5,13 +5,11 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Squidex.Domain.Apps.Core.Apps; using Squidex.Domain.Apps.Entities; using Squidex.Infrastructure.Security; using Squidex.Shared; @@ -50,47 +48,11 @@ public sealed class AppResolver(IAppProvider appProvider) : IAsyncActionFilter return; } - string? clientId = null; - - var (role, permissions) = FindByOpenIdSubject(app, user, isFrontend); - if (permissions == null) - { - (clientId, role, permissions) = FindByOpenIdClient(app, user, isFrontend); - } - - if (permissions == null) - { - (role, permissions) = FindByUserInfo(app, user, isFrontend); - } - - if (permissions == null) - { - (clientId, role, permissions) = FindAnonymousClient(app, isFrontend); - } - - if (permissions != null) - { - var identity = user.Identities.First(); - - if (!string.IsNullOrWhiteSpace(role)) - { - identity.AddClaim(new Claim(ClaimTypes.Role, role)); - } - - foreach (var permission in permissions) - { - identity.AddClaim(new Claim(SquidexClaimTypes.Permissions, permission.Id)); - } - - if (user.Token() == null && clientId != null) - { - identity.AddClaim(new Claim(OpenIdClaims.ClientId, clientId)); - } - } + AppPermissionClaims.Enrich(app, user); var requestContext = new Context(context.HttpContext.User, app).WithHeaders(context.HttpContext); - if (!AllowAnonymous(context) && !HasPermission(appName, requestContext)) + if (!AllowAnonymous(context) && !AppPermissionClaims.HasAppPermission(appName, requestContext)) { if (string.IsNullOrWhiteSpace(user.Identity?.AuthenticationType)) { @@ -119,77 +81,8 @@ public sealed class AppResolver(IAppProvider appProvider) : IAsyncActionFilter await next(); } - private static bool HasPermission(string appName, Context requestContext) - { - return requestContext.UserPermissions.Includes(PermissionIds.ForApp(PermissionIds.App, appName)); - } - private static bool AllowAnonymous(ActionExecutingContext context) { return context.ActionDescriptor.EndpointMetadata.Any(x => x is AllowAnonymousAttribute); } - - private static (string?, string?, PermissionSet?) FindByOpenIdClient(App app, ClaimsPrincipal user, bool isFrontend) - { - var (appName, clientId) = user.GetClient(); - if (app.Name != appName || clientId == null) - { - return default; - } - - if (app.TryGetClientRole(clientId, isFrontend, out var role)) - { - return (clientId, role.Name, role.Permissions); - } - - return default; - } - - private static (string?, PermissionSet?) FindByUserInfo(App app, ClaimsPrincipal user, bool isFrontend) - { - var (_, appName, roleName) = user.GetUserInfo(); - if (app.Name != appName || roleName == null) - { - return default; - } - - if (app.TryGetRole(roleName, isFrontend, out var role)) - { - return (role.Name, role.Permissions); - } - - return default; - } - - private static (string?, string?, PermissionSet?) FindAnonymousClient(App app, bool isFrontend) - { - var client = app.Clients.FirstOrDefault(x => x.Value.AllowAnonymous); - if (client.Value == null) - { - return default; - } - - if (app.TryGetRole(client.Value.Role, isFrontend, out var role)) - { - return (client.Key, role.Name, role.Permissions); - } - - return default; - } - - private static (string?, PermissionSet?) FindByOpenIdSubject(App app, ClaimsPrincipal user, bool isFrontend) - { - var subjectId = user.OpenIdSubject(); - if (subjectId == null) - { - return default; - } - - if (app.TryGetContributorRole(subjectId, isFrontend, out var role)) - { - return (role.Name, role.Permissions); - } - - return default; - } } diff --git a/backend/src/Squidex/Areas/Mcp/Config/McpAppMiddleware.cs b/backend/src/Squidex/Areas/Mcp/Config/McpAppMiddleware.cs new file mode 100644 index 000000000..a0ff62cde --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Config/McpAppMiddleware.cs @@ -0,0 +1,83 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Globalization; +using Squidex.Domain.Apps.Core.Apps; +using Squidex.Domain.Apps.Entities; +using Squidex.Domain.Apps.Entities.Billing; +using Squidex.Infrastructure; +using Squidex.Infrastructure.Security; +using Squidex.Shared; +using Squidex.Shared.Identity; +using Squidex.Web; +using Squidex.Web.Pipeline; + +namespace Squidex.Areas.Mcp.Config; + +public sealed class McpAppMiddleware(RequestDelegate next) +{ + private static readonly ApiCostsAttribute Costs = new ApiCostsAttribute(1); + + public async Task InvokeAsync(HttpContext httpContext, IAppProvider appProvider, IUsageGate usageGate) + { + // The MCP endpoints are minimal API endpoints, therefore the MVC filters for apps and costs do not run. + if (httpContext.GetEndpoint()?.Metadata.GetMetadata() == null) + { + await next(httpContext); + return; + } + + var appName = httpContext.GetRouteValue("app")?.ToString(); + if (string.IsNullOrWhiteSpace(appName)) + { + httpContext.Response.StatusCode = StatusCodes.Status404NotFound; + return; + } + + var user = httpContext.User; + + var app = await appProvider.GetAppAsync(appName, !user.IsInClient(DefaultClients.Frontend), httpContext.RequestAborted); + if (app == null) + { + httpContext.Response.StatusCode = StatusCodes.Status404NotFound; + return; + } + + AppPermissionClaims.Enrich(app, user); + + var requestContext = new Context(user, app).WithHeaders(httpContext); + + if (!AppPermissionClaims.HasAppPermission(appName, requestContext)) + { + var isAnonymous = string.IsNullOrWhiteSpace(user.Identity?.AuthenticationType); + + httpContext.Response.StatusCode = isAnonymous ? StatusCodes.Status401Unauthorized : StatusCodes.Status404NotFound; + return; + } + + if (await IsBlockedAsync(httpContext, app, usageGate)) + { + httpContext.Response.StatusCode = StatusCodes.Status429TooManyRequests; + return; + } + + httpContext.Features.Set(requestContext); + httpContext.Features.Set(app); + httpContext.Features.Set(Costs); + httpContext.Response.Headers["X-AppId"] = app.Id.ToString(); + httpContext.Response.Headers["X-Costs"] = Costs.Costs.ToString(CultureInfo.InvariantCulture); + + await next(httpContext); + } + + private static Task IsBlockedAsync(HttpContext httpContext, App app, IUsageGate usageGate) + { + var (_, clientId) = httpContext.User.GetClient(); + + return usageGate.IsBlockedAsync(app, clientId, DateTime.Today.ToDateOnly(), httpContext.RequestAborted); + } +} diff --git a/backend/src/Squidex/Areas/Mcp/Config/McpClientSecretHandler.cs b/backend/src/Squidex/Areas/Mcp/Config/McpClientSecretHandler.cs new file mode 100644 index 000000000..d2bcef8fa --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Config/McpClientSecretHandler.cs @@ -0,0 +1,118 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Diagnostics.CodeAnalysis; +using System.Security.Claims; +using System.Security.Cryptography; +using System.Text; +using System.Text.Encodings.Web; +using Microsoft.AspNetCore.Authentication; +using Microsoft.Extensions.Options; +using Microsoft.Net.Http.Headers; +using Squidex.Domain.Apps.Entities; +using Squidex.Infrastructure.Security; + +namespace Squidex.Areas.Mcp.Config; + +public sealed class McpClientSecretHandler( + IAppProvider appProvider, + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder) + : AuthenticationHandler(options, logger, encoder) +{ + public const string SchemeName = "McpClientSecret"; + private const string BasicPrefix = "Basic "; + + protected override async Task HandleAuthenticateAsync() + { + if (!TryGetCredentials(Request, out var clientName, out var secret)) + { + return AuthenticateResult.NoResult(); + } + + var appName = Context.GetRouteValue("app")?.ToString(); + if (string.IsNullOrWhiteSpace(appName)) + { + return AuthenticateResult.Fail("Invalid client."); + } + + var app = await appProvider.GetAppAsync(appName, true, Context.RequestAborted); + if (app == null) + { + return AuthenticateResult.Fail("Invalid client."); + } + + // Also accept the full client ID, which is shown everywhere in the UI. + var appPrefix = $"{app.Name}:"; + if (clientName.StartsWith(appPrefix, StringComparison.Ordinal)) + { + clientName = clientName[appPrefix.Length..]; + } + + if (!app.Clients.TryGetValue(clientName, out var client)) + { + return AuthenticateResult.Fail("Invalid client."); + } + + if (!CryptographicOperations.FixedTimeEquals(Encoding.UTF8.GetBytes(secret), Encoding.UTF8.GetBytes(client.Secret))) + { + return AuthenticateResult.Fail("Invalid client."); + } + + // Same client claim as in a token, so that the app resolution assigns the role of the client. + var identity = new ClaimsIdentity( + [ + new Claim(OpenIdClaims.ClientId, $"{app.Name}:{clientName}"), + ], SchemeName); + + return AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(identity), Scheme.Name)); + } + + public static bool IsClientSecret(HttpContext httpContext) + { + if (httpContext.GetEndpoint()?.Metadata.GetMetadata() == null) + { + return false; + } + + return TryGetCredentials(httpContext.Request, out _, out _); + } + + private static bool TryGetCredentials(HttpRequest request, [MaybeNullWhen(false)] out string clientName, [MaybeNullWhen(false)] out string secret) + { + clientName = null; + secret = null; + + string? header = request.Headers[HeaderNames.Authorization]; + if (header?.StartsWith(BasicPrefix, StringComparison.OrdinalIgnoreCase) != true) + { + return false; + } + + string decoded; + try + { + decoded = Encoding.UTF8.GetString(Convert.FromBase64String(header[BasicPrefix.Length..].Trim())); + } + catch (FormatException) + { + return false; + } + + // Split at the last colon, because the client ID can contain the app name and a colon. + var separator = decoded.LastIndexOf(':'); + if (separator <= 0 || separator == decoded.Length - 1) + { + return false; + } + + clientName = decoded[..separator]; + secret = decoded[(separator + 1)..]; + return true; + } +} diff --git a/backend/src/Squidex/Areas/Mcp/Config/McpEndpointMetadata.cs b/backend/src/Squidex/Areas/Mcp/Config/McpEndpointMetadata.cs new file mode 100644 index 000000000..e9487bb19 --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Config/McpEndpointMetadata.cs @@ -0,0 +1,12 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +namespace Squidex.Areas.Mcp.Config; + +public sealed class McpEndpointMetadata +{ +} diff --git a/backend/src/Squidex/Areas/Mcp/Config/McpServices.cs b/backend/src/Squidex/Areas/Mcp/Config/McpServices.cs new file mode 100644 index 000000000..813f20fff --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Config/McpServices.cs @@ -0,0 +1,46 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authorization; +using Squidex.Areas.Mcp.Tools; +using Squidex.Web; + +namespace Squidex.Areas.Mcp.Config; + +public static class McpServices +{ + public static void AddSquidexMcp(this IServiceCollection services) + { + services.AddMcpServer(options => + { + options.ServerInfo = new () { Name = "Squidex", Version = typeof(McpServices).Assembly.GetName().Version?.ToString() ?? "1.0" }; + }) + .WithHttpTransport() + .WithTools() + .WithTools() + .WithTools(); + + // Agents keep their configuration for a long time, so they can use the client secret instead of an expiring token. + services.AddAuthentication() + .AddScheme(McpClientSecretHandler.SchemeName, null); + } + + public static void UseSquidexMcp(this IApplicationBuilder app) + { + app.UseMiddleware(); + } + + public static void MapSquidexMcp(this IEndpointRouteBuilder endpoints) + { + // Authenticate with the API scheme, but allow anonymous clients. Permissions are checked by the middleware. + endpoints.MapMcp($"{Constants.PrefixApi}/apps/{{app}}/mcp") + .RequireAuthorization(new AuthorizeAttribute { AuthenticationSchemes = Constants.ApiSecurityScheme }) + .AllowAnonymous() + .WithMetadata(new McpEndpointMetadata()); + } +} diff --git a/backend/src/Squidex/Areas/Mcp/Tools/AssetTools.cs b/backend/src/Squidex/Areas/Mcp/Tools/AssetTools.cs new file mode 100644 index 000000000..2cf475034 --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Tools/AssetTools.cs @@ -0,0 +1,91 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.ComponentModel; +using ModelContextProtocol; +using ModelContextProtocol.Server; +using Squidex.Domain.Apps.Core; +using Squidex.Domain.Apps.Entities; +using Squidex.Domain.Apps.Entities.Assets; +using Squidex.Infrastructure; +using Squidex.Infrastructure.Json; +using Squidex.Shared; + +namespace Squidex.Areas.Mcp.Tools; + +[McpServerToolType] +public sealed class AssetTools(IContextProvider contextProvider, IAssetQueryService assetQuery, IUrlGenerator urlGenerator, IJsonSerializer serializer) + : McpToolBase(contextProvider, serializer) +{ + [McpServerTool(Name = "query_assets", Title = "Query assets", ReadOnly = true, Idempotent = true, OpenWorld = false)] + [Description(""" + Queries assets. Use either a JSON query or an OData query. If both are provided, the JSON query is used. + JSON query example: {"filter": {"path": "fileName", "op": "contains", "value": "logo"}, "sort": [{"path": "lastModified", "order": "descending"}], "take": 20}. + OData query example: $filter=contains(fileName, 'logo')&$orderby=lastModified desc&$top=20. + """)] + public Task QueryAssets( + [Description("The optional JSON query.")] string? query = null, + [Description("The optional OData query, e.g. $filter=mimeType eq 'image/png'&$top=10.")] string? odata = null, + [Description("The optional ID of the folder. Omit to search in all folders.")] string? parentId = null, + CancellationToken ct = default) + { + return ExecuteAsync(async context => + { + EnsurePermission(context, PermissionIds.AppAssetsRead); + + var parent = string.IsNullOrWhiteSpace(parentId) ? (DomainId?)null : ParseId(parentId); + + var q = Q.Empty.WithJsonQuery(query).WithODataQuery(odata); + + var assets = await assetQuery.QueryAsync(context, parent, q, ct); + + return new + { + assets.Total, + Items = assets.Select(ToResult).ToList(), + }; + }); + } + + [McpServerTool(Name = "get_asset", Title = "Get asset", ReadOnly = true, Idempotent = true, OpenWorld = false)] + [Description("Gets the metadata of a single asset by ID, including the URL to download the file.")] + public Task GetAsset( + [Description("The ID of the asset.")] string id, + CancellationToken ct = default) + { + return ExecuteAsync(async context => + { + EnsurePermission(context, PermissionIds.AppAssetsRead); + + var asset = await assetQuery.FindAsync(context, ParseId(id), ct: ct) + ?? throw new McpException($"Asset '{id}' not found."); + + return ToResult(asset); + }); + } + + private object ToResult(EnrichedAsset asset) + { + return new + { + asset.Id, + asset.ParentId, + asset.FileName, + asset.FileSize, + asset.MimeType, + asset.Slug, + asset.Type, + asset.IsProtected, + asset.Metadata, + Tags = asset.TagNames, + asset.Version, + asset.Created, + asset.LastModified, + Url = urlGenerator.AssetContent(asset.AppId, asset.Id.ToString()), + }; + } +} diff --git a/backend/src/Squidex/Areas/Mcp/Tools/ContentTools.cs b/backend/src/Squidex/Areas/Mcp/Tools/ContentTools.cs new file mode 100644 index 000000000..2285f3b5e --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Tools/ContentTools.cs @@ -0,0 +1,85 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.ComponentModel; +using ModelContextProtocol; +using ModelContextProtocol.Server; +using Squidex.Domain.Apps.Entities; +using Squidex.Domain.Apps.Entities.Contents; +using Squidex.Infrastructure.Json; + +namespace Squidex.Areas.Mcp.Tools; + +[McpServerToolType] +public sealed class ContentTools(IContextProvider contextProvider, IContentQueryService contentQuery, IJsonSerializer serializer) + : McpToolBase(contextProvider, serializer) +{ + [McpServerTool(Name = "query_contents", Title = "Query contents", ReadOnly = true, Idempotent = true, OpenWorld = false)] + [Description(""" + Queries content items of a schema. Use either a JSON query or an OData query. If both are provided, the JSON query is used. + JSON query example: {"filter": {"path": "data.title.iv", "op": "contains", "value": "hello"}, "sort": [{"path": "lastModified", "order": "descending"}], "skip": 0, "take": 20}. + OData query example: $filter=contains(data/title/iv, 'hello')&$orderby=lastModified desc&$skip=0&$top=20. + Field values are stored per language or with the "iv" key for non-localized fields. Use get_schema to get the field names. + """)] + public Task QueryContents( + [Description("The name or ID of the schema.")] string schema, + [Description("The optional JSON query.")] string? query = null, + [Description("The optional OData query, e.g. $filter=data/title/iv eq 'hello'&$top=10.")] string? odata = null, + [Description("True to also return unpublished content items.")] bool unpublished = false, + CancellationToken ct = default) + { + return ExecuteAsync(async context => + { + var q = Q.Empty.WithJsonQuery(query).WithODataQuery(odata); + + var contents = await contentQuery.QueryAsync(WithOptions(context, unpublished), schema, q, ct); + + return new + { + contents.Total, + Items = contents.Select(ToResult).ToList(), + }; + }); + } + + [McpServerTool(Name = "get_content", Title = "Get content", ReadOnly = true, Idempotent = true, OpenWorld = false)] + [Description("Gets a single content item by ID.")] + public Task GetContent( + [Description("The name or ID of the schema.")] string schema, + [Description("The ID of the content item.")] string id, + [Description("True to also return unpublished content items.")] bool unpublished = false, + CancellationToken ct = default) + { + return ExecuteAsync(async context => + { + var content = await contentQuery.FindAsync(WithOptions(context, unpublished), schema, ParseId(id), ct: ct) + ?? throw new McpException($"Content '{id}' not found."); + + return ToResult(content); + }); + } + + private static Context WithOptions(Context context, bool unpublished) + { + return context.Clone(b => b.WithUnpublished(unpublished)); + } + + private static object ToResult(EnrichedContent content) + { + return new + { + content.Id, + Schema = content.SchemaId.Name, + content.Status, + content.NewStatus, + content.Version, + content.Created, + content.LastModified, + content.Data, + }; + } +} diff --git a/backend/src/Squidex/Areas/Mcp/Tools/McpToolBase.cs b/backend/src/Squidex/Areas/Mcp/Tools/McpToolBase.cs new file mode 100644 index 000000000..e099acf31 --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Tools/McpToolBase.cs @@ -0,0 +1,58 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using ModelContextProtocol; +using Squidex.Domain.Apps.Entities; +using Squidex.Infrastructure; +using Squidex.Infrastructure.Json; +using Squidex.Shared; + +namespace Squidex.Areas.Mcp.Tools; + +public abstract class McpToolBase(IContextProvider contextProvider, IJsonSerializer serializer) +{ + protected async Task ExecuteAsync(Func> action) + { + var context = contextProvider.Context; + + // Should never happen, because the middleware resolves the app before. + if (context.App == null) + { + throw new McpException("App not found."); + } + + try + { + var result = await action(context); + + return serializer.Serialize(result); + } + catch (DomainException ex) + { + // Domain exceptions are also exposed by the REST API, so the message is safe to share. + throw new McpException(ex.Message, ex); + } + } + + protected static void EnsurePermission(Context context, string permissionId) + { + if (!context.UserPermissions.Allows(permissionId, context.App.Name)) + { + throw new McpException("You do not have the permission to perform this operation."); + } + } + + protected static DomainId ParseId(string id) + { + if (string.IsNullOrWhiteSpace(id)) + { + throw new McpException("The ID must not be empty."); + } + + return DomainId.Create(id); + } +} diff --git a/backend/src/Squidex/Areas/Mcp/Tools/SchemaTools.cs b/backend/src/Squidex/Areas/Mcp/Tools/SchemaTools.cs new file mode 100644 index 000000000..1b55d6850 --- /dev/null +++ b/backend/src/Squidex/Areas/Mcp/Tools/SchemaTools.cs @@ -0,0 +1,70 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.ComponentModel; +using ModelContextProtocol; +using ModelContextProtocol.Server; +using Squidex.Areas.Api.Controllers.Schemas.Models; +using Squidex.Domain.Apps.Core.Schemas; +using Squidex.Domain.Apps.Entities; +using Squidex.Infrastructure.Json; +using Squidex.Shared; + +namespace Squidex.Areas.Mcp.Tools; + +[McpServerToolType] +public sealed class SchemaTools(IContextProvider contextProvider, IAppProvider appProvider, IJsonSerializer serializer) + : McpToolBase(contextProvider, serializer) +{ + [McpServerTool(Name = "list_schemas", Title = "List schemas", ReadOnly = true, Idempotent = true, OpenWorld = false)] + [Description("Lists all schemas of the app with name, type and label. Use get_schema to get the fields of a schema.")] + public Task ListSchemas(CancellationToken ct) + { + return ExecuteAsync(async context => + { + EnsurePermission(context, PermissionIds.AppSchemasRead); + + var schemas = await appProvider.GetSchemasAsync(context.App.Id, ct); + + return schemas.OrderBy(x => x.Name).Select(x => new + { + x.Name, + x.Type, + x.Category, + x.IsPublished, + x.Properties.Label, + x.Properties.Hints, + }).ToList(); + }); + } + + [McpServerTool(Name = "get_schema", Title = "Get schema", ReadOnly = true, Idempotent = true, OpenWorld = false)] + [Description("Gets a schema with all fields. The field names are the keys in the data of content items.")] + public Task GetSchema( + [Description("The name or ID of the schema.")] string schema, + CancellationToken ct = default) + { + return ExecuteAsync(async context => + { + EnsurePermission(context, PermissionIds.AppSchemasRead); + + var result = await appProvider.GetSchemaAsync(context.App.Id, schema, true, ct) + ?? throw new McpException($"Schema '{schema}' not found."); + + return new + { + result.Name, + result.Type, + result.Category, + result.IsPublished, + result.Properties.Label, + result.Properties.Hints, + Fields = result.Fields.Select(FieldDto.FromDomain).ToList(), + }; + }); + } +} diff --git a/backend/src/Squidex/Config/Authentication/IdentityServerServices.cs b/backend/src/Squidex/Config/Authentication/IdentityServerServices.cs index 849d37b78..0f2f67619 100644 --- a/backend/src/Squidex/Config/Authentication/IdentityServerServices.cs +++ b/backend/src/Squidex/Config/Authentication/IdentityServerServices.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using OpenIddict.Validation.AspNetCore; +using Squidex.Areas.Mcp.Config; using Squidex.Hosting; using Squidex.Web; using Squidex.Web.Pipeline; @@ -43,6 +44,11 @@ public static class IdentityServerServices { options.ForwardDefaultSelector = context => { + if (McpClientSecretHandler.IsClientSecret(context)) + { + return McpClientSecretHandler.SchemeName; + } + if (ApiKeyHandler.IsApiKey(context.Request, out _)) { return ApiKeyDefaults.AuthenticationScheme; diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj index f82704c09..a3399b7f7 100644 --- a/backend/src/Squidex/Squidex.csproj +++ b/backend/src/Squidex/Squidex.csproj @@ -48,6 +48,7 @@ + diff --git a/backend/src/Squidex/Startup.cs b/backend/src/Squidex/Startup.cs index 5675cd2ca..f9437ecfd 100644 --- a/backend/src/Squidex/Startup.cs +++ b/backend/src/Squidex/Startup.cs @@ -8,6 +8,7 @@ using Squidex.Areas.Api.Config.OpenApi; using Squidex.Areas.Frontend; using Squidex.Areas.IdentityServer.Config; +using Squidex.Areas.Mcp.Config; using Squidex.Config.Authentication; using Squidex.Config.Domain; using Squidex.Config.Messaging; @@ -51,6 +52,7 @@ public sealed class Startup(IConfiguration config) services.AddSquidexImageResizing(config); services.AddSquidexInfrastructure(config); services.AddSquidexLocalization(); + services.AddSquidexMcp(); services.AddSquidexMessaging(config); services.AddSquidexMigration(config); services.AddSquidexOpenApiSettings(); @@ -108,10 +110,12 @@ public sealed class Startup(IConfiguration config) app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); + app.UseSquidexMcp(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapSquidexMcp(); }); // Return a 404 for all unresolved api requests. diff --git a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html index a30bb8680..9cd81ad84 100644 --- a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html +++ b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html @@ -47,6 +47,46 @@ {{ "clients.connectWizard.sdkHint" | sqxTranslate }} + +
+
{{ "clients.connectWizard.mcp" | sqxTranslate }}
+ {{ "clients.connectWizard.mcpHint" | sqxTranslate }} + +
+ + } + + @case ("MCP") { +
+
1 {{ "clients.connectWizard.mcpStep1" | sqxTranslate }}
+ +

+ {{ mcpUrl }} + {{ "clients.connectWizard.mcpStep1Hint" | sqxTranslate }} +

+
+ +
+
2 {{ "clients.connectWizard.mcpStep2" | sqxTranslate }}
+ +

+ {{ mcpCommand }} +

+
+ +
+
3 {{ "clients.connectWizard.mcpStep3" | sqxTranslate }}
+ +

+ {{ mcpConfig }} + + + +

+
+ +
+ {{ "clients.connectWizard.mcpSecretHint" | sqxTranslate }}
} diff --git a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts index 0d6672028..1c5f987bb 100644 --- a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts +++ b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts @@ -40,6 +40,39 @@ export class ClientConnectFormComponent implements OnInit { public step = 'Start'; + public get mcpUrl() { + return this.apiUrl.buildUrl(`/api/apps/${this.appName}/mcp`); + } + + public get mcpServerName() { + return `squidex-${this.appName}`; + } + + public get mcpCommand() { + return `claude mcp add --transport http ${this.mcpServerName} ${this.mcpUrl} --header "Authorization: ${this.mcpAuthorization}"`; + } + + public get mcpConfig() { + const config = { + mcpServers: { + [this.mcpServerName]: { + type: 'http', + url: this.mcpUrl, + headers: { + Authorization: this.mcpAuthorization, + }, + }, + }, + }; + + return JSON.stringify(config, undefined, 4); + } + + private get mcpAuthorization() { + // The client secret does not expire, unlike the access token. + return `Basic ${btoa(`${this.appName}:${this.client.id}:${this.client.secret}`)}`; + } + constructor( public readonly appsState: AppsState, public readonly apiUrl: ApiUrlConfig, diff --git a/tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs b/tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs index 983c1bcbd..e2f6640c7 100644 --- a/tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs @@ -36,7 +36,7 @@ public sealed class AppClientsTests(ClientFixture fixture) : IClassFixture(x => x.Secret); + .ScrubMember(x => x.Secret); } [Fact] @@ -71,7 +71,7 @@ public sealed class AppClientsTests(ClientFixture fixture) : IClassFixture(x => x.Secret); + .ScrubMember(x => x.Secret); } [Fact] @@ -92,7 +92,7 @@ public sealed class AppClientsTests(ClientFixture fixture) : IClassFixture x.Id == client.Id); await Verify(clients_2) - .IgnoreMember(x => x.Secret); + .ScrubMember(x => x.Secret); } private async Task CreateAsync(ISquidexClient app) diff --git a/tools/TestSuite/TestSuite.ApiTests/AppContributorsTests.cs b/tools/TestSuite/TestSuite.ApiTests/AppContributorsTests.cs index fc95fa8e4..032fa08f3 100644 --- a/tools/TestSuite/TestSuite.ApiTests/AppContributorsTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/AppContributorsTests.cs @@ -51,9 +51,9 @@ public sealed class AppContributorsTests(ClientFixture fixture) : IClassFixture< Assert.Equal("Developer", contributor_1?.Role); await Verify(contributor_1) - .IgnoreMember(x => x.ContributorId) - .IgnoreMember(x => x.ContributorEmail) - .IgnoreMember(x => x.ContributorName); + .ScrubMember(x => x.ContributorId) + .ScrubMember(x => x.ContributorEmail) + .ScrubMember(x => x.ContributorName); } [Fact] @@ -102,9 +102,9 @@ public sealed class AppContributorsTests(ClientFixture fixture) : IClassFixture< Assert.DoesNotContain(contributors_2.Items, x => x.ContributorId == contributor2.ContributorId); await Verify(contributors_2) - .IgnoreMember(x => x.ContributorId) - .IgnoreMember(x => x.ContributorEmail) - .IgnoreMember(x => x.ContributorName); + .ScrubMember(x => x.ContributorId) + .ScrubMember(x => x.ContributorEmail) + .ScrubMember(x => x.ContributorName); } [Fact] diff --git a/tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs b/tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs index fd6760d7e..a4af98061 100644 --- a/tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs @@ -31,7 +31,7 @@ public sealed class AppRolesTests(CreatedAppFixture fixture) : IClassFixture(x => x.Name); + .ScrubMember(x => x.Name); } [Fact] @@ -44,7 +44,7 @@ public sealed class AppRolesTests(CreatedAppFixture fixture) : IClassFixture(x => x.Name); + .ScrubMember(x => x.Name); } [Fact] @@ -67,7 +67,7 @@ public sealed class AppRolesTests(CreatedAppFixture fixture) : IClassFixture(x => x.Name); + .ScrubMember(x => x.Name); } [Fact] diff --git a/tools/TestSuite/TestSuite.ApiTests/AppTests.cs b/tools/TestSuite/TestSuite.ApiTests/AppTests.cs index b5223d958..518064166 100644 --- a/tools/TestSuite/TestSuite.ApiTests/AppTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/AppTests.cs @@ -58,7 +58,7 @@ public sealed class AppTests(CreatedAppFixture fixture) : IClassFixture(x => x.Version); + .ScrubMember(x => x.Version); } } diff --git a/tools/TestSuite/TestSuite.ApiTests/AssetFormatTests.cs b/tools/TestSuite/TestSuite.ApiTests/AssetFormatTests.cs index a6d2193fe..40e647374 100644 --- a/tools/TestSuite/TestSuite.ApiTests/AssetFormatTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/AssetFormatTests.cs @@ -33,9 +33,9 @@ public class AssetFormatTests(CreatedAppFixture fixture) : IClassFixture(x => x.FileName) - .IgnoreMember(x => x.FileHash) - .IgnoreMember(x => x.Slug); + .ScrubMember(x => x.FileName) + .ScrubMember(x => x.FileHash) + .ScrubMember(x => x.Slug); } [Fact] diff --git a/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs b/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs index 9aea5b62d..bfd76d022 100644 --- a/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs @@ -27,7 +27,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture 1); - await using (var stream = new FileStream("Assets/SampleVideo_1280x720_1mb.mp4", FileMode.Open)) + await using (var stream = File.OpenRead("Assets/SampleVideo_1280x720_1mb.mp4")) { var downloaded = await _.DownloadAsync(progress.Asset); @@ -160,7 +160,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture 1); - await using (var stream = new FileStream("Assets/SampleVideo_1280x720_1mb.mp4", FileMode.Open)) + await using (var stream = File.OpenRead("Assets/SampleVideo_1280x720_1mb.mp4")) { var downloaded = await _.DownloadAsync(progress.Asset); @@ -289,8 +289,8 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture(x => x.Version) - .IgnoreMember(x => x.Tags); + .ScrubMember(x => x.Version) + .ScrubMember(x => x.Tags); } [Theory] @@ -411,7 +411,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture(() => { @@ -460,7 +460,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture(() => { @@ -495,7 +495,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture(() => { diff --git a/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs b/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs index 43d61e112..d15b57ab8 100644 --- a/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs @@ -79,11 +79,11 @@ public sealed class GraphQLTests(GraphQLFixture fixture) : IClassFixture(query); var settings = new VerifySettings(); - settings.IgnoreMember("editToken"); - settings.IgnoreMember("metadata"); - settings.IgnoreMember("thumbnailUrl"); - settings.IgnoreMember("url"); - settings.IgnoreMember("version"); + settings.ScrubMember("editToken"); + settings.ScrubMember("metadata"); + settings.ScrubMember("thumbnailUrl"); + settings.ScrubMember("url"); + settings.ScrubMember("version"); await VerifyJson(JsonConvert.SerializeObject(result), settings); } diff --git a/tools/TestSuite/TestSuite.ApiTests/McpFixture.cs b/tools/TestSuite/TestSuite.ApiTests/McpFixture.cs new file mode 100644 index 000000000..3dcd43038 --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/McpFixture.cs @@ -0,0 +1,34 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using ModelContextProtocol.Client; +using TestSuite.Fixtures; + +namespace TestSuite.ApiTests; + +public sealed class McpFixture : TestSchemaFixtureBase +{ + public McpFixture() + : base("my-mcp") + { + } + + public string McpUrl(string appName) + { + return Client.GenerateUrl($"api/apps/{appName}/mcp")!; + } + + public Task CreateMcpClientAsync(HttpClient? httpClient = null, string? appName = null) + { + var transport = new HttpClientTransport(new HttpClientTransportOptions + { + Endpoint = new Uri(McpUrl(appName ?? AppName)), + }, httpClient ?? Client.CreateHttpClient()); + + return McpClient.CreateAsync(transport); + } +} diff --git a/tools/TestSuite/TestSuite.ApiTests/McpTests.cs b/tools/TestSuite/TestSuite.ApiTests/McpTests.cs new file mode 100644 index 000000000..d8b80af0c --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/McpTests.cs @@ -0,0 +1,428 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Net; +using System.Net.Http.Headers; +using System.Text; +using ModelContextProtocol; +using ModelContextProtocol.Client; +using ModelContextProtocol.Protocol; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Squidex.ClientLibrary; +using TestSuite.Model; + +#pragma warning disable SA1300 // Element should begin with upper-case letter +#pragma warning disable SA1507 // Code should not contain multiple blank lines in a row + +namespace TestSuite.ApiTests; + +public class McpTests(McpFixture fixture) : IClassFixture +{ + public McpFixture _ { get; } = fixture; + + [Fact] + public async Task Should_list_tools() + { + await using var mcp = await _.CreateMcpClientAsync(); + + var tools = await mcp.ListToolsAsync(); + + // Snapshot the full definitions, because the descriptions and schemas are what the agents see. + await VerifyJson(System.Text.Json.JsonSerializer.Serialize( + tools.Select(x => x.ProtocolTool).OrderBy(x => x.Name), + McpJsonUtilities.DefaultOptions)); + } + + [Fact] + public async Task Should_list_schemas() + { + await using var mcp = await _.CreateMcpClientAsync(); + + // The fixture app is shared with other tests, which create their own schemas. + var result = JToken.Parse(await CallAsync(mcp, "list_schemas")); + + Assert.Contains(result, x => (string?)x["name"] == _.SchemaName); + } + + [Fact] + public async Task Should_get_schema() + { + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "get_schema", new () + { + ["schema"] = _.SchemaName, + }); + + await VerifyJson(result); + } + + [Fact] + public async Task Should_query_contents_with_json() + { + // STEP 1: Create a published content item with a unique value. + var value = Guid.NewGuid().ToString(); + + await _.Contents.CreateAsync(new TestEntityData { String = value }, ContentCreateOptions.AsPublish); + + + // STEP 2: Query the content item. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "query_contents", new () + { + ["schema"] = _.SchemaName, + ["query"] = JsonConvert.SerializeObject(new + { + filter = new { path = $"data.{TestEntityData.StringField}.iv", op = "eq", value }, + }), + }); + + await VerifyJson(result); + } + + [Fact] + public async Task Should_query_contents_with_odata() + { + // STEP 1: Create published content items with a unique value. + var value = Guid.NewGuid().ToString(); + + await _.Contents.CreateAsync( + new TestEntityData { String = value, Number = 1 }, + ContentCreateOptions.AsPublish); + + await _.Contents.CreateAsync( + new TestEntityData { String = value, Number = 2 }, + ContentCreateOptions.AsPublish); + + + // STEP 2: Query the content items with filter and sorting. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "query_contents", new () + { + ["schema"] = _.SchemaName, + ["odata"] = $"$filter=data/{TestEntityData.StringField}/iv eq '{value}'&$orderby=data/{TestEntityData.NumberField}/iv desc", + }); + + await VerifyJson(result); + } + + [Fact] + public async Task Should_not_query_unpublished_contents_by_default() + { + // STEP 1: Create an unpublished content item with a unique value. + var value = Guid.NewGuid().ToString(); + + await _.Contents.CreateAsync(new TestEntityData { String = value }); + + + // STEP 2: Query the content item. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "query_contents", new () + { + ["schema"] = _.SchemaName, + ["query"] = JsonConvert.SerializeObject(new + { + filter = new { path = $"data.{TestEntityData.StringField}.iv", op = "eq", value }, + }), + }); + + await VerifyJson(result); + } + + [Fact] + public async Task Should_query_unpublished_contents_if_requested() + { + // STEP 1: Create an unpublished content item with a unique value. + var value = Guid.NewGuid().ToString(); + + await _.Contents.CreateAsync(new TestEntityData { String = value }); + + + // STEP 2: Query the content item. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "query_contents", new () + { + ["schema"] = _.SchemaName, + ["query"] = JsonConvert.SerializeObject(new + { + filter = new { path = $"data.{TestEntityData.StringField}.iv", op = "eq", value }, + }), + ["unpublished"] = true, + }); + + await VerifyJson(result); + } + + [Fact] + public async Task Should_get_content() + { + // STEP 1: Create a published content item. + var content = await _.Contents.CreateAsync( + new TestEntityData { Number = 42 }, + ContentCreateOptions.AsPublish); + + + // STEP 2: Get the content item. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "get_content", new () + { + ["schema"] = _.SchemaName, + ["id"] = content.Id, + }); + + await VerifyJson(result); + } + + [Fact] + public async Task Should_return_error_if_schema_not_found() + { + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await mcp.CallToolAsync("get_content", new Dictionary + { + ["schema"] = "unknown", + ["id"] = Guid.NewGuid().ToString(), + }); + + await Verify(result); + } + + [Fact] + public async Task Should_return_error_if_odata_query_is_invalid() + { + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await mcp.CallToolAsync("query_contents", new Dictionary + { + ["schema"] = _.SchemaName, + ["odata"] = "$filter=invalid(", + }); + + await Verify(result); + } + + [Fact] + public async Task Should_get_asset() + { + // STEP 1: Upload an asset. + var asset = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); + + + // STEP 2: Get the asset. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "get_asset", new () + { + ["id"] = asset.Id, + }); + + await VerifyJson(result) + .ScrubInlineGuids() + .AddScrubber(x => x.Replace(_.Url.TrimEnd('/'), "{url}")); + } + + [Fact] + public async Task Should_query_assets_with_json() + { + // STEP 1: Upload an asset. + var asset = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); + + + // STEP 2: Query the asset. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "query_assets", new () + { + ["query"] = JsonConvert.SerializeObject(new + { + filter = new { path = "id", op = "eq", value = asset.Id }, + }), + }); + + await VerifyJson(result) + .ScrubInlineGuids() + .AddScrubber(x => x.Replace(_.Url.TrimEnd('/'), "{url}")); + } + + [Fact] + public async Task Should_query_assets_with_odata() + { + // STEP 1: Upload an asset. + var asset = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); + + + // STEP 2: Query the asset. + await using var mcp = await _.CreateMcpClientAsync(); + + var result = await CallAsync(mcp, "query_assets", new () + { + ["odata"] = $"$filter=id eq '{asset.Id}'", + }); + + await VerifyJson(result) + .ScrubInlineGuids() + .AddScrubber(x => x.Replace(_.Url.TrimEnd('/'), "{url}")); + } + + [Fact] + public async Task Should_return_401_if_not_authenticated() + { + using var httpClient = new HttpClient(); + + var response = await PostToolsListAsync(httpClient, _.McpUrl(_.AppName)); + + Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); + } + + [Fact] + public async Task Should_return_404_if_app_not_found() + { + using var httpClient = _.Client.CreateHttpClient(); + + var response = await PostToolsListAsync(httpClient, _.McpUrl(Guid.NewGuid().ToString())); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Fact] + public async Task Should_allow_anonymous_access_if_client_is_anonymous() + { + // STEP 1: Create app. + var (app, _) = await _.PostAppAsync(); + + + // STEP 2: Make the client anonymous. + await app.Apps.PutClientAsync("default", new UpdateClientDto { AllowAnonymous = true }); + + + // STEP 3: Use MCP without authentication. + using var httpClient = new HttpClient(); + + await using var mcp = await _.CreateMcpClientAsync(httpClient, app.Options.AppName); + + var result = await mcp.CallToolAsync("list_schemas"); + + await Verify(result); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task Should_authenticate_with_client_secret(bool fullClientId) + { + // STEP 1: Create app and get the secret of the default client. + var (app, _) = await _.PostAppAsync(); + + var client = (await app.Apps.GetClientsAsync()).Items.Single(x => x.Id == "default"); + + + // STEP 2: Use MCP with the client secret. + using var httpClient = CreateBasicClient( + fullClientId ? $"{app.Options.AppName}:{client.Id}" : client.Id, + client.Secret); + + await using var mcp = await _.CreateMcpClientAsync(httpClient, app.Options.AppName); + + var result = await mcp.CallToolAsync("list_schemas"); + + await Verify(result); + } + + [Fact] + public async Task Should_return_401_if_client_secret_is_invalid() + { + // STEP 1: Create app. + var (app, _) = await _.PostAppAsync(); + + + // STEP 2: Use MCP with a wrong secret. + using var httpClient = CreateBasicClient("default", "invalid"); + + var response = await PostToolsListAsync(httpClient, _.McpUrl(app.Options.AppName)); + + Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); + } + + [Fact] + public async Task Should_return_401_if_client_secret_is_used_for_other_app() + { + // STEP 1: Create two apps. + var (app1, _) = await _.PostAppAsync(); + var (app2, _) = await _.PostAppAsync(); + + var client = (await app1.Apps.GetClientsAsync()).Items.Single(x => x.Id == "default"); + + + // STEP 2: Use the secret of the first app for the second app. + using var httpClient = CreateBasicClient($"{app1.Options.AppName}:{client.Id}", client.Secret); + + var response = await PostToolsListAsync(httpClient, _.McpUrl(app2.Options.AppName)); + + Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); + } + + [Fact] + public async Task Should_not_accept_client_secret_outside_of_mcp() + { + // STEP 1: Create app. + var (app, _) = await _.PostAppAsync(); + + var client = (await app.Apps.GetClientsAsync()).Items.Single(x => x.Id == "default"); + + + // STEP 2: Use the client secret for the REST API. + using var httpClient = CreateBasicClient(client.Id, client.Secret); + + var response = await httpClient.GetAsync( + _.Client.GenerateUrl($"api/apps/{app.Options.AppName}/settings")); + + Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); + } + + private static HttpClient CreateBasicClient(string clientId, string secret) + { + var httpClient = new HttpClient(); + + httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( + "Basic", + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{clientId}:{secret}"))); + return httpClient; + } + + private static async Task CallAsync(McpClient mcp, string tool, + Dictionary? arguments = null) + { + var result = await mcp.CallToolAsync(tool, arguments ?? []); + + var text = Assert.Single(result.Content.OfType()).Text; + Assert.NotEqual(true, result.IsError); + + return text; + } + + private static Task PostToolsListAsync(HttpClient httpClient, string url) + { + var request = new HttpRequestMessage(HttpMethod.Post, url) + { + Content = new StringContent( + """{"jsonrpc":"2.0","id":1,"method":"tools/list"}""", + Encoding.UTF8, + "application/json"), + }; + + request.Headers.Accept.ParseAdd("application/json"); + request.Headers.Accept.ParseAdd("text/event-stream"); + + return httpClient.SendAsync(request); + } +} diff --git a/tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs b/tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs index 1ec441b60..6781a1bee 100644 --- a/tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs @@ -82,7 +82,7 @@ public class SchemaTests(CreatedAppFixture fixture) : IClassFixture(x => x.Name); + .ScrubMember(x => x.Name); // STEP 2: Get all schemas. @@ -117,7 +117,7 @@ public class SchemaTests(CreatedAppFixture fixture) : IClassFixture(x => x.Name); + .ScrubMember(x => x.Name); // STEP 2: Get all schemas. diff --git a/tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs b/tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs index 691f8fe68..4bca37ea0 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs +++ b/tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs @@ -6,6 +6,7 @@ // ========================================================================== using System.Runtime.CompilerServices; +using ModelContextProtocol.Protocol; namespace TestSuite.ApiTests.Settings; @@ -20,5 +21,15 @@ public static class VerifySettings return new PathInfo(path, type.Name, method.Name); }); + + // Postgres stores JSON as jsonb, which does not keep the order of keys. + VerifierSettings.SortJsonObjects(); + + // JSON dates are not covered by the scrubbing of DateTimeOffset members, but have only second precision. + // Therefore two items have the same date counter, if they were created in the same second. + VerifierSettings.ScrubMembers("created", "lastModified"); + + // The MCP metadata contains the server version and would make the snapshots brittle. + VerifierSettings.ScrubMember(x => x.Meta); } } diff --git a/tools/TestSuite/TestSuite.ApiTests/TeamContributorTests.cs b/tools/TestSuite/TestSuite.ApiTests/TeamContributorTests.cs index d45d86358..d3087c97f 100644 --- a/tools/TestSuite/TestSuite.ApiTests/TeamContributorTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/TeamContributorTests.cs @@ -55,9 +55,9 @@ public class TeamContributorTests(ClientFixture fixture) : IClassFixture(x => x.ContributorId) - .IgnoreMember(x => x.ContributorEmail) - .IgnoreMember(x => x.ContributorName); + .ScrubMember(x => x.ContributorId) + .ScrubMember(x => x.ContributorEmail) + .ScrubMember(x => x.ContributorName); } [Fact] @@ -81,9 +81,9 @@ public class TeamContributorTests(ClientFixture fixture) : IClassFixture x.ContributorId == contributor2.ContributorId); await Verify(contributors_2) - .IgnoreMember(x => x.ContributorId) - .IgnoreMember(x => x.ContributorEmail) - .IgnoreMember(x => x.ContributorName); + .ScrubMember(x => x.ContributorId) + .ScrubMember(x => x.ContributorEmail) + .ScrubMember(x => x.ContributorName); } [Fact] diff --git a/tools/TestSuite/TestSuite.ApiTests/TeamTests.cs b/tools/TestSuite/TestSuite.ApiTests/TeamTests.cs index e2a6fa712..14b6dd354 100644 --- a/tools/TestSuite/TestSuite.ApiTests/TeamTests.cs +++ b/tools/TestSuite/TestSuite.ApiTests/TeamTests.cs @@ -85,7 +85,8 @@ public class TeamTests(CreatedTeamFixture fixture) : IClassFixtureruntime; build; native; contentfiles; analyzers; buildtransitive
+ diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt index ebf860f49..d9fcd4082 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt @@ -2,69 +2,93 @@ Id: Guid_1, Name: Guid_2, Version: 2, + Created: {Scrubbed}, + LastModified: {Scrubbed}, CanAccessContent: true, + RoleProperties: {Scrubbed}, Links: { assets: { + Href: {Scrubbed}, Method: GET }, assets/create: { + Href: {Scrubbed}, Method: POST }, assets/scripts: { + Href: {Scrubbed}, Method: DELETE }, clients: { + Href: {Scrubbed}, Method: GET }, contributors: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, image/delete: { + Href: {Scrubbed}, Method: DELETE }, image/upload: { + Href: {Scrubbed}, Method: POST }, jobs: { + Href: {Scrubbed}, Method: GET }, languages: { + Href: {Scrubbed}, Method: GET }, ping: { + Href: {Scrubbed}, Method: GET }, plans: { + Href: {Scrubbed}, Method: GET }, roles: { + Href: {Scrubbed}, Method: GET }, rules: { + Href: {Scrubbed}, Method: GET }, schemas: { + Href: {Scrubbed}, Method: GET }, schemas/create: { + Href: {Scrubbed}, Method: POST }, script-logs: { + Href: {Scrubbed}, Method: GET }, settings: { + Href: {Scrubbed}, Method: GET }, transfer: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, workflows: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt index ebf860f49..d9fcd4082 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt @@ -2,69 +2,93 @@ Id: Guid_1, Name: Guid_2, Version: 2, + Created: {Scrubbed}, + LastModified: {Scrubbed}, CanAccessContent: true, + RoleProperties: {Scrubbed}, Links: { assets: { + Href: {Scrubbed}, Method: GET }, assets/create: { + Href: {Scrubbed}, Method: POST }, assets/scripts: { + Href: {Scrubbed}, Method: DELETE }, clients: { + Href: {Scrubbed}, Method: GET }, contributors: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, image/delete: { + Href: {Scrubbed}, Method: DELETE }, image/upload: { + Href: {Scrubbed}, Method: POST }, jobs: { + Href: {Scrubbed}, Method: GET }, languages: { + Href: {Scrubbed}, Method: GET }, ping: { + Href: {Scrubbed}, Method: GET }, plans: { + Href: {Scrubbed}, Method: GET }, roles: { + Href: {Scrubbed}, Method: GET }, rules: { + Href: {Scrubbed}, Method: GET }, schemas: { + Href: {Scrubbed}, Method: GET }, schemas/create: { + Href: {Scrubbed}, Method: POST }, script-logs: { + Href: {Scrubbed}, Method: GET }, settings: { + Href: {Scrubbed}, Method: GET }, transfer: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, workflows: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt index d5856dd30..618d0678f 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt @@ -1,16 +1,20 @@ { Id: Guid_1, + Secret: {Scrubbed}, Name: Guid_1, Role: Editor, AllowAnonymous: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, secret: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt index c5a11ac3a..4263aef8a 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt @@ -2,17 +2,21 @@ Items: [ { Id: default, + Secret: {Scrubbed}, Name: default, Role: Owner, AllowAnonymous: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, secret: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -20,9 +24,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt index a55e5fdfc..bcdac51ad 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt @@ -2,23 +2,28 @@ Items: [ { Id: default, + Secret: {Scrubbed}, Name: default, Role: Owner, AllowAnonymous: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, secret: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } }, { Id: Guid_1, + Secret: {Scrubbed}, Name: My Client, Role: Owner, ApiCallsLimit: 100, @@ -26,12 +31,15 @@ AllowAnonymous: true, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, secret: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -39,9 +47,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt index 2f1d520d8..95792d548 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt @@ -1,10 +1,15 @@ { + ContributorId: {Scrubbed}, + ContributorName: {Scrubbed}, + ContributorEmail: {Scrubbed}, Role: Developer, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: POST } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt index 17f19023c..1857bdc7e 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt @@ -1,12 +1,17 @@ { Items: [ { + ContributorId: {Scrubbed}, + ContributorName: {Scrubbed}, + ContributorEmail: {Scrubbed}, Role: Owner, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: POST } } @@ -15,9 +20,11 @@ MaxContributors: -1, Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt index ebf860f49..d9fcd4082 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt @@ -2,69 +2,93 @@ Id: Guid_1, Name: Guid_2, Version: 2, + Created: {Scrubbed}, + LastModified: {Scrubbed}, CanAccessContent: true, + RoleProperties: {Scrubbed}, Links: { assets: { + Href: {Scrubbed}, Method: GET }, assets/create: { + Href: {Scrubbed}, Method: POST }, assets/scripts: { + Href: {Scrubbed}, Method: DELETE }, clients: { + Href: {Scrubbed}, Method: GET }, contributors: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, image/delete: { + Href: {Scrubbed}, Method: DELETE }, image/upload: { + Href: {Scrubbed}, Method: POST }, jobs: { + Href: {Scrubbed}, Method: GET }, languages: { + Href: {Scrubbed}, Method: GET }, ping: { + Href: {Scrubbed}, Method: GET }, plans: { + Href: {Scrubbed}, Method: GET }, roles: { + Href: {Scrubbed}, Method: GET }, rules: { + Href: {Scrubbed}, Method: GET }, schemas: { + Href: {Scrubbed}, Method: GET }, schemas/create: { + Href: {Scrubbed}, Method: POST }, script-logs: { + Href: {Scrubbed}, Method: GET }, settings: { + Href: {Scrubbed}, Method: GET }, transfer: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, workflows: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt index 34279d8cd..4ae82e700 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt @@ -2,12 +2,16 @@ Items: [ { Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, Name: pages, Properties: { Label: Pages, ValidateOnPublish: false }, IsPublished: true, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 7, Scripts: { Create: @@ -50,18 +54,23 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, hide: { + Href: {Scrubbed}, Method: PUT }, lock: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -88,18 +97,23 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, hide: { + Href: {Scrubbed}, Method: PUT }, lock: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -125,18 +139,23 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, enable: { + Href: {Scrubbed}, Method: PUT }, hide: { + Href: {Scrubbed}, Method: PUT }, lock: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -144,69 +163,91 @@ ], Links: { contents: { + Href: {Scrubbed}, Method: GET }, contents/create: { + Href: {Scrubbed}, Method: POST }, contents/create/publish: { + Href: {Scrubbed}, Method: POST }, contents/export: { + Href: {Scrubbed}, Method: POST }, contents/migrate: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, fields/add: { + Href: {Scrubbed}, Method: POST }, fields/order: { + Href: {Scrubbed}, Method: PUT }, fields/ui: { + Href: {Scrubbed}, Method: PUT }, indexes: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET }, unpublish: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, update/category: { + Href: {Scrubbed}, Method: PUT }, update/rules: { + Href: {Scrubbed}, Method: PUT }, update/scripts: { + Href: {Scrubbed}, Method: PUT }, update/sync: { + Href: {Scrubbed}, Method: PUT }, update/urls: { + Href: {Scrubbed}, Method: PUT } } }, { Id: Guid_2, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, Name: posts, Properties: { Label: Posts, ValidateOnPublish: false }, IsPublished: true, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 7, Scripts: { Create: @@ -249,18 +290,23 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, hide: { + Href: {Scrubbed}, Method: PUT }, lock: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -287,18 +333,23 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, hide: { + Href: {Scrubbed}, Method: PUT }, lock: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -324,18 +375,23 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, enable: { + Href: {Scrubbed}, Method: PUT }, hide: { + Href: {Scrubbed}, Method: PUT }, lock: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -343,57 +399,75 @@ ], Links: { contents: { + Href: {Scrubbed}, Method: GET }, contents/create: { + Href: {Scrubbed}, Method: POST }, contents/create/publish: { + Href: {Scrubbed}, Method: POST }, contents/export: { + Href: {Scrubbed}, Method: POST }, contents/migrate: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, fields/add: { + Href: {Scrubbed}, Method: POST }, fields/order: { + Href: {Scrubbed}, Method: PUT }, fields/ui: { + Href: {Scrubbed}, Method: PUT }, indexes: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET }, unpublish: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, update/category: { + Href: {Scrubbed}, Method: PUT }, update/rules: { + Href: {Scrubbed}, Method: PUT }, update/scripts: { + Href: {Scrubbed}, Method: PUT }, update/sync: { + Href: {Scrubbed}, Method: PUT }, update/urls: { + Href: {Scrubbed}, Method: PUT } } @@ -401,9 +475,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt index 357d85c36..22cc0a62a 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt @@ -13,9 +13,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -27,9 +29,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -37,9 +41,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt index 3214647e1..325ee5401 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt @@ -13,9 +13,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -27,9 +29,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -37,9 +41,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt index 5dae4fe5a..f4d22fbc5 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt @@ -13,9 +13,11 @@ IsOptional: true, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -23,9 +25,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt index bdf9ede6d..74cff6c0a 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt @@ -16,9 +16,11 @@ IsOptional: true, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -30,9 +32,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -40,9 +44,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt index 133ce2a67..ce28a19d6 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt @@ -13,9 +13,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -27,9 +29,11 @@ IsOptional: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -37,9 +41,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt index 27827aedd..b9494124e 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt @@ -1,10 +1,13 @@ { + Name: {Scrubbed}, IsDefaultRole: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt index 27827aedd..b9494124e 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt @@ -1,10 +1,13 @@ { + Name: {Scrubbed}, IsDefaultRole: false, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt index aea8c02f4..bfb1797bd 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt @@ -1,4 +1,5 @@ { + Name: {Scrubbed}, IsDefaultRole: false, Permissions: [ a, @@ -6,9 +7,11 @@ ], Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt index 6dbdd310e..4a6675b36 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt @@ -13,11 +13,14 @@ ], HideScheduler: false, HideDateTimeModeButton: false, + Version: {Scrubbed}, Links: { self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt index 113307c7a..a344a171e 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt @@ -32,9 +32,11 @@ Initial: Draft, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt index 596d11ec0..440f314d8 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt @@ -1,9 +1,11 @@ { Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt index 1536a5055..e6d1e8c86 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt @@ -19,9 +19,11 @@ Initial: Draft, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: PUT } } @@ -29,9 +31,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_create_folder.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_create_folder.verified.txt index 86d081db2..dc4df7360 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_create_folder.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_create_folder.verified.txt @@ -4,12 +4,15 @@ FolderName: Guid_2, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_update_folder.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_update_folder.verified.txt index 968c1c488..2ce953c1d 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_update_folder.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_update_folder.verified.txt @@ -5,12 +5,15 @@ Version: 1, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt index 4ae20ba45..691683618 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt @@ -8,6 +8,7 @@ MimeType: image/jpeg, FileType: jpg, MetadataText: 600x135px, 15.2 kB, + EditToken: {Scrubbed}, Metadata: { description: JFIF File, imageQuality: 79, @@ -21,26 +22,37 @@ ], FileSize: 15598, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt index db780dd48..53c483d90 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt @@ -8,6 +8,7 @@ MimeType: audio/mp3, FileType: mp3, MetadataText: 00:00:27.7447500, 433.5 kB, + EditToken: {Scrubbed}, Metadata: { audioBitrate: 128, audioChannels: 2, @@ -20,26 +21,37 @@ ], FileSize: 443926, Type: Audio, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt index 439073397..4a70edfbc 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt @@ -8,6 +8,7 @@ MimeType: image/bmp, FileType: bmp, MetadataText: 600x400px, 703.2 kB, + EditToken: {Scrubbed}, Metadata: { pixelHeight: 400, pixelWidth: 600 @@ -19,26 +20,37 @@ ], FileSize: 720054, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt index 439073397..4a70edfbc 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/bmp, FileType: bmp, MetadataText: 600x400px, 703.2 kB, + EditToken: {Scrubbed}, Metadata: { pixelHeight: 400, pixelWidth: 600 @@ -19,26 +20,37 @@ ], FileSize: 720054, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt index 349034a69..219e19d2c 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/gif, FileType: gif, MetadataText: 600x400px, 154.2 kB, + EditToken: {Scrubbed}, Metadata: { description: GIF File, pixelHeight: 400, @@ -20,26 +21,37 @@ ], FileSize: 157934, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt index daa210d61..532f52590 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt @@ -1,10 +1,14 @@ { Id: Guid_1, ParentId: Guid_Empty, + FileName: {Scrubbed}, + FileHash: {Scrubbed}, IsProtected: false, + Slug: {Scrubbed}, MimeType: image/gif, FileType: blob, MetadataText: 600x400px, 154.2 kB, + EditToken: {Scrubbed}, Metadata: { pixelHeight: 400, pixelWidth: 600 @@ -16,26 +20,37 @@ ], FileSize: 157934, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_jpg_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_jpg_and_resize.verified.txt index 480ba9f4f..87fd1be05 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_jpg_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_jpg_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/jpeg, FileType: jpg, MetadataText: 600x400px, 59.2 kB, + EditToken: {Scrubbed}, Metadata: { description: JFIF File, imageQuality: 79, @@ -21,26 +22,37 @@ ], FileSize: 60603, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_png_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_png_and_resize.verified.txt index 8026aef24..73a7a7748 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_png_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_png_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x400px, 428.9 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 400, @@ -20,26 +21,37 @@ ], FileSize: 439244, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tga_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tga_and_resize.verified.txt index 25069d9e0..da783b470 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tga_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tga_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/x-tga, FileType: tga, MetadataText: 600x400px, 617.2 kB, + EditToken: {Scrubbed}, Metadata: { pixelHeight: 400, pixelWidth: 600 @@ -19,26 +20,37 @@ ], FileSize: 631995, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tiff_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tiff_and_resize.verified.txt index 750a870e8..dad653eb6 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tiff_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tiff_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/jpeg, FileType: tiff, MetadataText: 600x400px, 473.6 kB, + EditToken: {Scrubbed}, Metadata: { description: TIFF File, pixelHeight: 400, @@ -20,26 +21,37 @@ ], FileSize: 485012, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_webp_and_resize.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_webp_and_resize.verified.txt index d29bf5971..1c6474458 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_webp_and_resize.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_webp_and_resize.verified.txt @@ -8,6 +8,7 @@ MimeType: image/jpeg, FileType: webp, MetadataText: 600x400px, 37.7 kB, + EditToken: {Scrubbed}, Metadata: { pixelHeight: 400, pixelWidth: 600 @@ -19,26 +20,37 @@ ], FileSize: 38580, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_flv.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_flv.verified.txt index e043e28e6..0fadac998 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_flv.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_flv.verified.txt @@ -8,6 +8,7 @@ MimeType: audio/x-flv, FileType: flv, MetadataText: 1280x720pt, 1 MB, + EditToken: {Scrubbed}, Metadata: { audioBitrate: 384, audioSampleRate: 48000, @@ -19,26 +20,37 @@ ], FileSize: 1051185, Type: Video, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mkv.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mkv.verified.txt index 423f67625..ad07418fc 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mkv.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mkv.verified.txt @@ -8,6 +8,7 @@ MimeType: audio/webm, FileType: flv, MetadataText: 1280x720pt, 1 MB, + EditToken: {Scrubbed}, Metadata: { audioBitrate: 384, audioSampleRate: 48000, @@ -19,26 +20,37 @@ ], FileSize: 1051185, Type: Video, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mp4.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mp4.verified.txt index ef99fdf55..76957d422 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mp4.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mp4.verified.txt @@ -8,6 +8,7 @@ MimeType: audio/mp4, FileType: mp4, MetadataText: 1280x720pt, 00:00:05.3120000, 1 MB, + EditToken: {Scrubbed}, Metadata: { audioBitrate: 384, audioChannels: 2, @@ -22,26 +23,37 @@ ], FileSize: 1055736, Type: Video, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annotate_asset_in_parallel.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annotate_asset_in_parallel.verified.txt index 69e1debf7..e0fc31c76 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annotate_asset_in_parallel.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annotate_asset_in_parallel.verified.txt @@ -8,33 +8,47 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, pixelWidth: 600 }, + Tags: {Scrubbed}, FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, + Version: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Bulk.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Bulk.verified.txt index a3ff25c1e..e90cbaf28 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Bulk.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Bulk.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: blob, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,27 +21,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Single.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Single.verified.txt index a3ff25c1e..e90cbaf28 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Single.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Single.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: blob, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,27 +21,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Bulk.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Bulk.verified.txt index 0c17d3a0a..2e9ac6e22 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Bulk.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Bulk.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 19 kB, + EditToken: {Scrubbed}, Metadata: { ph: 20, pw: 100 @@ -19,27 +20,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Single.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Single.verified.txt index 0c17d3a0a..2e9ac6e22 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Single.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Single.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 19 kB, + EditToken: {Scrubbed}, Metadata: { ph: 20, pw: 100 @@ -19,27 +20,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Bulk.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Bulk.verified.txt index 4d98c2bdf..159645c0e 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Bulk.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Bulk.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,27 +21,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Single.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Single.verified.txt index 4d98c2bdf..159645c0e 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Single.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Single.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,27 +21,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Bulk.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Bulk.verified.txt index 736724527..51de62338 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Bulk.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Bulk.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -19,27 +20,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Single.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Single.verified.txt index 736724527..51de62338 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Single.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Single.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -19,27 +20,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_compute_blur_hash_script.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_compute_blur_hash_script.verified.txt index ff8cec307..232a6458c 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_compute_blur_hash_script.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_compute_blur_hash_script.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x135px, 17.1 kB, + EditToken: {Scrubbed}, Metadata: { blurHash: UH2%3Akvb}kufmflj]j^RLaIjDe,f4f5axf4, description: PNG File, @@ -22,27 +23,38 @@ FileSize: 17539, FileVersion: 1, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Bulk.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Bulk.verified.txt index 83154ca7e..e7ed75e38 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Bulk.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Bulk.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,27 +21,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Single.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Single.verified.txt index 83154ca7e..e7ed75e38 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Single.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Single.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,27 +21,38 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_with_script.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_with_script.verified.txt index 704f2b892..a857dd0c9 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_with_script.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_with_script.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,26 +21,37 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_replace_asset.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_replace_asset.verified.txt index 3b4a593ee..30b69be01 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_replace_asset.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_replace_asset.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x135px, 17.1 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 135, @@ -21,27 +22,38 @@ FileSize: 17539, FileVersion: 1, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset.verified.txt index c325fcd88..e6639fe5c 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,26 +21,37 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset_with_custom_id.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset_with_custom_id.verified.txt index c325fcd88..e6639fe5c 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset_with_custom_id.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset_with_custom_id.verified.txt @@ -8,6 +8,7 @@ MimeType: image/png, FileType: png, MetadataText: 600x600px, 19 kB, + EditToken: {Scrubbed}, Metadata: { description: PNG File, pixelHeight: 600, @@ -20,26 +21,37 @@ ], FileSize: 19430, Type: Image, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Links: { content: { + Href: {Scrubbed}, Method: GET }, content/slug: { + Href: {Scrubbed}, Method: GET }, delete: { + Href: {Scrubbed}, Method: DELETE }, move: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, update: { + Href: {Scrubbed}, Method: PUT }, upload: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_json_with_dot.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_json_with_dot.verified.txt index 53359e72c..5ee357ba2 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_json_with_dot.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_json_with_dot.verified.txt @@ -12,22 +12,34 @@ NewStatus: , Status: Published, EditingStatus: Published, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, + EditToken: {Scrubbed}, Links: { clone: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, draft/create: { + Href: {Scrubbed}, Method: POST }, previous: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_non_published_content.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_non_published_content.verified.txt index 9b322a043..3665c6705 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_non_published_content.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_non_published_content.verified.txt @@ -10,15 +10,25 @@ NewStatus: , Status: Draft, EditingStatus: Draft, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, + EditToken: {Scrubbed}, Links: { clone: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_null_localized_text.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_null_localized_text.verified.txt index 6149d987e..367e30594 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_null_localized_text.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_null_localized_text.verified.txt @@ -9,22 +9,34 @@ NewStatus: , Status: Published, EditingStatus: Published, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, + EditToken: {Scrubbed}, Links: { clone: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, draft/create: { + Href: {Scrubbed}, Method: POST }, previous: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_published_content.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_published_content.verified.txt index 2b29e6852..2a63a886f 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_published_content.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_published_content.verified.txt @@ -10,22 +10,34 @@ NewStatus: , Status: Published, EditingStatus: Published, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, + EditToken: {Scrubbed}, Links: { clone: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, draft/create: { + Href: {Scrubbed}, Method: POST }, previous: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_strange_text.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_strange_text.verified.txt index d99919f8b..01fa0b1c5 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_strange_text.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_strange_text.verified.txt @@ -10,22 +10,34 @@ NewStatus: , Status: Published, EditingStatus: Published, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, + EditToken: {Scrubbed}, Links: { clone: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, draft/create: { + Href: {Scrubbed}, Method: POST }, previous: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_get_content_by_version.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_get_content_by_version.verified.txt index 2b29e6852..2a63a886f 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_get_content_by_version.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_get_content_by_version.verified.txt @@ -10,22 +10,34 @@ NewStatus: , Status: Published, EditingStatus: Published, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, + EditToken: {Scrubbed}, Links: { clone: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, draft/create: { + Href: {Scrubbed}, Method: POST }, previous: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_update_singleton_content_with_special_id.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_update_singleton_content_with_special_id.verified.txt index e5765f504..1c20c20f7 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_update_singleton_content_with_special_id.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_update_singleton_content_with_special_id.verified.txt @@ -7,16 +7,26 @@ NewStatus: , Status: Published, EditingStatus: Published, + AppName: {Scrubbed}, + SchemaName: {Scrubbed}, Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 2, + EditToken: {Scrubbed}, Links: { draft/create: { + Href: {Scrubbed}, Method: POST }, previous: { + Href: {Scrubbed}, Method: GET }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/GraphQLTests.Should_query_assets.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/GraphQLTests.Should_query_assets.verified.txt index a47c0baef..c836c1836 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/GraphQLTests.Should_query_assets.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/GraphQLTests.Should_query_assets.verified.txt @@ -1,39 +1,44 @@ { findAsset: { - id: Guid_1, - created: DateTimeOffset_1, + created: {Scrubbed}, createdBy: client:root, createdByUser: { - id: root, - email: client:root, - displayName: root - }, - lastModified: DateTimeOffset_1, - lastModifiedBy: client:root, - lastModifiedByUser: { - id: root, + displayName: root, email: client:root, - displayName: root + id: root }, - mimeType: image/png, - fileName: logo-squared.png, + editToken: {Scrubbed}, fileHash: pAp0RDvipkoNCCTgey1HTJekRKKEWT6Ft5JdRLuAfAc=, + fileName: logo-squared.png, fileSize: 19430, fileVersion: 0, + id: Guid_1, isImage: true, isProtected: false, - pixelWidth: 600, - pixelHeight: 600, + lastModified: {Scrubbed}, + lastModifiedBy: client:root, + lastModifiedByUser: { + displayName: root, + email: client:root, + id: root + }, + metadata: {Scrubbed}, + metadataPixelWidth: 600, + metadataText: 600x600px, 19 kB, + metadataUnknown: null, + mimeType: image/png, parentId: Guid_Empty, + pixelHeight: 600, + pixelWidth: 600, + slug: logo-squared.png, tags: [ type/png, image, image/medium ], + thumbnailUrl: {Scrubbed}, type: IMAGE, - metadataText: 600x600px, 19 kB, - metadataPixelWidth: 600, - metadataUnknown: null, - slug: logo-squared.png + url: {Scrubbed}, + version: {Scrubbed} } } \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_allow_anonymous_access_if_client_is_anonymous.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_allow_anonymous_access_if_client_is_anonymous.verified.txt new file mode 100644 index 000000000..49c67d6da --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_allow_anonymous_access_if_client_is_anonymous.verified.txt @@ -0,0 +1,10 @@ +{ + Content: [ + { + Type: text, + Text: [] + } + ], + Meta: {Scrubbed}, + ResultType: complete +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=False.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=False.verified.txt new file mode 100644 index 000000000..49c67d6da --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=False.verified.txt @@ -0,0 +1,10 @@ +{ + Content: [ + { + Type: text, + Text: [] + } + ], + Meta: {Scrubbed}, + ResultType: complete +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=True.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=True.verified.txt new file mode 100644 index 000000000..49c67d6da --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_authenticate_with_client_secret_fullClientId=True.verified.txt @@ -0,0 +1,10 @@ +{ + Content: [ + { + Type: text, + Text: [] + } + ], + Meta: {Scrubbed}, + ResultType: complete +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_asset.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_asset.verified.txt new file mode 100644 index 000000000..81f6b87cd --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_asset.verified.txt @@ -0,0 +1,24 @@ +{ + created: {Scrubbed}, + fileName: logo-squared.png, + fileSize: 19430, + id: Guid_1, + isProtected: false, + lastModified: {Scrubbed}, + metadata: { + description: PNG File, + pixelHeight: 600, + pixelWidth: 600 + }, + mimeType: image/png, + parentId: Guid_Empty, + slug: logo-squared.png, + tags: [ + type/png, + image, + image/medium + ], + type: Image, + url: {url}/api/assets/integration-tests/Guid_1/, + version: 0 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_content.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_content.verified.txt new file mode 100644 index 000000000..17d0b4295 --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_content.verified.txt @@ -0,0 +1,19 @@ +{ + created: {Scrubbed}, + data: { + localized: { + custom: default, + de: default, + en: default + }, + number: { + iv: 42 + } + }, + id: Guid_1, + lastModified: {Scrubbed}, + newStatus: null, + schema: my-mcp, + status: Published, + version: 1 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_schema.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_schema.verified.txt new file mode 100644 index 000000000..160252df4 --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_get_schema.verified.txt @@ -0,0 +1,304 @@ +{ + category: null, + fields: [ + { + fieldId: 1, + isDisabled: false, + isHidden: false, + isLocked: false, + name: number, + nested: null, + partitioning: invariant, + properties: { + allowedValues: null, + defaultValue: null, + defaultValues: null, + editor: Input, + editorUrl: null, + fieldType: Number, + hints: null, + inlineEditable: false, + isCreateOnly: false, + isHalfWidth: false, + isRequired: true, + isRequiredOnPublish: false, + isUnique: false, + label: null, + maxValue: null, + minValue: null, + placeholder: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 2, + isDisabled: false, + isHidden: false, + isLocked: false, + name: string, + nested: null, + partitioning: invariant, + properties: { + allowedValues: null, + classNames: null, + contentType: Unspecified, + createEnum: false, + defaultValue: null, + defaultValues: null, + editor: Input, + editorUrl: null, + fieldType: String, + folderId: null, + hints: null, + inlineEditable: false, + isCreateOnly: false, + isEmbeddable: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + isUnique: false, + label: null, + maxCharacters: null, + maxLength: null, + maxWords: null, + minCharacters: null, + minLength: null, + minWords: null, + pattern: null, + patternMessage: null, + placeholder: null, + schemaIds: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 3, + isDisabled: false, + isHidden: false, + isLocked: false, + name: searchable, + nested: null, + partitioning: invariant, + properties: { + allowedValues: null, + classNames: null, + contentType: Unspecified, + createEnum: false, + defaultValue: null, + defaultValues: null, + editor: Input, + editorUrl: null, + fieldType: String, + folderId: null, + hints: null, + inlineEditable: false, + isCreateOnly: false, + isEmbeddable: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + isUnique: false, + label: null, + maxCharacters: null, + maxLength: null, + maxWords: null, + minCharacters: null, + minLength: null, + minWords: null, + pattern: null, + patternMessage: null, + placeholder: null, + schemaIds: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 4, + isDisabled: false, + isHidden: false, + isLocked: false, + name: geo, + nested: null, + partitioning: invariant, + properties: { + editor: Map, + editorUrl: null, + fieldType: Geolocation, + hints: null, + isCreateOnly: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + label: null, + placeholder: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 5, + isDisabled: false, + isHidden: false, + isLocked: false, + name: json, + nested: null, + partitioning: invariant, + properties: { + editorUrl: null, + fieldType: Json, + graphQLSchema: null, + hints: null, + isCreateOnly: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + label: null, + placeholder: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 6, + isDisabled: false, + isHidden: false, + isLocked: false, + name: localized, + nested: null, + partitioning: language, + properties: { + allowedValues: null, + classNames: null, + contentType: Unspecified, + createEnum: false, + defaultValue: default, + defaultValues: null, + editor: Input, + editorUrl: null, + fieldType: String, + folderId: null, + hints: null, + inlineEditable: false, + isCreateOnly: false, + isEmbeddable: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + isUnique: false, + label: null, + maxCharacters: null, + maxLength: null, + maxWords: null, + minCharacters: null, + minLength: null, + minWords: null, + pattern: null, + patternMessage: null, + placeholder: null, + schemaIds: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 7, + isDisabled: false, + isHidden: false, + isLocked: false, + name: id, + nested: null, + partitioning: invariant, + properties: { + allowedValues: null, + classNames: null, + contentType: Unspecified, + createEnum: false, + defaultValue: null, + defaultValues: null, + editor: Input, + editorUrl: null, + fieldType: String, + folderId: null, + hints: null, + inlineEditable: false, + isCreateOnly: false, + isEmbeddable: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + isUnique: false, + label: null, + maxCharacters: null, + maxLength: null, + maxWords: null, + minCharacters: null, + minLength: null, + minWords: null, + pattern: null, + patternMessage: null, + placeholder: null, + schemaIds: null, + searchMode: Default, + searchPaths: null, + tags: null + } + }, + { + fieldId: 8, + isDisabled: false, + isHidden: false, + isLocked: false, + name: immutable, + nested: null, + partitioning: invariant, + properties: { + allowedValues: null, + classNames: null, + contentType: Unspecified, + createEnum: false, + defaultValue: null, + defaultValues: null, + editor: Input, + editorUrl: null, + fieldType: String, + folderId: null, + hints: null, + inlineEditable: false, + isCreateOnly: true, + isEmbeddable: false, + isHalfWidth: false, + isRequired: false, + isRequiredOnPublish: false, + isUnique: false, + label: null, + maxCharacters: null, + maxLength: null, + maxWords: null, + minCharacters: null, + minLength: null, + minWords: null, + pattern: null, + patternMessage: null, + placeholder: null, + schemaIds: null, + searchMode: Default, + searchPaths: null, + tags: null + } + } + ], + hints: null, + isPublished: true, + label: null, + name: my-mcp, + type: Default +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_list_tools.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_list_tools.verified.txt new file mode 100644 index 000000000..9031047a5 --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_list_tools.verified.txt @@ -0,0 +1,186 @@ +[ + { + annotations: { + idempotentHint: true, + openWorldHint: false, + readOnlyHint: true, + title: Get asset + }, + description: Gets the metadata of a single asset by ID, including the URL to download the file., + inputSchema: { + properties: { + id: { + description: The ID of the asset., + type: string + } + }, + required: [ + id + ], + type: object + }, + name: get_asset, + title: Get asset + }, + { + annotations: { + idempotentHint: true, + openWorldHint: false, + readOnlyHint: true, + title: Get content + }, + description: Gets a single content item by ID., + inputSchema: { + properties: { + id: { + description: The ID of the content item., + type: string + }, + schema: { + description: The name or ID of the schema., + type: string + }, + unpublished: { + default: false, + description: True to also return unpublished content items., + type: boolean + } + }, + required: [ + schema, + id + ], + type: object + }, + name: get_content, + title: Get content + }, + { + annotations: { + idempotentHint: true, + openWorldHint: false, + readOnlyHint: true, + title: Get schema + }, + description: Gets a schema with all fields. The field names are the keys in the data of content items., + inputSchema: { + properties: { + schema: { + description: The name or ID of the schema., + type: string + } + }, + required: [ + schema + ], + type: object + }, + name: get_schema, + title: Get schema + }, + { + annotations: { + idempotentHint: true, + openWorldHint: false, + readOnlyHint: true, + title: List schemas + }, + description: Lists all schemas of the app with name, type and label. Use get_schema to get the fields of a schema., + inputSchema: { + type: object + }, + name: list_schemas, + title: List schemas + }, + { + annotations: { + idempotentHint: true, + openWorldHint: false, + readOnlyHint: true, + title: Query assets + }, + description: +Queries assets. Use either a JSON query or an OData query. If both are provided, the JSON query is used. +JSON query example: {"filter": {"path": "fileName", "op": "contains", "value": "logo"}, "sort": [{"path": "lastModified", "order": "descending"}], "take": 20}. +OData query example: $filter=contains(fileName, 'logo')&$orderby=lastModified desc&$top=20., + inputSchema: { + properties: { + odata: { + default: null, + description: The optional OData query, e.g. $filter=mimeType eq 'image/png'&$top=10., + type: [ + string, + null + ] + }, + parentId: { + default: null, + description: The optional ID of the folder. Omit to search in all folders., + type: [ + string, + null + ] + }, + query: { + default: null, + description: The optional JSON query., + type: [ + string, + null + ] + } + }, + type: object + }, + name: query_assets, + title: Query assets + }, + { + annotations: { + idempotentHint: true, + openWorldHint: false, + readOnlyHint: true, + title: Query contents + }, + description: +Queries content items of a schema. Use either a JSON query or an OData query. If both are provided, the JSON query is used. +JSON query example: {"filter": {"path": "data.title.iv", "op": "contains", "value": "hello"}, "sort": [{"path": "lastModified", "order": "descending"}], "skip": 0, "take": 20}. +OData query example: $filter=contains(data/title/iv, 'hello')&$orderby=lastModified desc&$skip=0&$top=20. +Field values are stored per language or with the "iv" key for non-localized fields. Use get_schema to get the field names., + inputSchema: { + properties: { + odata: { + default: null, + description: The optional OData query, e.g. $filter=data/title/iv eq 'hello'&$top=10., + type: [ + string, + null + ] + }, + query: { + default: null, + description: The optional JSON query., + type: [ + string, + null + ] + }, + schema: { + description: The name or ID of the schema., + type: string + }, + unpublished: { + default: false, + description: True to also return unpublished content items., + type: boolean + } + }, + required: [ + schema + ], + type: object + }, + name: query_contents, + title: Query contents + } +] \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_not_query_unpublished_contents_by_default.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_not_query_unpublished_contents_by_default.verified.txt new file mode 100644 index 000000000..31184055f --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_not_query_unpublished_contents_by_default.verified.txt @@ -0,0 +1,3 @@ +{ + total: 0 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_json.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_json.verified.txt new file mode 100644 index 000000000..c31d37d6a --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_json.verified.txt @@ -0,0 +1,29 @@ +{ + items: [ + { + created: {Scrubbed}, + fileName: logo-squared.png, + fileSize: 19430, + id: Guid_1, + isProtected: false, + lastModified: {Scrubbed}, + metadata: { + description: PNG File, + pixelHeight: 600, + pixelWidth: 600 + }, + mimeType: image/png, + parentId: Guid_Empty, + slug: logo-squared.png, + tags: [ + type/png, + image, + image/medium + ], + type: Image, + url: {url}/api/assets/integration-tests/Guid_1/, + version: 0 + } + ], + total: 1 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_odata.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_odata.verified.txt new file mode 100644 index 000000000..c31d37d6a --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_assets_with_odata.verified.txt @@ -0,0 +1,29 @@ +{ + items: [ + { + created: {Scrubbed}, + fileName: logo-squared.png, + fileSize: 19430, + id: Guid_1, + isProtected: false, + lastModified: {Scrubbed}, + metadata: { + description: PNG File, + pixelHeight: 600, + pixelWidth: 600 + }, + mimeType: image/png, + parentId: Guid_Empty, + slug: logo-squared.png, + tags: [ + type/png, + image, + image/medium + ], + type: Image, + url: {url}/api/assets/integration-tests/Guid_1/, + version: 0 + } + ], + total: 1 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_json.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_json.verified.txt new file mode 100644 index 000000000..fa844651d --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_json.verified.txt @@ -0,0 +1,27 @@ +{ + items: [ + { + created: {Scrubbed}, + data: { + localized: { + custom: default, + de: default, + en: default + }, + number: { + iv: 0 + }, + string: { + iv: Guid_1 + } + }, + id: Guid_2, + lastModified: {Scrubbed}, + newStatus: null, + schema: my-mcp, + status: Published, + version: 1 + } + ], + total: 1 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_odata.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_odata.verified.txt new file mode 100644 index 000000000..9589b5f9e --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_contents_with_odata.verified.txt @@ -0,0 +1,49 @@ +{ + items: [ + { + created: {Scrubbed}, + data: { + localized: { + custom: default, + de: default, + en: default + }, + number: { + iv: 2 + }, + string: { + iv: Guid_1 + } + }, + id: Guid_2, + lastModified: {Scrubbed}, + newStatus: null, + schema: my-mcp, + status: Published, + version: 1 + }, + { + created: {Scrubbed}, + data: { + localized: { + custom: default, + de: default, + en: default + }, + number: { + iv: 1 + }, + string: { + iv: Guid_1 + } + }, + id: Guid_3, + lastModified: {Scrubbed}, + newStatus: null, + schema: my-mcp, + status: Published, + version: 1 + } + ], + total: 2 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_unpublished_contents_if_requested.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_unpublished_contents_if_requested.verified.txt new file mode 100644 index 000000000..182ae6e6a --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_query_unpublished_contents_if_requested.verified.txt @@ -0,0 +1,27 @@ +{ + items: [ + { + created: {Scrubbed}, + data: { + localized: { + custom: default, + de: default, + en: default + }, + number: { + iv: 0 + }, + string: { + iv: Guid_1 + } + }, + id: Guid_2, + lastModified: {Scrubbed}, + newStatus: null, + schema: my-mcp, + status: Draft, + version: 0 + } + ], + total: 1 +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_odata_query_is_invalid.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_odata_query_is_invalid.verified.txt new file mode 100644 index 000000000..1e2b73ddf --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_odata_query_is_invalid.verified.txt @@ -0,0 +1,11 @@ +{ + Content: [ + { + Type: text, + Text: An error occurred invoking 'query_contents': OData $filter clause not valid: Expression expected at position 8 in 'invalid('. + } + ], + IsError: true, + Meta: {Scrubbed}, + ResultType: complete +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_schema_not_found.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_schema_not_found.verified.txt new file mode 100644 index 000000000..f55503b48 --- /dev/null +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/McpTests.Should_return_error_if_schema_not_found.verified.txt @@ -0,0 +1,11 @@ +{ + Content: [ + { + Type: text, + Text: An error occurred invoking 'get_content': Entity (unknown) does not exist. + } + ], + IsError: true, + Meta: {Scrubbed}, + ResultType: complete +} \ No newline at end of file diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleRunnerTests.Should_log_to_console_in_rules.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleRunnerTests.Should_log_to_console_in_rules.verified.txt index 28a9d7a51..f05bc9a79 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleRunnerTests.Should_log_to_console_in_rules.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleRunnerTests.Should_log_to_console_in_rules.verified.txt @@ -39,29 +39,40 @@ { Log: [ { + Timestamp: {Scrubbed}, Message: DEBUG: Hello debug }, { + Timestamp: {Scrubbed}, Message: ERROR: Hello error }, { + Timestamp: {Scrubbed}, Message: INFO: Hello info }, { + Timestamp: {Scrubbed}, Message: Hello Log }, { + Timestamp: {Scrubbed}, Message: WARN: Hello warn } - ] + ], + Started: {Scrubbed}, + Completed: {Scrubbed} } ] } }, + NextRun: {Scrubbed}, + Created: {Scrubbed}, + Completed: {Scrubbed}, Status: Completed }, Links: { update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule.verified.txt index 3ebf8bde5..8f60ae387 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule.verified.txt @@ -1,5 +1,9 @@ { Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, IsEnabled: true, Trigger: { HandleAll: true @@ -17,21 +21,27 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, logs: { + Href: {Scrubbed}, Method: GET }, run: { + Href: {Scrubbed}, Method: PUT }, run/snapshots: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule_with_action.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule_with_action.verified.txt index 8b9485512..784bbe768 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule_with_action.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_create_rule_with_action.verified.txt @@ -1,5 +1,9 @@ { Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, IsEnabled: true, Trigger: { HandleAll: true @@ -17,21 +21,27 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, logs: { + Href: {Scrubbed}, Method: GET }, run: { + Href: {Scrubbed}, Method: PUT }, run/snapshots: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_update_rule.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_update_rule.verified.txt index 4de891461..63f9fe70b 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_update_rule.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/RuleTests.Should_update_rule.verified.txt @@ -1,5 +1,9 @@ { Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Version: 1, IsEnabled: true, Name: Guid_2, @@ -19,21 +23,27 @@ }, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, disable: { + Href: {Scrubbed}, Method: PUT }, logs: { + Href: {Scrubbed}, Method: GET }, run: { + Href: {Scrubbed}, Method: PUT }, run/snapshots: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema.verified.txt index b09bedbee..b7a4777bd 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema.verified.txt @@ -1,55 +1,75 @@ { Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Name: {Scrubbed}, Type: Singleton, Properties: { ValidateOnPublish: false }, IsPublished: true, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Scripts: {}, Links: { contents: { + Href: {Scrubbed}, Method: GET }, contents/export: { + Href: {Scrubbed}, Method: POST }, contents/migrate: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, fields/add: { + Href: {Scrubbed}, Method: POST }, fields/order: { + Href: {Scrubbed}, Method: PUT }, fields/ui: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, unpublish: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, update/category: { + Href: {Scrubbed}, Method: PUT }, update/rules: { + Href: {Scrubbed}, Method: PUT }, update/scripts: { + Href: {Scrubbed}, Method: PUT }, update/sync: { + Href: {Scrubbed}, Method: PUT }, update/urls: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema_with_obsolete_property.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema_with_obsolete_property.verified.txt index b09bedbee..b7a4777bd 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema_with_obsolete_property.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/SchemaTests.Should_create_singleton_schema_with_obsolete_property.verified.txt @@ -1,55 +1,75 @@ { Id: Guid_1, + CreatedBy: {Scrubbed}, + LastModifiedBy: {Scrubbed}, + Name: {Scrubbed}, Type: Singleton, Properties: { ValidateOnPublish: false }, IsPublished: true, + Created: {Scrubbed}, + LastModified: {Scrubbed}, Scripts: {}, Links: { contents: { + Href: {Scrubbed}, Method: GET }, contents/export: { + Href: {Scrubbed}, Method: POST }, contents/migrate: { + Href: {Scrubbed}, Method: POST }, delete: { + Href: {Scrubbed}, Method: DELETE }, fields/add: { + Href: {Scrubbed}, Method: POST }, fields/order: { + Href: {Scrubbed}, Method: PUT }, fields/ui: { + Href: {Scrubbed}, Method: PUT }, self: { + Href: {Scrubbed}, Method: GET }, unpublish: { + Href: {Scrubbed}, Method: PUT }, update: { + Href: {Scrubbed}, Method: PUT }, update/category: { + Href: {Scrubbed}, Method: PUT }, update/rules: { + Href: {Scrubbed}, Method: PUT }, update/scripts: { + Href: {Scrubbed}, Method: PUT }, update/sync: { + Href: {Scrubbed}, Method: PUT }, update/urls: { + Href: {Scrubbed}, Method: PUT } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_invite_contributor.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_invite_contributor.verified.txt index 57eb897bc..1f900b903 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_invite_contributor.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_invite_contributor.verified.txt @@ -1,10 +1,15 @@ { + ContributorId: {Scrubbed}, + ContributorName: {Scrubbed}, + ContributorEmail: {Scrubbed}, Role: Owner, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: POST } } diff --git a/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_remove_contributor.verified.txt b/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_remove_contributor.verified.txt index 2da04bdc4..9bb6ed3d3 100644 --- a/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_remove_contributor.verified.txt +++ b/tools/TestSuite/TestSuite.ApiTests/Verify/TeamContributorTests.Should_remove_contributor.verified.txt @@ -1,12 +1,17 @@ { Items: [ { + ContributorId: {Scrubbed}, + ContributorName: {Scrubbed}, + ContributorEmail: {Scrubbed}, Role: Owner, Links: { delete: { + Href: {Scrubbed}, Method: DELETE }, update: { + Href: {Scrubbed}, Method: POST } } @@ -14,9 +19,11 @@ ], Links: { create: { + Href: {Scrubbed}, Method: POST }, self: { + Href: {Scrubbed}, Method: GET } } diff --git a/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs b/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs index a794471e9..96379212c 100644 --- a/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs +++ b/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs @@ -27,16 +27,16 @@ public class ClientFixture : IAsyncLifetime static ClientFixture() { - VerifierSettings.IgnoreMember("AppName"); - VerifierSettings.IgnoreMember("Created"); - VerifierSettings.IgnoreMember("CreatedBy"); - VerifierSettings.IgnoreMember("EditToken"); - VerifierSettings.IgnoreMember("Href"); - VerifierSettings.IgnoreMember("LastModified"); - VerifierSettings.IgnoreMember("LastModifiedBy"); - VerifierSettings.IgnoreMember("RoleProperties"); - VerifierSettings.IgnoreMember("SchemaName"); - VerifierSettings.IgnoreMembersWithType(); + VerifierSettings.ScrubMember("AppName"); + VerifierSettings.ScrubMember("Created"); + VerifierSettings.ScrubMember("CreatedBy"); + VerifierSettings.ScrubMember("EditToken"); + VerifierSettings.ScrubMember("Href"); + VerifierSettings.ScrubMember("LastModified"); + VerifierSettings.ScrubMember("LastModifiedBy"); + VerifierSettings.ScrubMember("RoleProperties"); + VerifierSettings.ScrubMember("SchemaName"); + VerifierSettings.ScrubMembersWithType(); } public Task<(ISquidexClient, AppDto)> PostAppAsync(string? name = null) diff --git a/tools/e2e/package-lock.json b/tools/e2e/package-lock.json index 32bef313b..ba4211e51 100644 --- a/tools/e2e/package-lock.json +++ b/tools/e2e/package-lock.json @@ -12,7 +12,7 @@ "uuid": "^10.0.0" }, "devDependencies": { - "@playwright/test": "^1.49.1", + "@playwright/test": "^1.64.1", "@types/node": "^20.9.3", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^6.12.0", @@ -157,18 +157,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.49.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.1.tgz", - "integrity": "sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.1.tgz", + "integrity": "sha512-IaYGml/nSOiZWROfPtuIL7neuu9qDOZ3TNvNljUIrhDMxiGTgPjzj/g9p9RxpS2tSepPDRY+UwAaEeiKtUvIAg==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright": "1.49.1" + "playwright": "1.64.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@types/json-schema": { @@ -1326,20 +1327,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -2267,33 +2254,32 @@ } }, "node_modules/playwright": { - "version": "1.49.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", - "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.1.tgz", + "integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.1" + "playwright-core": "1.64.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "node": ">=20" } }, "node_modules/playwright-core": { - "version": "1.49.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", - "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", + "version": "1.64.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz", + "integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==", "dev": true, + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/prelude-ls": { diff --git a/tools/e2e/package.json b/tools/e2e/package.json index 7ada8bcca..45e3d195e 100644 --- a/tools/e2e/package.json +++ b/tools/e2e/package.json @@ -12,7 +12,7 @@ "author": "Sebastian", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.49.1", + "@playwright/test": "^1.64.1", "@types/node": "^20.9.3", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^6.12.0",