Skip to content

Commit b8d9ec5

Browse files
GaitholabilasomethingsomethingIsengo1989
authored
docs: add app requirements feature (#2238)
* docs: add app requirements feature * address review * Apply suggestions from code review Co-authored-by: somethings <l.apple@shopware.com> * improve wording for being optional * fix conflict * fix linter * fix/links --------- Co-authored-by: somethings <l.apple@shopware.com> Co-authored-by: Micha <m.hobert@shopware.com>
1 parent b91ed0a commit b8d9ec5

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

guides/plugins/apps/lifecycle/app-registration-setup.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,37 @@ As this process is also used for secret rotation, your app **must generate a new
266266
To prevent failure of in-flight requests during the secret rotation, your app **should accept the old secret in parallel** with the new secret for a short period (e.g., 1 minute). After that grace period, the signatures based on the old secret **must be** considered invalid.
267267
:::
268268

269+
## Requirements
270+
271+
Apps can declare requirements in their manifest that must be met for the app to function properly. For example, an app that communicates with the shop via the Admin API will fail if the shop is not publicly accessible — declaring that upfront avoids a registration attempt that is guaranteed to fail. Shopware validates requirements during installation and updates in `prod` environments. If a requirement is not met, the installation is rejected with a descriptive error before the app attempts registration.
272+
273+
Add a `<requirements>` element to your `manifest.xml`. Each requirement is an empty child element — its presence enables it:
274+
275+
::: code-group
276+
277+
```xml [manifest.xml]
278+
<?xml version="1.0" encoding="UTF-8"?>
279+
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/trunk/src/Core/Framework/App/Manifest/Schema/manifest-3.0.xsd">
280+
<meta>
281+
...
282+
</meta>
283+
<requirements>
284+
<public-access/>
285+
</requirements>
286+
</manifest>
287+
```
288+
289+
:::
290+
291+
::: info
292+
Requirements are available since Shopware 6.7.10.0. For the full list of available requirements, see the [manifest reference](../../../../resources/references/app-reference/manifest-reference.md#requirements).
293+
The requirement feature is extensible. We encourage you to contribute new requirements to the Shopware core to allow all app developers to use them.
294+
:::
295+
296+
::: warning
297+
Validation is skipped in `dev` and `test` environments so that local development and CI are not blocked by infrastructure checks.
298+
:::
299+
269300
## Permissions
270301

271302
Shopware comes with the possibility to create fine-grained [Access Control Lists](../administration/../../plugins/administration/permissions-error-handling/add-acl-rules.md) \(ACLs\).

resources/references/app-reference/manifest-reference.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ Can be omitted if no communication between Shopware and your app is needed. For
2323

2424
<<< @/docs/snippets/config/app/setup.xml
2525

26+
## Requirements
27+
28+
Declare requirements that must be met for your app to function properly (since `6.7.10.0`). This section can be omitted if your app does not need environment preconditions for setup or installation. For more details, see the [requirements section](../../../guides/plugins/apps/lifecycle/app-registration-setup.md#requirements).
29+
30+
<<< @/docs/snippets/config/app/requirements.xml
31+
32+
### Available requirements
33+
34+
#### `public-access` (since 6.7.10.0)
35+
36+
Validates that the Shopware instance is publicly reachable, which is necessary for apps that rely on webhooks or server-to-server communication. This is a best-effort check — a temporary network issue could cause it to fail, and a passing check does not guarantee the condition will hold indefinitely. The validator checks that:
37+
38+
- `APP_URL` is configured and uses HTTPS
39+
- The host is not `localhost`, an IP address, or a reserved domain (`.local`, `.test`, `.example`, etc.)
40+
- The host resolves via DNS to a public IP address
41+
- The health check endpoint (`/api/_info/health-check`) returns HTTP 200
42+
2643
## Storefront
2744

2845
Can be omitted if your app template needs higher load priority than other plugins/apps. For more details, follow the [storefront guide](../../../guides/plugins/apps/storefront/index.md).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/trunk/src/Core/Framework/App/Manifest/Schema/manifest-3.0.xsd">
4+
<meta>
5+
...
6+
</meta>
7+
<requirements>
8+
<public-access/>
9+
</requirements>
10+
</manifest>

0 commit comments

Comments
 (0)