Skip to content

Commit

Permalink
Merge branch 'main' into next-6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Jan 29, 2024
2 parents f2c4d61 + 9a2bdb7 commit e0556f7
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 62 deletions.
5 changes: 0 additions & 5 deletions .vscode/extensions.json

This file was deleted.

7 changes: 0 additions & 7 deletions .vscode/ltex.dictionary.en-US.txt

This file was deleted.

7 changes: 6 additions & 1 deletion .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,8 @@ sandboxed
sarven
scalability
scalable
ScalarValuesAware
ScalarValuesStorer
ScheduledTask
schemas
ScriptEventRegistry
Expand Down Expand Up @@ -1607,4 +1609,7 @@ NewRelic
OTEL
otel
otlp
grpc
grpc
B2B Component
B2B Suite
B2B Components
2 changes: 1 addition & 1 deletion guides/installation/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can use these commands to check your actual environment:
* ext-json
* ext-libxml
* ext-mbstring
* ext-openssl
* ext-openssl (there is an [issue](https://github.com/shopware/shopware/issues/3543) with OpenSSL 3.0.7)
* ext-pcre
* ext-pdo
* ext-pdo\_mysql
Expand Down
28 changes: 15 additions & 13 deletions guides/plugins/apps/clientside-to-app-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
nav:
title: Client-side communication to the app backend
position: 30

---

# Client-App backend communication

Direct communication from the browser to the app backend involves generating a JWT token. This token contains session-specific information, as [claims](#the-jwt-token), and is securely signed by the shop. This mechanism ensures a secure exchange of data between the client and the app backend.
Direct communication from the browser to the app backend involves generating a JSON Web Token (JWT).
This token contains session-specific information, as [claims](#the-json-web-token), and is securely signed by the shop.
This mechanism ensures a secure exchange of data between the client and the app backend.

::: warning
The JWT key can be only generated when in the browser the user is logged-in.
The JWT can be only generated when in the browser the user is logged-in.
:::

## The Flow
Expand All @@ -21,13 +22,13 @@ sequenceDiagram
participant Shopware Backend
participant App Server
Client->>Shopware Backend: POST /store-api/app-system/MyApp/generate-token
Shopware Backend->>Client: Responds with Signed JWT Token
Shopware Backend->>Client: Responds with signed JWT
Client->>App Server: Post /product-review/submit containing JWT in header
```

## The JWT token
## The JSON Web Token

The JWT token contains the following claims:
The JWT contains the following claims:

- `languageId` - the language ID of the current session
- `currencyId` - the currency ID of the current session
Expand All @@ -37,17 +38,17 @@ The JWT token contains the following claims:

The claims are only set when the app has permission to that specific entity like `sales_channel:read` for `salesChannelId` claim.

The JWT token is signed with `SHA256-HMAC` and the secret is the `appSecret` from the app registration and the `issued by` is the shopId also from the registration.
The JWT is signed with `SHA256-HMAC` and the secret is the `appSecret` from the app registration and the `issued by` is the shopId also from the registration.

## Generate JWT key
## Generate JSON Web Token

The JWT key is generated with a POST request against `/store-api/app-system/{name}/generate-token` or `/app-system/{name}/generate-token`.
The JWT is generated with a POST request against `/store-api/app-system/{name}/generate-token` or `/app-system/{name}/generate-token`.

<Tabs>

<Tab title="Storefront">

For the Storefront usage, there is an HTTP client helper, which handles the token generation and lets you directly call your app backend.
For the Storefront usage, there is a HTTP client helper, which handles the token generation and lets you directly call your app backend.

```javascript
import AppClient from 'src/service/app-client.service.ts';
Expand All @@ -68,7 +69,7 @@ client.delete('https://my-app-backend.com/foo')

<Tab title="Custom">

If you want to generate the JWT token yourself, you can use the following code snippet:
If you want to generate the JWT yourself, you can use the following code snippet:

```javascript
const response = await fetch('/store-api/app-system/{name}/generate-token', {
Expand All @@ -91,7 +92,7 @@ Requesting from the browser to the app backend is only possible when your app ba
- Access-Control-Allow-Headers: shopware-app-shop-id, shopware-app-token
:::

## Validate the JWT token
## Validate the JSON Web Token

<Tabs>

Expand Down Expand Up @@ -135,7 +136,8 @@ class StorefrontController {

<Tab title="Custom">

Fetch the shop by the `shopware-app-shop-id` header and create a JWT verifier with the app secret as `HMAC-SHA256` secret. Verify the JWT token (shopware-app-token) with the verifier.
Fetch the shop by the `shopware-app-shop-id` header and create a JWT verifier with the app secret as `HMAC-SHA256` secret.
Verify the JWT (shopware-app-token) with the verifier.

</Tab>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ Yet, we highly recommend you to create a custom `Entity` class, as well as a cus

The entity class itself is a simple key-value object, like a struct, which contains as many properties as fields in the definition, ignoring the ID field, which is handled by the `EntityIdTrait`.

::: warning
The properties of your entity class have to be at least `protected`, otherwise the data abstraction layer won't be able to set the values.
:::

```php
// <plugin root>/src/Core/Content/Example/ExampleEntity.php
<?php declare(strict_types=1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ We have created many Aware interfaces. These Aware are the conditions to restore
| Aware interface | Storer respective |
| :--- | :--- |
| Shopware\Core\Content\Flow\Dispatching\Aware\ScalarValuesAware | Shopware\Core\Content\Flow\Dispatching\Storer\ScalarValuesStorer |
| Shopware\Core\Content\Flow\Dispatching\Aware\ConfirmUrlAware | Shopware\Core\Content\Flow\Dispatching\Storer\ConfirmUrlStorer |
| Shopware\Core\Content\Flow\Dispatching\Aware\ContactFormDataAware | Shopware\Core\Content\Flow\Dispatching\Storer\ContactFormDataStorer |
| Shopware\Core\Content\Flow\Dispatching\Aware\ContentsAware | Shopware\Core\Content\Flow\Dispatching\Storer\ContentsStorer |
| Shopware\Core\Content\Flow\Dispatching\Aware\ContextTokenAware | Shopware\Core\Content\Flow\Dispatching\Storer\ContextTokenStorer |
| Shopware\Core\Content\Flow\Dispatching\Aware\CustomerGroupAware | Shopware\Core\Content\Flow\Dispatching\Storer\CustomerGroupStorer |
| Shopware\Core\Content\Flow\Dispatching\Aware\CustomerRecoveryAware | Shopware\Core\Content\Flow\Dispatching\Storer\CustomerRecoveryStorer |
| Shopware\Core\Framework\Event\CustomerAware | Shopware\Core\Content\Flow\Dispatching\Storer\CustomerStorer |
Expand Down
4 changes: 2 additions & 2 deletions guides/plugins/plugins/testing/end-to-end-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ composer run e2e:open
If you want to run the tests in CLI, please use the following command outside your container:

```bash
composer run e2e:admin:run
composer e2e:cypress -- run --spec="cypress/e2e/administration/**/*.cy.js"
```

or

```bash
composer run e2e:storefront:run
composer e2e:cypress -- run --spec="cypress/e2e/storefront/**/*.cy.js"
```

To see a complete overview on all psh scripts for e2e tests, feel free to refer to our [e2e command reference](../../../../resources/references/testing-reference/e2e-commands).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav:
---

## Introduction
A new "Customer-specific features" section on the Customer detail page allows the shop merchant to turn B2B features on or off for a specific customer. This section aims to provide each customer with their own set of specific features, granting them access to certain B2B components within the shop.
A new "Customer-specific features" section on the Customer detail page allows the shop merchant to turn B2B features on or off for a specific customer. This section aims to provide each customer with their own set of specific features, granting them access to certain B2B Components within the shop.

![Feature Toggles](../../../../assets/b2b-feature-toggles.png)

Expand All @@ -18,7 +18,7 @@ To achieve this, ACL (Access Control List) and address the following cases where
Considering these scenarios, we can ensure that the appropriate B2B features are displayed and accessible based on feature toggles and admin-granted permissions.

### Prerequisite
To improve organization and maintain a clear structure, it is advisable to relocate all B2B components into the `B2B` folder within the Commercial plugin. By doing so, you can centralize the B2B-related functionality, making it easier to locate, manage, and maintain the codebase. This folder structure promotes better separation of concerns and enhances the overall modularity of the application.
To improve organization and maintain a clear structure, it is advisable to relocate all B2B Components into the `B2B` folder within the Commercial plugin. By doing so, you can centralize the B2B-related functionality, making it easier to locate, manage, and maintain the codebase. This folder structure promotes better separation of concerns and enhances the overall modularity of the application.
```
├── src
│ ├── B2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ nav:

# Guides

The following articles will guide you how to create custom toggles via a plugin for b2b components (Customer-specific features).
The following articles will guide you how to create custom toggles via a plugin for B2B Components (Customer-specific features).
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ nav:

# Employee Management

A feature of the B2B components includes employee, role, and permission management. It is implemented into both Storefront and Administration and supports their respective APIs.
A feature of the B2B Components includes employee, role, and permission management. It is implemented into both Storefront and Administration and supports their respective APIs.

## Basic idea

Employee management, as one of the B2B components, is a feature that allows you to manage employees and their permissions as an extension to Shopware's account and customer management, but set into a company context. This means that employees are associated with a **company customer** and will act on behalf of that company, e.g., placing orders. Accordingly, employees can make use of addresses that have been defined by administrators of their company.
Employee management, as one of the B2B Components, is a feature that allows you to manage employees and their permissions as an extension to Shopware's account and customer management, but set into a company context. This means that employees are associated with a **company customer** and will act on behalf of that company, e.g., placing orders. Accordingly, employees can make use of addresses that have been defined by administrators of their company.

The **company customer** has the benefit of injecting company managed data into core processes without having to develop new employee processes from scratch or maintain multiple versions of these processes.

Expand Down
6 changes: 3 additions & 3 deletions products/extensions/b2b-components/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
nav:
title: B2B components
title: B2B Components
position: 30

---

# B2B components
# B2B Components

The B2B Components allow merchants to selectively choose and configure B2B capabilities according to their needs. They offer merchants the ability to craft a tailored B2B ecommerce experience for their business partners while also allowing agencies to fine-tune Shopware to meet specific requirements. This means that B2B components can be individually activated or deactivated for each business partner.
The B2B Components allow merchants to selectively choose and configure B2B capabilities according to their needs. They offer merchants the ability to craft a tailored B2B ecommerce experience for their business partners while also allowing agencies to fine-tune Shopware to meet specific requirements. This means that B2B Components can be individually activated or deactivated for each business partner.

In the world of digital B2B commerce, where businesses engage with other companies, we emphasize this vital distinction through these specific features :

Expand Down
7 changes: 4 additions & 3 deletions products/paas/build-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ To push your latest changes, run the following commands from your terminal:
```bash{3}
git add .
git commit -m "Applied new configuration"
git push -u platform main
git push -u shopware main
```

First, we stage all changes and then add them as a new commit. Then, we push them to our `platform` origin (remember, the one for our PaaS environment) on the `main` branch.
First, we stage all changes and then add them as a new commit. Then, we push them to our `shopware` origin (remember, the one for our PaaS environment) on the `main` branch.

This will trigger a new build with a subsequent deploy consisting of the following steps:

Expand All @@ -37,7 +37,7 @@ After both steps have been executed successfully (you will get extensive logging

## First deployment

The first time the site is deployed, Shopware's command line installer will run and initialize Shopware. It will not run again unless the `installer/installed` file is removed. **Do not remove that file unless you want the installer to run on the next deploy.**
The first time the site is deployed, Shopware's command line installer will run and initialize Shopware. It will not run again unless the `install.lock` file is removed. **Do not remove that file unless you want the installer to run on the next deploy.**

The installer will create an administrator account with the default credentials.

Expand Down Expand Up @@ -111,6 +111,7 @@ Sometimes, you might want to trigger a rebuild and deploy of your environment wi

```bash
shopware variable:create --environment main --level environment --prefix env --name REBUILD_DATE --value "$(date)" --visible-build true
```

To force a rebuild at any time, update the variable with a new value:

Expand Down
8 changes: 0 additions & 8 deletions products/paas/cli-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ To install PaaS CLI, run the following command:
curl -sfS https://cli.shopware.com/installer | php
```

## Add SSH key

For secure communication between your local machine and your PaaS environment, create an SSH key, add it to your Account using the below command and go through the steps provided.

```sh
shopware ssh-key:add
```

When you run the CLI for the first time, it will ask you to log in via your browser.

You can also generate an SSH key manually and add it in the **My profile > SSH Keys** section of your [PaaS Console](https://console.shopware.com/).
Expand Down
8 changes: 4 additions & 4 deletions products/paas/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ shopware project:set-remote 7xasjkyld189e # Replace with your project ID

## Conclusion

Now your repository is configured - you should have three remotes
Now your repository is configured - you should have two remotes

```sh
$ git remote -v

origin [email protected]:<project-repository>.git (fetch)
origin [email protected]:<project-repository>.git (push)
platform <paas-url>.git (fetch)
platform <paas-url>.git (push)
shopware <paas-url>.git (fetch)
shopware <paas-url>.git (push)
```

| Remote | Function | Description |
|------------|-------------------|-------------------------------------------------------------------------|
| `origin` | Project Code | This remote contains all your project specific source code |
| `platform` | PaaS Environment | Changes pushed to this remote will be synced with your PaaS environment |
| `shopware` | PaaS Environment | Changes pushed to this remote will be synced with your PaaS environment |

## Migrating from the old template to the new template

Expand Down
2 changes: 1 addition & 1 deletion products/paas/setup-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ If this is the first deployment, the following operations are performed:
* Setup script is executed
* Theme is set
* Secrets are generated
* `installer/installed` file is created
* `install.lock` file is created

You can also customize this script, however, make sure to keep operations to a minimum, as your store will not be exposed to web traffic during the execution. Connections made during the meantime will be queued in a suspended state and not necessarily fail but will take longer than usual (i.e., until the deployment has finished).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sw.ui.componentSection('sw-manufacturer-card-custom-fields__before').add({
#### Vue Devtools Plugin for finding the PositionIDs
It is impossible to create a list of all potential position IDs. And they would be hard to manage. To solve this problem we are writing a custom plugin for the Vue Devtools. This plugin will be available for Vue Devtools 6+. It makes identifying the position IDs very easy.

Just open the plugin in the Devtools (It is available directly when you open the Administration). Then you can see all positions at the current administration view which are available for extending. If you click at one position ID you get more information about it. Like the property in the Meteor-Admin-SDK so that you directly know what functionality this position has.
Just open the plugin in the Devtools (It is available directly when you open the Administration). Then you can see all positions at the current administration view which are available for extending. If you click at one position ID you get more information about it. Like the property in the Meteor-Extension-SDK so that you directly know what functionality this position has.

In summary: the Devtool plugin provides a visual way to see which parts can be extended and what are the positionIDs for the extension position.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can find the original version [here](https://github.com/shopware/shopware/bl
:::

## Context
* The package `@shopware-ag/meteor-admin-sdk` will be referred to as sdk
* The package `@shopware-ag/meteor-extension-sdk` will be referred to as sdk
* The ts/js implementation of the Administration is referred to as administration

Previously the administration held the implementation of the classes `Entity`, `EntityCollection` and `Criteria`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
title: Providing the admin extension SDK
date: 2022-06-15
area: administration
tags: [admin-extension-sdk, meteor-admin-sdk, vue]
tags: [meteor-extension-sdk, vue]
---

# Providing the admin extension SDK

::: warning
The Admin Extension SDK has been renamed to Meteor Admin SDK.
:::

::: info
This document represents an architecture decision record (ADR) and has been mirrored from the ADR section in our Shopware 6 repository.
You can find the original version [here](https://github.com/shopware/shopware/blob/trunk/adr/2022-06-27-providing-the-admin-extension-sdk.md)
:::

::: warning
The Admin Extension SDK has been renamed to Meteor Extension SDK.
:::

## Context
The Admin Extension SDK is a toolkit for plugin and app developers to extend or modify the administration via their plugins or apps. The SDK contains easy to use methods which interact with the administration in the background via the PostMessage API for iFrames.

Expand Down
4 changes: 2 additions & 2 deletions resources/references/testing-reference/e2e-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ nav:
| `composer run e2e:setup` | Prepares Shopware installation and environment for Cypress usage |
| `composer run e2e:open` | Opens Cypress' e2e tests runner |
| `composer run e2e:prepare` | Install dependencies and prepare database for Cypress usage |
| `composer run e2e:admin:run` | Runs Cypress' admin e2e tests in CLI |
| `composer run e2e:storefront:run` | Runs Cypress' storefront e2e tests in CLI |
| `composer e2e:cypress -- run --spec="cypress/e2e/administration/**/*.cy.js"` | Runs Cypress' admin e2e tests in CLI |
| `composer e2e:cypress -- run --spec="cypress/e2e/storefront/**/*.cy.js"` | Runs Cypress' storefront e2e tests in CLI |

0 comments on commit e0556f7

Please sign in to comment.