Browse Source

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.
pull/1352/head
Sebastian Stehle 1 month ago
committed by GitHub
parent
commit
e495ed5d4b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 18
      .claude/launch.json
  2. 4
      .github/workflows/dev.yml
  3. 2
      .github/workflows/make-screenshots.yml
  4. 4
      .github/workflows/release.yml
  5. 2
      CLAUDE.md
  6. 8
      backend/i18n/frontend_de.json
  7. 8
      backend/i18n/frontend_en.json
  8. 8
      backend/i18n/frontend_fr.json
  9. 8
      backend/i18n/frontend_it.json
  10. 8
      backend/i18n/frontend_nl.json
  11. 8
      backend/i18n/frontend_pt.json
  12. 8
      backend/i18n/frontend_zh.json
  13. 8
      backend/i18n/source/frontend_de.json
  14. 8
      backend/i18n/source/frontend_en.json
  15. 132
      backend/src/Squidex.Web/Pipeline/AppPermissionClaims.cs
  16. 111
      backend/src/Squidex.Web/Pipeline/AppResolver.cs
  17. 83
      backend/src/Squidex/Areas/Mcp/Config/McpAppMiddleware.cs
  18. 118
      backend/src/Squidex/Areas/Mcp/Config/McpClientSecretHandler.cs
  19. 12
      backend/src/Squidex/Areas/Mcp/Config/McpEndpointMetadata.cs
  20. 46
      backend/src/Squidex/Areas/Mcp/Config/McpServices.cs
  21. 91
      backend/src/Squidex/Areas/Mcp/Tools/AssetTools.cs
  22. 85
      backend/src/Squidex/Areas/Mcp/Tools/ContentTools.cs
  23. 58
      backend/src/Squidex/Areas/Mcp/Tools/McpToolBase.cs
  24. 70
      backend/src/Squidex/Areas/Mcp/Tools/SchemaTools.cs
  25. 6
      backend/src/Squidex/Config/Authentication/IdentityServerServices.cs
  26. 1
      backend/src/Squidex/Squidex.csproj
  27. 4
      backend/src/Squidex/Startup.cs
  28. 40
      frontend/src/app/features/settings/pages/clients/client-connect-form.component.html
  29. 33
      frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts
  30. 6
      tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs
  31. 12
      tools/TestSuite/TestSuite.ApiTests/AppContributorsTests.cs
  32. 6
      tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs
  33. 8
      tools/TestSuite/TestSuite.ApiTests/AppTests.cs
  34. 6
      tools/TestSuite/TestSuite.ApiTests/AssetFormatTests.cs
  35. 28
      tools/TestSuite/TestSuite.ApiTests/AssetTests.cs
  36. 10
      tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs
  37. 34
      tools/TestSuite/TestSuite.ApiTests/McpFixture.cs
  38. 428
      tools/TestSuite/TestSuite.ApiTests/McpTests.cs
  39. 4
      tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs
  40. 11
      tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs
  41. 12
      tools/TestSuite/TestSuite.ApiTests/TeamContributorTests.cs
  42. 6
      tools/TestSuite/TestSuite.ApiTests/TeamTests.cs
  43. 1
      tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj
  44. 24
      tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt
  45. 24
      tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt
  46. 4
      tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt
  47. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt
  48. 10
      tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt
  49. 5
      tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt
  50. 7
      tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt
  51. 24
      tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt
  52. 76
      tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt
  53. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt
  54. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt
  55. 4
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt
  56. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt
  57. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt
  58. 3
      tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt
  59. 3
      tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt
  60. 3
      tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt
  61. 3
      tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt
  62. 2
      tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt
  63. 2
      tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt
  64. 4
      tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt
  65. 3
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_create_folder.verified.txt
  66. 3
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFoldersTests.Should_update_folder.verified.txt
  67. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt
  68. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt
  69. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt
  70. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt
  71. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt
  72. 15
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt
  73. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_jpg_and_resize.verified.txt
  74. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_png_and_resize.verified.txt
  75. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tga_and_resize.verified.txt
  76. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_tiff_and_resize.verified.txt
  77. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_webp_and_resize.verified.txt
  78. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_flv.verified.txt
  79. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mkv.verified.txt
  80. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_video_mp4.verified.txt
  81. 14
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annotate_asset_in_parallel.verified.txt
  82. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Bulk.verified.txt
  83. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_file_name_strategy=Single.verified.txt
  84. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Bulk.verified.txt
  85. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_metadata_strategy=Single.verified.txt
  86. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Bulk.verified.txt
  87. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_slug_strategy=Single.verified.txt
  88. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Bulk.verified.txt
  89. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_annote_asset_tags_strategy=Single.verified.txt
  90. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_compute_blur_hash_script.verified.txt
  91. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Bulk.verified.txt
  92. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_strategy=Single.verified.txt
  93. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_protect_asset_with_script.verified.txt
  94. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_replace_asset.verified.txt
  95. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset.verified.txt
  96. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetTests.Should_upload_asset_with_custom_id.verified.txt
  97. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_json_with_dot.verified.txt
  98. 10
      tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_non_published_content.verified.txt
  99. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_null_localized_text.verified.txt
  100. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/ContentUpdateTests.Should_create_published_content.verified.txt

18
.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
}
]
}

4
.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

2
.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

4
.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

2
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

8
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?",

8
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?",

8
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?",

8
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?",

8
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?",

8
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?",

8
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?",

8
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?",

8
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?",

132
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;
}
}

111
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;
}
}

83
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<McpEndpointMetadata>() == 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<IApiCostsFeature>(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<bool> IsBlockedAsync(HttpContext httpContext, App app, IUsageGate usageGate)
{
var (_, clientId) = httpContext.User.GetClient();
return usageGate.IsBlockedAsync(app, clientId, DateTime.Today.ToDateOnly(), httpContext.RequestAborted);
}
}

118
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<AuthenticationSchemeOptions> options,
ILoggerFactory logger,
UrlEncoder encoder)
: AuthenticationHandler<AuthenticationSchemeOptions>(options, logger, encoder)
{
public const string SchemeName = "McpClientSecret";
private const string BasicPrefix = "Basic ";
protected override async Task<AuthenticateResult> 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<McpEndpointMetadata>() == 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;
}
}

12
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
{
}

46
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<SchemaTools>()
.WithTools<ContentTools>()
.WithTools<AssetTools>();
// Agents keep their configuration for a long time, so they can use the client secret instead of an expiring token.
services.AddAuthentication()
.AddScheme<AuthenticationSchemeOptions, McpClientSecretHandler>(McpClientSecretHandler.SchemeName, null);
}
public static void UseSquidexMcp(this IApplicationBuilder app)
{
app.UseMiddleware<McpAppMiddleware>();
}
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());
}
}

91
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<string> 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<string> 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()),
};
}
}

85
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<string> 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<string> 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,
};
}
}

58
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<string> ExecuteAsync(Func<Context, Task<object?>> 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);
}
}

70
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<string> 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<string> 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(),
};
});
}
}

6
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;

1
backend/src/Squidex/Squidex.csproj

@ -48,6 +48,7 @@
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="10.5.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.17.0" />
<PackageReference Include="Microsoft.OData.Core" Version="8.4.3" />
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="2.3.0" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON4STJ" Version="4.0.0" />
<PackageReference Include="NJsonSchema" Version="11.6.1" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.1" />

4
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.

40
frontend/src/app/features/settings/pages/clients/client-connect-form.component.html

@ -47,6 +47,46 @@
<sqx-form-hint> {{ "clients.connectWizard.sdkHint" | sqxTranslate }}</sqx-form-hint>
<i class="icon-angle-right"></i>
</div>
<div class="option" (click)="go('MCP')">
<h5>{{ "clients.connectWizard.mcp" | sqxTranslate }}</h5>
<sqx-form-hint> {{ "clients.connectWizard.mcpHint" | sqxTranslate }}</sqx-form-hint>
<i class="icon-angle-right"></i>
</div>
</div>
}
@case ("MCP") {
<div class="section step">
<h5><span class="badge rounded-pill bg-dark">1</span> {{ "clients.connectWizard.mcpStep1" | sqxTranslate }}</h5>
<p>
<sqx-code>{{ mcpUrl }}</sqx-code>
<sqx-form-hint> {{ "clients.connectWizard.mcpStep1Hint" | sqxTranslate }}</sqx-form-hint>
</p>
</div>
<div class="section step">
<h5><span class="badge rounded-pill bg-dark">2</span> {{ "clients.connectWizard.mcpStep2" | sqxTranslate }}</h5>
<p>
<sqx-code>{{ mcpCommand }}</sqx-code>
</p>
</div>
<div class="section step">
<h5><span class="badge rounded-pill bg-dark">3</span> {{ "clients.connectWizard.mcpStep3" | sqxTranslate }}</h5>
<p>
<sqx-code>{{ mcpConfig }}</sqx-code>
<sqx-form-hint>
<span [sqxMarkdown]="'clients.connectWizard.mcpStep3Hint' | sqxTranslate"></span>
</sqx-form-hint>
</p>
</div>
<div class="section">
<sqx-form-hint> {{ "clients.connectWizard.mcpSecretHint" | sqxTranslate }}</sqx-form-hint>
</div>
}

33
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,

6
tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs

@ -36,7 +36,7 @@ public sealed class AppClientsTests(ClientFixture fixture) : IClassFixture<Clien
Assert.Equal(id, client.Name);
await Verify(client)
.IgnoreMember<ClientDto>(x => x.Secret);
.ScrubMember<ClientDto>(x => x.Secret);
}
[Fact]
@ -71,7 +71,7 @@ public sealed class AppClientsTests(ClientFixture fixture) : IClassFixture<Clien
Assert.Equal(updateNameRequest.Role, client_2?.Role);
await Verify(clients_2)
.IgnoreMember<ClientDto>(x => x.Secret);
.ScrubMember<ClientDto>(x => x.Secret);
}
[Fact]
@ -92,7 +92,7 @@ public sealed class AppClientsTests(ClientFixture fixture) : IClassFixture<Clien
Assert.DoesNotContain(clients_2.Items, x => x.Id == client.Id);
await Verify(clients_2)
.IgnoreMember<ClientDto>(x => x.Secret);
.ScrubMember<ClientDto>(x => x.Secret);
}
private async Task<ClientDto> CreateAsync(ISquidexClient app)

12
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<ContributorDto>(x => x.ContributorId)
.IgnoreMember<ContributorDto>(x => x.ContributorEmail)
.IgnoreMember<ContributorDto>(x => x.ContributorName);
.ScrubMember<ContributorDto>(x => x.ContributorId)
.ScrubMember<ContributorDto>(x => x.ContributorEmail)
.ScrubMember<ContributorDto>(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<ContributorDto>(x => x.ContributorId)
.IgnoreMember<ContributorDto>(x => x.ContributorEmail)
.IgnoreMember<ContributorDto>(x => x.ContributorName);
.ScrubMember<ContributorDto>(x => x.ContributorId)
.ScrubMember<ContributorDto>(x => x.ContributorEmail)
.ScrubMember<ContributorDto>(x => x.ContributorName);
}
[Fact]

6
tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs

@ -31,7 +31,7 @@ public sealed class AppRolesTests(CreatedAppFixture fixture) : IClassFixture<Cre
Assert.Empty(role.Permissions);
await Verify(role)
.IgnoreMember<RoleDto>(x => x.Name);
.ScrubMember<RoleDto>(x => x.Name);
}
[Fact]
@ -44,7 +44,7 @@ public sealed class AppRolesTests(CreatedAppFixture fixture) : IClassFixture<Cre
Assert.Empty(role.Permissions);
await Verify(role)
.IgnoreMember<RoleDto>(x => x.Name);
.ScrubMember<RoleDto>(x => x.Name);
}
[Fact]
@ -67,7 +67,7 @@ public sealed class AppRolesTests(CreatedAppFixture fixture) : IClassFixture<Cre
Assert.Equal(updateRequest.Permissions, role_2?.Permissions);
await Verify(role_2)
.IgnoreMember<RoleDto>(x => x.Name);
.ScrubMember<RoleDto>(x => x.Name);
}
[Fact]

8
tools/TestSuite/TestSuite.ApiTests/AppTests.cs

@ -58,7 +58,7 @@ public sealed class AppTests(CreatedAppFixture fixture) : IClassFixture<CreatedA
public async Task Should_upload_image()
{
// STEP 1: Upload image.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var file = new FileParameter(stream, "logo-squared.png", "image/png");
@ -70,7 +70,7 @@ public sealed class AppTests(CreatedAppFixture fixture) : IClassFixture<CreatedA
// STEP 2: Download image.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var temp = new MemoryStream();
@ -90,7 +90,7 @@ public sealed class AppTests(CreatedAppFixture fixture) : IClassFixture<CreatedA
public async Task Should_delete_image()
{
// STEP 1: Upload image.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var file = new FileParameter(stream, "logo-squared.png", "image/png");
@ -139,6 +139,6 @@ public sealed class AppTests(CreatedAppFixture fixture) : IClassFixture<CreatedA
Assert.NotEmpty(settings_1.Editors);
await Verify(settings_1)
.IgnoreMember<AppSettingsDto>(x => x.Version);
.ScrubMember<AppSettingsDto>(x => x.Version);
}
}

6
tools/TestSuite/TestSuite.ApiTests/AssetFormatTests.cs

@ -33,9 +33,9 @@ public class AssetFormatTests(CreatedAppFixture fixture) : IClassFixture<Created
Assert.Equal(AssetType.Image, asset.Type);
await Verify(asset)
.IgnoreMember<AssetDto>(x => x.FileName)
.IgnoreMember<AssetDto>(x => x.FileHash)
.IgnoreMember<AssetDto>(x => x.Slug);
.ScrubMember<AssetDto>(x => x.FileName)
.ScrubMember<AssetDto>(x => x.FileHash)
.ScrubMember<AssetDto>(x => x.Slug);
}
[Fact]

28
tools/TestSuite/TestSuite.ApiTests/AssetTests.cs

@ -27,7 +27,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var downloaded = await _.DownloadAsync(asset_1);
@ -53,7 +53,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
Assert.NotEmpty(progress.Progress);
Assert.NotNull(progress.Asset);
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);
@ -79,7 +79,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
Assert.NotNull(progress.Asset);
Assert.True(progress.Uploads.Count > 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<CreatedAppFix
// STEP 2: Reupload asset.
var asset_2 = await _.Client.Assets.ReplaceFileAsync(asset_1.Id, "Assets/logo-wide.png", "image/png");
await using (var stream = new FileStream("Assets/logo-wide.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-wide.png"))
{
var downloaded = await _.DownloadAsync(asset_2);
@ -190,7 +190,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
Assert.NotNull(progress.Asset);
Assert.NotEmpty(progress.Progress);
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);
@ -220,7 +220,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
Assert.NotNull(progress.Asset);
Assert.True(progress.Uploads.Count > 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<CreatedAppFix
Assert.Equal(1, tags[tag2]);
await Verify(asset_2)
.IgnoreMember<AssetDto>(x => x.Version)
.IgnoreMember<AssetDto>(x => x.Tags);
.ScrubMember<AssetDto>(x => x.Version)
.ScrubMember<AssetDto>(x => x.Tags);
}
[Theory]
@ -411,7 +411,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 2: Download asset.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var downloaded = await _.DownloadAsync(asset_1);
@ -432,7 +432,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 5: Download asset with authentication.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var downloaded = new MemoryStream();
@ -447,7 +447,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 5: Download asset without key.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var ex = await Assert.ThrowsAnyAsync<HttpRequestException>(() =>
{
@ -460,7 +460,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 6: Download asset without key and version.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var ex = await Assert.ThrowsAnyAsync<HttpRequestException>(() =>
{
@ -495,7 +495,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 3: Download asset before script.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var downloaded = await _.DownloadAsync(asset_1);
@ -517,7 +517,7 @@ public class AssetTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFix
// STEP 5: Download asset.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
await using (var stream = File.OpenRead("Assets/logo-squared.png"))
{
var ex = await Assert.ThrowsAnyAsync<HttpRequestException>(() =>
{

10
tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs

@ -79,11 +79,11 @@ public sealed class GraphQLTests(GraphQLFixture fixture) : IClassFixture<GraphQL
var result = await _.Client.SharedDynamicContents.GraphQlAsync<JToken>(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);
}

34
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<McpClient> 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);
}
}

428
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<McpFixture>
{
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<string, object?>
{
["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<string, object?>
{
["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<string> CallAsync(McpClient mcp, string tool,
Dictionary<string, object?>? arguments = null)
{
var result = await mcp.CallToolAsync(tool, arguments ?? []);
var text = Assert.Single(result.Content.OfType<TextContentBlock>()).Text;
Assert.NotEqual(true, result.IsError);
return text;
}
private static Task<HttpResponseMessage> 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);
}
}

4
tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs

@ -82,7 +82,7 @@ public class SchemaTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFi
Assert.Equal(schemaName, schema.Name);
await Verify(schema)
.IgnoreMember<SchemaDto>(x => x.Name);
.ScrubMember<SchemaDto>(x => x.Name);
// STEP 2: Get all schemas.
@ -117,7 +117,7 @@ public class SchemaTests(CreatedAppFixture fixture) : IClassFixture<CreatedAppFi
Assert.Equal(schemaName, schema.Name);
await Verify(schema)
.IgnoreMember<SchemaDto>(x => x.Name);
.ScrubMember<SchemaDto>(x => x.Name);
// STEP 2: Get all schemas.

11
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<Result>(x => x.Meta);
}
}

12
tools/TestSuite/TestSuite.ApiTests/TeamContributorTests.cs

@ -55,9 +55,9 @@ public class TeamContributorTests(ClientFixture fixture) : IClassFixture<ClientF
Assert.Equal("Owner", contributor_1?.Role);
await Verify(contributor_1)
.IgnoreMember<ContributorDto>(x => x.ContributorId)
.IgnoreMember<ContributorDto>(x => x.ContributorEmail)
.IgnoreMember<ContributorDto>(x => x.ContributorName);
.ScrubMember<ContributorDto>(x => x.ContributorId)
.ScrubMember<ContributorDto>(x => x.ContributorEmail)
.ScrubMember<ContributorDto>(x => x.ContributorName);
}
[Fact]
@ -81,9 +81,9 @@ public class TeamContributorTests(ClientFixture fixture) : IClassFixture<ClientF
Assert.DoesNotContain(contributors_2.Items, x => x.ContributorId == contributor2.ContributorId);
await Verify(contributors_2)
.IgnoreMember<ContributorDto>(x => x.ContributorId)
.IgnoreMember<ContributorDto>(x => x.ContributorEmail)
.IgnoreMember<ContributorDto>(x => x.ContributorName);
.ScrubMember<ContributorDto>(x => x.ContributorId)
.ScrubMember<ContributorDto>(x => x.ContributorEmail)
.ScrubMember<ContributorDto>(x => x.ContributorName);
}
[Fact]

6
tools/TestSuite/TestSuite.ApiTests/TeamTests.cs

@ -85,7 +85,8 @@ public class TeamTests(CreatedTeamFixture fixture) : IClassFixture<CreatedTeamFi
var scheme = new AuthSchemeDto
{
Authority = "https://squidex.io",
Domain = "squidex.io",
// Domains can only be assigned to one team, so use a new one for each run.
Domain = $"{Guid.NewGuid()}.squidex.io",
DisplayName = "Squidex",
ClientId = "ID",
ClientSecret = "secret",
@ -114,7 +115,8 @@ public class TeamTests(CreatedTeamFixture fixture) : IClassFixture<CreatedTeamFi
var scheme = new AuthSchemeDto
{
Authority = "https://squidex.io",
Domain = "squidex.io",
// Domains can only be assigned to one team, so use a new one for each run.
Domain = $"{Guid.NewGuid()}.squidex.io",
DisplayName = "Squidex",
ClientId = "ID",
ClientSecret = "secret",

1
tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj

@ -15,6 +15,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="ModelContextProtocol.Core" Version="2.3.0" />
<PackageReference Include="NSwag.Core" Version="14.6.3" />
<PackageReference Include="Squidex.Assets" Version="8.0.5" />
<PackageReference Include="Squidex.Assets.ImageSharp" Version="8.0.5" />

24
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
}
}

24
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
}
}

4
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
}
}

6
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
}
}

10
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
}
}

5
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
}
}

7
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
}
}

24
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
}
}

76
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
}
}

6
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
}
}

6
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
}
}

4
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
}
}

6
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
}
}

6
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
}
}

3
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
}
}

3
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
}
}

3
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
}
}

3
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
}
}

2
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
}
}

2
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
}
}

4
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
}
}

3
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
}
}

3
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

15
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

14
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

12
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
}
}

10
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
}
}

12
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
}
}

12
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
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save