diff --git a/.github/workflows/update-readme-versions.yml b/.github/workflows/update-readme-versions.yml index 4a2a901..15fdb1e 100644 --- a/.github/workflows/update-readme-versions.yml +++ b/.github/workflows/update-readme-versions.yml @@ -1,16 +1,20 @@ -name: Sync README component versions +name: Sync component versions + +# Propagates the versions of the first entry of stack.yaml to the README, the documentation, and the reference +# Docker Compose deployment. See scripts/sync-stack-versions.py for the updated files. on: push: paths: - stack.yaml + - scripts/sync-stack-versions.py workflow_dispatch: permissions: contents: write jobs: - sync-readme-versions: + sync-versions: runs-on: ubuntu-latest steps: @@ -19,163 +23,20 @@ jobs: with: ref: ${{ github.ref_name }} - - name: Parse first stack entry - run: | - set -euo pipefail - - awk ' - function trim(s) { - sub(/^[[:space:]]+/, "", s) - sub(/[[:space:]]+$/, "", s) - if (length(s) >= 2 && substr(s, 1, 1) == "\"" && substr(s, length(s), 1) == "\"") { - s = substr(s, 2, length(s) - 2) - } - return s - } - - BEGIN { - in_stacks = 0 - in_first_item = 0 - first_item_indent = -1 - } - - { - line = $0 - - if (!in_stacks) { - if (line ~ /^[[:space:]]*stacks:[[:space:]]*$/) { - in_stacks = 1 - } - next - } - - if (!in_first_item) { - if (line ~ /^[[:space:]]*-[[:space:]]*/) { - in_first_item = 1 - first_item_indent = index(line, "-") - 1 - inline_content = line - sub(/^[[:space:]]*-[[:space:]]*/, "", inline_content) - - if (inline_content ~ /^[A-Za-z0-9_-]+[[:space:]]*:/) { - key = inline_content - sub(/:.*/, "", key) - key = trim(key) - value = inline_content - sub(/^[^:]*:[[:space:]]*/, "", value) - sub(/[[:space:]]+#.*/, "", value) - data[key] = trim(value) - } - } - next - } - - if (line ~ /^[[:space:]]*-[[:space:]]+/) { - current_indent = index(line, "-") - 1 - if (current_indent <= first_item_indent) { - exit - } - } - - if (line ~ /^[[:space:]]*[A-Za-z0-9_-]+[[:space:]]*:/) { - key = line - sub(/^[[:space:]]*/, "", key) - sub(/:.*/, "", key) - key = trim(key) - - value = line - sub(/^[[:space:]]*[^:]*:[[:space:]]*/, "", value) - sub(/[[:space:]]+#.*/, "", value) - data[key] = trim(value) - } - } - - END { - required_keys[1] = "id" - required_keys[2] = "front" - required_keys[3] = "proxy" - required_keys[4] = "charging" - required_keys[5] = "apis" - - for (i = 1; i <= 5; i++) { - key = required_keys[i] - if (!(key in data)) { - printf("Missing key in first stack entry: %s\n", key) > "/dev/stderr" - exit 1 - } - } - - print "STACK_ID=" data["id"] - print "FRONT_VERSION=" data["front"] - print "PROXY_VERSION=" data["proxy"] - print "CHARGING_VERSION=" data["charging"] - print "APIS_VERSION=" data["apis"] - } - ' stack.yaml >> "$GITHUB_ENV" - - - name: Update README block - run: | - set -euo pipefail - - grep -q '^$' README.md - grep -q '^$' README.md - - cat > /tmp/generated-stack-versions.md < 0) { - generated = generated line ORS - } - close("/tmp/generated-stack-versions.md") - } - - { - if ($0 == start) { - print $0 - printf "%s", generated - in_block = 1 - next - } - - if ($0 == end) { - print $0 - in_block = 0 - next - } - - if (!in_block) { - print $0 - } - } - ' README.md > README.md.tmp - - mv README.md.tmp README.md + - name: Update versions + run: python3 scripts/sync-stack-versions.py - name: Commit and push changes run: | set -euo pipefail - if git diff --quiet README.md; then - echo "README.md already up to date." + if git diff --quiet; then + echo "Versions already up to date." exit 0 fi git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add README.md + git add README.md doc docker/compose git commit -m "docs: sync component versions from stack.yaml" git push origin "${{ github.ref_name }}" diff --git a/README.md b/README.md index 30a59f4..fbdb7d8 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ functionality. In particular, the Business API Ecosystem is made of the following components: -- Reference implementations of TM Forum APIs. +- FIWARE implementation of the TM Forum APIs, backed by NGSI-LD. - [TMForum APIs](https://github.com/FIWARE/tmforum-api) @@ -60,14 +60,14 @@ In particular, the Business API Ecosystem is made of the following components: ### Component versions -The following versions are generated automatically from the first entry in [`stack.yaml`](stack.yaml) (`stacks[0]`, id `2026.10.20`): +The following versions are generated automatically from the first entry in [`stack.yaml`](stack.yaml) (`stacks[0]`, id `2026.12.01`): | Component | Stack key | Version | |---|---|---| -| Web frontend | `front` | `2.25.0` | -| Business Ecosystem Logic Proxy | `proxy` | `11.25.0` | -| Business Ecosystem Charging Backend | `charging` | `11.9.1` | -| TMForum APIs | `apis` | `1.15.1` | +| Web frontend | `front` | `3.0.0` | +| Business Ecosystem Logic Proxy | `proxy` | `12.0.0` | +| Business Ecosystem Charging Backend | `charging` | `12.0.0` | +| TMForum APIs | `apis` | `2.2.1` | Any feedback is highly welcome, including bugs, typos or things you think should @@ -80,9 +80,9 @@ or ### Description -The Business API Ecosystem is a joint component made up of the FIWARE Business -Framework and a set of APIs (and its reference implementations) provided by the -TMForum. This component allows the monetization of different kind of assets +The Business API Ecosystem combines the FIWARE Business Framework with +[FIWARE's implementation of the TM Forum APIs](https://github.com/FIWARE/tmforum-api). +This component allows the monetization of different kind of assets (both digital and physical) during the whole service life cycle, from offering creation to its charging, accounting and revenue settlement and sharing. The Business API Ecosystem exposes its complete functionality through TMForum @@ -102,10 +102,12 @@ You can install the software in two different ways: ## API -For further documentation, you can check the API Reference available at: - -- [Apiary](http://docs.fiwaretmfbizecosystem.apiary.io) -- [Github Pages](https://fiware-tmforum.github.io/Business-API-Ecosystem/) +The TM Forum API implementation and its OpenAPI specifications are maintained in +[FIWARE/tmforum-api](https://github.com/FIWARE/tmforum-api). The specifications are +organized by API under [`api/tm-forum/`](https://github.com/FIWARE/tmforum-api/tree/main/api/tm-forum). +Select the release matching the `apis` version in [`stack.yaml`](stack.yaml). +See the [Configuration Guide](doc/configuration-guide.md#configuring-the-tmf-apis) +for the API base paths and their connection to the Logic Proxy and Charging Backend. ## Testing @@ -121,9 +123,11 @@ repositories ## Advanced Topics -- [User Guide](doc/user-guide.rst) -- [Programmer Guide](doc/programmer-guide.rst) -- [Installation & Administration Guide](doc/installation-administration-guide.rst) +- [Administrator Guide](doc/admin-guide.md) +- [User Guide](doc/user-guide.md) +- [Data Space Integration Guide](doc/dataspace-guide.md) +- [Plugins Guide](doc/plugins-guide.md) +- [Installation & Administration Guide](doc/installation-administration-guide.md) You can also find this documentation on [ReadTheDocs](http://business-api-ecosystem.readthedocs.io) diff --git a/doc/admin-guide.md b/doc/admin-guide.md new file mode 100644 index 0000000..f0ae7f9 --- /dev/null +++ b/doc/admin-guide.md @@ -0,0 +1,437 @@ +# Administrator Guide + +This guide explains how marketplace administrators manage the Business API Ecosystem through the default **BAE theme** web interface. It covers the **Administration** area and the controls for publishing Blog, News & Events, and FAQ content. + +Installation, service connections, authentication providers, and deployment defaults are covered in the [Installation and Administration Guide](installation-administration-guide.md) and the [Configuration Guide](configuration-guide.md). Seller and customer workflows are covered in the [User Guide](user-guide.md). + +Instructions and screenshots use the BAE interface with example data: the provider organization *Atlas Cloud Services*, a default catalog named *BAE Marketplace*, and example plugins, categories, and contact addresses. + +(admin-access)= +## Accessing Administration + +To access Administration, you need an account with the marketplace administrator role and must use your personal session. After signing in, the initial session is on behalf of your organization, so first switch to your personal session: + +1. Sign in with your administrator account. +2. Open the user menu and select **Change session**. +3. Select your own username in the session list to switch from the organization session to your personal session. +4. Open the user menu again and select **Administration**. + +The marketplace administrator role name is configured by the deployment. + +![Change session list opened from an organization session, with the administrator's username at the end](images/admin/admin-personal-session.png) + +In the personal session, the user menu includes **Administration**: + +![User menu in the personal session with the Administration entry](images/admin/admin-user-menu.png) + +The Administration page is available at `/admin` on the frontend. On a large screen, its sections appear in the left menu. On a small screen, use the **Administration** dropdown. **Categories** opens by default. + +| Menu group | Section | Purpose | +| --- | --- | --- | +| Catalog | Default catalog | Create or update the marketplace's default catalog. | +| Catalog | Categories | Create and update the category hierarchy. | +| Catalog | Plugins | Install, upgrade, and remove service and resource plugins. Shown only to marketplace administrators. | +| Business | Verification | Attach a verifiable credential to a product specification. | +| Business | Revenue sharing | Open the operator revenue-sharing screen; see its current limitations below. | +| Config | Email | Configure outgoing email and contact-request recipients. | +| Config | Analytics | Configure analytics availability, dashboards, and guest-token access. | +| Config | Search | Configure the search engine connection and keyword format. | +| Config | Search & filters | Choose the primary category hierarchy and additional filters. | +| Config | Features | Enable or disable supported marketplace features. | + +Accounts with the configured **certifier** role can also enter Administration to use **Verification**. Managing marketplace settings and plugins requires the administrator role. + +![Administration page with the Catalog, Business, and Config menu groups and the Categories list](images/admin/admin-navigation.png) + +## Saving changes + +Opening a configuration section loads its current values. Edit the values and use that section's save button to apply your changes. Wait for the success message before leaving the section. + +The **Features**, **Search**, **Search & filters**, and **Analytics** settings are saved by the Logic Proxy. Saved feature, search, and analytics values take precedence over their corresponding deployment defaults and persist across proxy restarts. **Email** settings and **Plugins** are managed by the Charging Backend, and catalog and category changes update the catalog service. + +After saving, reload the marketplace to load the updated navigation, search behavior, and forms. Other users may also need to reload to see the changes. + +The [settings managed through Administration](configuration-guide.md#settings-managed-through-administration) section of the Configuration Guide identifies the related deployment variables and the settings that still require deployment configuration. + +(admin-default-catalog)= +## Default catalog + +The default catalog provides the category roots used by the marketplace. Configure it before creating the category hierarchy. It is distinct from the catalogs managed by individual sellers. + +1. Open **Administration → Default catalog**. +2. If a default catalog exists, the page displays its **Default catalog ID** and loads its name and description. Otherwise, it displays **No default catalog is currently configured**. +3. Enter a **Name**, up to 100 characters, and a **Description**. Both fields are required when creating the catalog. +4. Select **Save default catalog**. +5. Check that the success message and a default catalog ID are displayed. + +Saving creates the catalog when none is configured, or updates the configured catalog. + +![Default catalog page showing the default catalog ID, name, and description](images/admin/admin-default-catalog.png) + +Once a default catalog is configured, the marketplace home page and the **Categories** page show its root categories. Categories that are not part of the default catalog hierarchy are no longer listed there. + +(admin-categories)= +## Categories + +Categories organize the products and offerings that sellers publish. They can form a hierarchy of root categories and nested categories. The **Categories** page displays the hierarchy with category names, status, last update, and edit actions. + +With a default catalog configured, this page loads its associated category roots and their descendants. New root categories are associated with the default catalog. Nested categories are shown with their parent path, for example *Service categories / Security*. + +![Categories list with two root categories and their nested categories](images/admin/admin-categories.png) + +### Creating a category + +1. Open **Administration → Categories** and select **Add new category**. +2. In **General**, enter a **Name**, up to 100 characters. Optionally enter a **Description** using the Markdown editor. +3. To create a root category, leave **Choose a parent category** switched off. To create a nested category, switch it on and select its parent from the hierarchy. +4. Select **Next** and review the summary, including the selected parent where applicable. +5. Select **Create category**. The interface returns to the category list after a successful save. + +New categories are created with status **Active**. + +![New category form with a name, a Markdown description, and Service categories selected as the parent](images/admin/admin-category-create.png) + +![Category summary step before Create category is selected](images/admin/admin-category-create-summary.png) + +> **Note:** Avoid the `&` character in category names. The Logic Proxy checks whether the name already exists without URL-encoding it, so creating a category such as *Cloud & Infrastructure* fails with a server error. Use *and* instead. + +### Updating a category + +1. In **Categories**, select the edit action for the root or nested category. +2. Update its name, description, parent selection, or status. +3. Select **Next** to review the summary. +4. Select **Update category**. + +The editor supports **Active**, **Launched**, **Retired**, and **Obsolete** statuses. Retiring or marking a category obsolete can remove its association with the default catalog, so check the resulting browse hierarchy after saving. + +![Update category form with the status selector and the parent category selection](images/admin/admin-category-update.png) + +Category names also matter when configuring **Search & filters**: the primary root and category-based filter roots are looked up by their exact names. If you rename one of these roots, update the corresponding search configuration. + +(admin-plugins)= +## Plugins + +Plugins define the types of services and resources that sellers can register, together with their form fields and the processing performed when assets are created, activated, renewed, or terminated. Use **Administration → Plugins** to manage them from the browser. This section is visible only to accounts with the marketplace administrator role; the Charging Backend also rejects plugin operations from other accounts. + +How to develop plugin packages, and how to manage them from the command line, is described in the [Plugins Guide](plugins-guide.md). + +![Plugins page with the installation form and two installed plugins](images/admin/admin-plugins.png) + +### Installing or upgrading a plugin + +1. Open **Administration → Plugins**. +2. In **Plugin ZIP package**, choose a single, nonempty `.zip` package. +3. Select **Install plugin** and wait for the success message, *Installed successfully*. +4. Check that the plugin appears in **Installed plugins**. + +The plugin's `package.json` identifies it. Uploading a package for a plugin that is already installed upgrades it, but only if the package has a newer version; installing the same or an older version is rejected. An upgrade cannot change a plugin's type between service and resource. + +Once installed, the plugin is available immediately in the **Service type** or **Resource type** list of the matching specification form in **My Offerings**. + +The Charging Backend validates the package before installing it. It reports, for example, a package that is not a valid ZIP file, a manifest that fails validation, a version that is not newer than the installed one, or a package that exceeds the configured size limits. The upload limit is set by `BAE_CB_MAX_UPLOAD_SIZE`, and the expanded package limits by `BAE_CB_PLUGIN_EXPANDED_MAX_BYTES` and `BAE_CB_PLUGIN_ARCHIVE_MAX_ENTRIES`. + +If the interface reports that installation *may have completed* (for example, after a timeout), select **Refresh list** and check the installed version before trying again. + +### Installed plugins + +The **Installed plugins** table shows each plugin's name and ID, type (**Service** or **Resource**), version, author, and the catalog **Category ID** created for it. Select **Refresh list** to reload the table. + +### Removing a plugin + +1. Select **Delete plugin** in the plugin's row. +2. Confirm in the dialog. Deleting uninstalls the plugin and removes its category. + +![Delete plugin confirmation dialog](images/admin/admin-plugin-delete.png) + +A plugin cannot be removed while existing specifications reference it; the interface then reports that the plugin is in use. Only one plugin operation can run at a time, so a request made while another installation or removal is running is rejected and can be retried later. + +(admin-verification)= +## Verification + +Use **Verification** to attach a verifiable credential to a product specification. This action is available to marketplace administrators and authorized certifiers. + +1. Open **Administration → Verification**. +2. In **Product ID**, enter the **product specification ID**. +3. Paste the credential into **Verifiable Credential**. +4. Select **Add**. +5. After the interface returns to Categories, check the product specification to confirm the credential was attached. + +The credential is stored as the product specification's `Compliance:VC` characteristic. Uploading another credential replaces the previous value of that characteristic and preserves the other characteristics. + +![Verification form with a product specification ID and an example credential](images/admin/admin-verification.png) + +## Operator revenue sharing + +**Administration → Revenue sharing** opens **Operator revenue sharing**. The current screen displays a static summary with example data; it is not calculated from marketplace transactions. + +![Operator revenue sharing page with its static summary](images/admin/admin-revenue-sharing.png) + +Providers can view their revenue-sharing information through **Profile → Revenue sharing**, as described in the +[User Guide](user-guide.md#revenue-sharing-and-external-account-services). + +(admin-email)= +## Email + +Use **Administration → Email** to configure the SMTP connection for outgoing messages and the recipients of requests submitted through **Contact us**. + +| Field | Value to provide | +| --- | --- | +| SMTP Server | Hostname of the outgoing mail server. Required. | +| SMTP Port | Port supplied by the mail service administrator. Required. | +| Source email | Sender address for outgoing messages. Required. | +| Email User | Username used to authenticate to the SMTP server. Required. | +| Email Password | Password used to authenticate to the SMTP server. Required only for the first configuration. | +| General inquiries destination email | Recipient for general contact requests. Optional. | +| Technical support destination email | Recipient for technical support requests. Optional. | +| Onboarding support destination email | Recipient for onboarding requests. Optional. | +| Legal support destination email | Recipient for legal support requests. Optional. | + +![Email page with the SMTP settings, a stored password, the contact destinations, and the Test saved configuration and Save buttons](images/admin/admin-email.png) + +1. Open **Email** and wait for the current configuration to load. The form stays disabled while it loads. +2. Fill in the SMTP fields. The form checks the format of the email addresses. +3. Enter the SMTP password when configuring email for the first time. Once a password is stored, the field shows *Password configured*: leave it blank to keep the stored password, or enter a new one to replace it. The stored password is never sent back to the browser. +4. Enter the contact destinations you need. Clear a destination field to remove it. +5. Select **Save** and wait for **Email configuration updated successfully**. +6. Select **Test saved configuration**. + +**Test saved configuration** checks the connection, TLS negotiation, and authentication against the SMTP server using the saved settings, including any environment defaults, without sending an email. Save your changes before testing them. The result is one of the following: + +- *SMTP connection, TLS and authentication checks passed. No email was sent.* +- *SMTP connection, TLS or authentication failed.* Check the saved settings and that the server is reachable from the Charging Backend. +- *The SMTP test timed out.* +- *The saved email configuration is missing or invalid.* Save a complete configuration first. + +The test uses STARTTLS with certificate verification, so the SMTP server must offer STARTTLS and present a certificate trusted by the Charging Backend. + +The request's support type determines the destination address. To check delivery end to end, submit a contact request and confirm it reaches the appropriate recipient. + +(admin-analytics)= +## Analytics + +Use **Administration → Analytics** to control analytics availability and configure the dashboards displayed by the marketplace. Obtain the analytics URL, dashboard IDs, and guest-token path from the analytics service administrator. + +| Field | Purpose | +| --- | --- | +| Analytics enabled | Enables or disables the analytics integration. | +| Analytics URL | Base URL of the analytics service. | +| Business Insights Non-LEAR | Dashboard ID for the Non-LEAR Business Insights view. | +| Business Insights LEAR | Dashboard ID for the LEAR Business Insights view. | +| Usage Monitor | Dashboard ID for the Usage Monitor view. | +| Guest token path | Path used to request a Superset guest token. The form's default is `/api/v1/dome/guest_token/`. | + +The proxy selects the LEAR Business Insights dashboard for accounts with the configured organization administrator role, and the Non-LEAR dashboard otherwise. Usage Monitor requires the marketplace administrator role. + +1. Set **Analytics enabled** as required. +2. Enter **Analytics URL**, all three **Dashboard IDs**, and **Guest token path**. +3. Select **Save** and wait for the success message. +4. Reload the marketplace and open Analytics with an account authorized to view the intended dashboards. + +The URL, three IDs, and guest-token path are required when saving, including when **Analytics enabled** is off. Prepare the dashboards and access permissions in the analytics service before configuring the integration. + +### Using the analytics JSON editor + +The **Provide analytics JSON** box contains the current configuration. It offers two actions: + +- **Load JSON** copies the JSON values into the form for review. Select **Save** to apply the form values. +- **Save JSON** validates and saves the values in the JSON editor directly. + +For example, replace the illustrative URL and IDs below with values supplied for your deployment: + +```json +{ + "analyticsEnabled": true, + "analytics": "https://analytics.example.org", + "analyticsDashboards": { + "businessInsightsNonLear": "non-lear-dashboard-id", + "businessInsightsLear": "lear-dashboard-id", + "usageMonitor": "usage-dashboard-id" + }, + "analyticsSuperset": { + "guestTokenPath": "/api/v1/dome/guest_token/" + } +} +``` + +Use the JSON object shown above, with a Boolean `analyticsEnabled` value and non-empty strings for the other values. + +![Analytics page with the JSON editor, the availability switch, the analytics URL, the three dashboard IDs, and the guest-token path](images/admin/admin-analytics.png) + +(admin-search)= +## Search + +**Administration → Search** configures the external search engine connection. It is separate from **Search & filters**, which controls the category and filter choices presented to users. + +The [TMF Search Engine](https://github.com/SEAMWARE/tmf-search-engine) provides searches over indexed product offerings and catalogs. Its [API usage guide](https://github.com/SEAMWARE/tmf-search-engine/blob/main/doc/api-usage-guide.md) describes the search endpoints and filter behavior. + +1. In **Search engine URL**, enter the search service's base URL reachable by the Logic Proxy. +2. When using TMF Search Engine, leave **Use query keyword** switched off. The service receives keywords in the URL path. +3. Select **Save** and wait for the success message. +4. Reload the marketplace and check a keyword search. + +The keyword formats are: + +| Use query keyword | Product search request | Catalog search request | +| --- | --- | --- | +| Off | `/api/SearchProduct/` | `/api/SearchCatalog/` | +| On | `/api/SearchProduct?query=` | `/api/SearchCatalog?query=` | + +The proxy adds these paths to **Search engine URL**. Coordinate the keyword format with the search service administrator and run a keyword search after saving to verify the connection. + +An empty **Search engine URL** disables the external search integration. This also changes the search availability advertised to the frontend. + +![Search page with the search engine URL and the Use query keyword switch](images/admin/admin-search.png) + +(admin-search-filters)= +## Search & filters + +Use **Administration → Search & filters** to choose the marketplace's primary category hierarchy and additional search filters. Category-based settings can also expose choices in the offering form. + +### Primary categories + +Choose **Primary categories mode**: + +| Mode | Behavior | +| --- | --- | +| `catalogFirstLevel` | Uses the category roots supplied by the default catalog directly as the primary categories. Primary root name and additional filters are disabled. | +| `rooted` | Finds a root category by **Primary root name** and uses its immediate children as the primary categories. Additional filters can be configured. | + +For `rooted` mode, create the intended root and child categories first. Enter the exact root name in **Primary root name**; matching is case-sensitive. A root that cannot be found produces no primary category choices. + +> **Note:** Selecting `catalogFirstLevel` clears the primary root and additional filters from the form. Saving in this mode stores an empty filter list. Copy the current JSON first if you will need to restore a previous rooted configuration. + +### Additional filters + +In `rooted` mode, select **Add filter** and fill in the following fields: + +| Field | Purpose | +| --- | --- | +| Name | Required identifier sent with the filter. For a configured filter, use a name supported by the search service. | +| Label | Optional display label; the name is used when no label is supplied. | +| Source | `configured` for manually defined options, or `categoryRoot` for options from a category hierarchy. | +| Root name | For `categoryRoot`, the exact name of the root whose immediate children provide the options. | +| Offer form placement | For `categoryRoot`, where to show the filter in the offering form. | + +With source **configured**, use **Add option** to define each option's required **Option name** and optional **Option label**. Select **Remove** to remove an option, or **Remove filter** to remove the entire filter. The option name is the value sent to the search service; the label controls its presentation. Configured filters use a flat list of options. + +With source **categoryRoot**, define the options by creating child categories under the named root in **Categories**. Names must match the existing category roots exactly. + +Category-based filters match the categories attached to offerings. TMF Search Engine supports two ways to combine selected categories: **flat** matches any selected category; **grouped** matches any selection within a category root and requires a match across each selected root. For example, grouped filtering can combine a service category with a deployment model. The search service administrator configures this behavior using the same default catalog as the marketplace; see [Search engine integration](configuration-guide.md#search-engine-integration). + +Configured filters match additional indexed offering attributes. For example, a **Procurement type** filter can offer `online` and `tailored` options using the engine's supplied procurement mapper. Before adding a configured filter, agree its **Name** and option values with the search service administrator so they match the deployed filter definitions. The engine's [custom mapping guide](https://github.com/SEAMWARE/tmf-search-engine/blob/main/doc/custom-mapping-guide.md) explains how those definitions are configured. + +**Offer form placement** supports these values: + +| Value | Behavior | +| --- | --- | +| `none` | Does not add a dedicated field for this filter to the offering form. | +| `generalInfo` | Displays the category-based field in the offering form's General Info section. Only one filter can use this placement. | +| `categorySection` | Displays the category-based field in the offering form's Categories step. | + +Offer form placement applies only to `categoryRoot` filters. Changing a filter to `configured` resets its placement to `none`. Changing it to `categoryRoot` clears its manual options. + +Select **Save** to save the mode, root, and complete filter list together. Reload the marketplace and check the search choices and offering form. + +### Using the searchFilters JSON editor + +The **Provide searchFilters JSON** box contains the current configuration. **Load JSON** copies values into the form for review; select **Save** to apply the form values. **Save JSON** saves the values in the JSON editor directly. + +Paste only the search-filter configuration object, without wrapping it in a `searchFilters` property. For example: + +```json +{ + "primaryCategoriesMode": "rooted", + "primaryRootName": "Service categories", + "filters": [ + { + "name": "deploymentModel", + "label": "Deployment model", + "source": "categoryRoot", + "rootName": "Deployment models", + "offerFormPlacement": "categorySection" + }, + { + "name": "procurementType", + "label": "Procurement type", + "source": "configured", + "children": [ + { "name": "online", "label": "Online purchase" }, + { "name": "tailored", "label": "Tailored procurement" } + ] + } + ] +} +``` + +Before using this example, create **Service categories** and **Deployment models** as category roots. Have the search service administrator configure `procurementType` with the supplied `dome:map_procurement_type` mapper and index the offerings. The mapper assigns `tailored` when the offering's first price plan uses custom pricing, and `online` otherwise. + +![Search & filters page in rooted mode, with a categoryRoot filter and a configured filter with two options](images/admin/admin-search-filters.png) + +(admin-features)= +## Features + +Use **Administration → Features** to enable or disable the following marketplace capabilities. Each row includes the feature name, a description, its configuration key, and a switch. + +| Feature | Configuration key | Effect | +| --- | --- | --- | +| Quotes | `quotesEnabled` | Enables quote-request flows and quote pages. | +| Purchases | `purchaseEnabled` | Enables shopping-cart and checkout actions. | +| Tendering | `tenderingEnabled` | Enables tendering features. | +| Data space | `dataSpaceEnabled` | Enables data-space fields in organization and offering forms. | +| DSP | `dspEnabled` | Enables DSP-related dataspace contract and schema fields. | +| Catalog management | `catalogManagementEnabled` | Enables seller catalog list, creation, and update screens in My Offerings. | +| Launch validation | `launchValidationEnabled` | Enables launch-validation requests for offerings. | +| Tender dev actions | `tenderDevButtonsOpenCloseEnabled` | Enables the development controls for opening and closing tenders. | + +1. Open **Features** and review the current switches. +2. Turn each feature on or off as required. +3. Select **Save** and wait for **Features configuration saved successfully**. +4. Reload the marketplace and check the affected navigation or workflow. + +Configure the supporting service integrations before enabling their features. **Quotes** and **Tendering** require their corresponding service integrations. + +Saved switches override the corresponding environment defaults. To change a saved value, return to **Features**, change the switch, and save again. + +![Features page with the feature switches](images/admin/admin-features.png) + +(admin-content)= +## Managing Blog, News & Events, and FAQs + +Administrators manage public content from the corresponding public page. + +| Content | Frontend page | Create action | +| --- | --- | --- | +| Blog | `/blog` | Add a new entry | +| News & Events | `/news` | Add news/event | +| FAQs | `/faq` | Add FAQ | + +### Creating content + +1. Sign in as an administrator and open the relevant page. +2. Select its create action. This opens the entry editor with the relevant **Content type** selected. +3. For **Blog** or **News / Event**, enter a **Title**, review the generated **URL slug**, and enter the **Content**. +4. Optionally supply a featured image, meta description, excerpt, tags, author, and date. Tags are entered as a comma-separated list. Meta descriptions have a 160-character limit; excerpts have a 300-character limit. +5. For **FAQ**, enter the **Question** and **Answer** instead. The editor hides the article-specific fields. +6. Select **Create entry**. The interface returns to the corresponding public page after creation. + +Article slugs use lowercase letters, numbers, and hyphens and must be unique across the stored entries. Saving publishes the content on its corresponding public page. + +![Entry editor for a News / Event with title, slug, metadata, date, featured image, and Markdown content](images/admin/admin-content-create.png) + +![Entry editor for an FAQ, with only the Question and Answer fields](images/admin/admin-content-faq-create.png) + +### Editing and deleting content + +When you are signed in as an administrator, each entry on the public page shows an edit action (pencil) and a delete action (bin). The article detail page provides the same actions. + +![News & Events page with the edit and delete actions of an entry](images/admin/admin-content-news.png) + +![FAQ page with the edit and delete actions of a question](images/admin/admin-content-faq.png) + +To edit an entry, select its edit action. The editor loads the saved fields; change them and select **Update entry**. The interface returns to the public page after the update is saved. + +To delete an entry, select its delete action and confirm in the dialog. Deleting an entry cannot be undone. + +![Delete entry confirmation dialog](images/admin/admin-content-delete.png) + + diff --git a/doc/conf.py b/doc/conf.py index 40b01b0..eb12d13 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -4,9 +4,10 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -extensions = [] +extensions = ['myst_parser'] +myst_heading_anchors = 3 templates_path = ['/home/docs/checkouts/readthedocs.org/readthedocs/templates/sphinx', 'templates', '_templates', '.templates'] -source_suffix = ['.rst'] +source_suffix = {'.md': 'markdown'} master_doc = 'index' project = u'biz-ecosystem' copyright = u'2016' diff --git a/doc/configuration-guide.md b/doc/configuration-guide.md new file mode 100644 index 0000000..650dee9 --- /dev/null +++ b/doc/configuration-guide.md @@ -0,0 +1,1012 @@ +# Configuration Guide + +This guide explains the deployment configuration for the Business API Ecosystem components. Use the configuration +files and environment variables of each service to set its database connections, service endpoints, authentication, +and integration settings. The hostnames and URLs in the examples describe an illustrative deployment; replace them +with the addresses used by your environment. + +| Component | Configuration entry points | +| --- | --- | +| Logic Proxy | `config.js`, supported environment overrides, and configuration saved in MongoDB. | +| Charging Backend | `src/settings.py`, `src/services_settings.py`, supported environment overrides, and saved email configuration. | +| BAE Frontend | `src/environments/` and theme definitions at build time, and the proxy's `/config` response at startup. | +| TMF APIs | Micronaut `application.yaml` files, profiles, and environment overrides. | +| TMF Search Engine | Service environment variables and the settings described in its own configuration guide. | + +Marketplace administrators manage selected runtime settings through the web interface, as described in the +[Administrator Guide](admin-guide.md). For those settings, the deployment configuration only provides an **initial +default**: once a value is saved through Administration, the saved value is used and later changes to the environment +variable or configuration file have no effect. See [Settings managed through Administration](#settings-managed-through-administration). +In the tables of this guide, these variables are marked as *Default; managed in Administration*. + +Restart the affected service after changing its deployment files or environment variables. Rebuild the frontend after +changing its build-time environment; reload the browser after changing runtime settings. + +(settings-managed-through-administration)= +## Settings managed through Administration + +Some settings can be changed at runtime in **Administration**, as described in the [Administrator Guide](admin-guide.md). +The deployment configuration of these settings is only a default. The saved values are stored in MongoDB, survive +restarts, and take precedence over the deployment configuration: + +| Administration screen | Deployment default | How the saved value takes precedence | +| --- | --- | --- | +| Features | `BAE_LP_*_ENABLED` variables and `config.js`, see the table below. | Each switch is stored separately once saved. Saving the **Features** screen stores all of them, so after the first save the environment variables no longer change any feature. | +| Search | `BAE_LP_SEARCH_URL` (file default `http://host.docker.internal:8000`). **Use query keyword** has no deployment setting and defaults to off. | Once the screen is saved, the saved URL and keyword format replace the default. Saving an empty URL disables the search integration, regardless of the environment. | +| Analytics | `BAE_LP_ANALYTICS_ENABLED`, `BAE_LP_ANALYTICS_URL`, `BAE_LP_ANALYTICS_DASHBOARD_BUSINESS_INSIGHTS_NON_LEAR`, `BAE_LP_ANALYTICS_DASHBOARD_BUSINESS_INSIGHTS_LEAR`, `BAE_LP_ANALYTICS_DASHBOARD_USAGE_MONITOR`, and `BAE_LP_ANALYTICS_SUPERSET_GUEST_TOKEN_PATH`. | Once saved, the whole analytics configuration comes from the saved values; none of these variables is used any more. | +| Search & filters | None. The default is the `catalogFirstLevel` mode without additional filters. | Only configurable through Administration. | +| Default catalog | None. | Only configurable through Administration; the proxy stores the catalog ID. | +| Email | Charging Backend `BAE_CB_EMAIL_*` and `BAE_CB_NOTIFICATION_RECIPIENT_EMAIL*` variables, see [Email notifications](#email-notifications). | The variables are copied to the database the first time the email configuration is used, and are ignored afterwards. | + +The feature switches and their deployment defaults are: + +| Feature | Configuration key | Environment variable | Default | +| --- | --- | --- | --- | +| Quotes | `quotesEnabled` | `BAE_LP_QUOTE_ENABLED` | `true` | +| Purchases | `purchaseEnabled` | `BAE_LP_PURCHASE_ENABLED` | `true` | +| Tendering | `tenderingEnabled` | `BAE_LP_TENDERING_ENABLED` | `true` | +| Data space | `dataSpaceEnabled` | `BAE_LP_DATASPACE_ENABLED` | `true` | +| DSP | `dspEnabled` | `BAE_LP_DSP_ENABLED` | `false` | +| Catalog management | `catalogManagementEnabled` | `BAE_LP_CATALOG_MANAGEMENT_ENABLED` | `true` | +| Launch validation | `launchValidationEnabled` | `BAE_LP_LAUNCH_VALIDATION_ENABLED` | `false` | +| Tender dev actions | `tenderDevButtonsOpenCloseEnabled` | `BAE_LP_TENDER_DEV_BUTTON_ENABLED` | `false` | + +The values are `true` or `false`. A variable that is not set keeps the default of the table, or the value set in +`config.js`. + +There is no reset action in Administration. To return a setting to deployment control, delete the saved document +from the proxy's MongoDB `config` collection (documents with `id` `feature-flags`, `search`, or `analytics`), or the +saved email configuration from the Charging Backend database, and restart the service. + +Database connections, API endpoints, authentication providers, role mappings, service credentials, and other settings +without an Administration control remain deployment configuration. Enabling a feature in the interface does not +configure its supporting service connection or credentials. + +### Search engine integration + +The Logic Proxy integrates with [TMF Search Engine](https://github.com/SEAMWARE/tmf-search-engine), which indexes TMF +resources in Elasticsearch and provides product-offering and catalog searches. Save its base URL through +**Administration → Search**. `BAE_LP_SEARCH_URL` is only the *default; managed in Administration*: it is used until the +Search screen is saved for the first time. With this service, leave **Use query keyword** switched off so the +proxy sends keywords through `/api/SearchProduct/` and `/api/SearchCatalog/`. + +Coordinate the marketplace's **Search & filters** settings with the following variables in the search engine deployment: + +| Search engine variable | Relationship to marketplace filters | +| --- | --- | +| `CATEGORY_FILTER_MODE` | `flat` combines all selected categories with OR. `grouped` combines values within the same category root with OR, and combines different roots with AND. | +| `TMF_DEFAULT_CATALOG_ID` | In grouped mode, set this to the default catalog ID displayed in **Administration → Default catalog**. The engine builds its category groups from this catalog's root categories and descendants. | +| `EXTRA_SEARCH_FILTERS` | Defines additional filter names and the mappers used to index their values. Match each configured frontend filter's **Name** to the corresponding engine definition. | + +The engine rebuilds the category-group lookup during indexing. When changing the category hierarchy, allow the indexer +to refresh it before checking the resulting grouped searches. Primary category selection in the frontend and category +combination in the search engine are configured independently: `catalogFirstLevel`/`rooted` controls the displayed +hierarchy, while `flat`/`grouped` controls how selected category values are combined. + +For example, the configured **Procurement type** filter in the Administrator Guide uses this search engine definition: + +```json +[ + { + "name": "procurementType", + "mapper": "dome:map_procurement_type" + } +] +``` + +Include this entry in the search engine's `EXTRA_SEARCH_FILTERS` array. Its mapper derives `online` or `tailored` from +the offering's first price plan. After changing the filter definitions, run a full reindex as described in the engine's +[configuration guide](https://github.com/SEAMWARE/tmf-search-engine/blob/main/doc/configuration-guide.md). +The [custom mapping guide](https://github.com/SEAMWARE/tmf-search-engine/blob/main/doc/custom-mapping-guide.md) covers +the supplied mappers and additional deployment-specific filters. + +## Configuring the Charging Backend + +The [Charging Backend](https://github.com/FIWARE-TMForum/business-ecosystem-charging-backend) reads its deployment +settings from `src/settings.py`, which imports service URLs from `src/services_settings.py`. Supported environment +variables override the corresponding file values. Configure these variables in the Charging Backend process or container. + +Boolean environment settings in this component use the case-sensitive strings `True` and `False`. For example: + +```bash +export BAE_CB_PROPAGATE_TOKEN=True +export BAE_CB_VERIFY_REQUESTS=True +``` + +### Service endpoints + +Provide the complete API base URL for each service, including its deployed base path. The backend appends resource paths +such as `/productOffering`, `/organization`, or `/customerBill` to these URLs. + +| Setting | Environment variable | Service | +| --- | --- | --- | +| `SITE` | `BAE_SERVICE_HOST` | Public marketplace URL, used for generated links and payment return URLs. | +| `LOCAL_SITE` | `BAE_CB_LOCAL_SITE` | Charging Backend base URL, used in generated service references. | +| `CATALOG` | `BAE_CB_CATALOG` | Product Catalog Management API. | +| `PARTY` | `BAE_CB_PARTY` | Party Management API. | +| `RESOURCE_CATALOG` | `BAE_CB_RESOURCE_CATALOG` | Resource Catalog API. | +| `SERVICE_CATALOG` | `BAE_CB_SERVICE_CATALOG` | Service Catalog API. | +| `INVENTORY` | `BAE_CB_INVENTORY` | Product Inventory API. | +| `RESOURCE_INVENTORY` | `BAE_CB_RESOURCE_INVENTORY` | Resource Inventory API. | +| `SERVICE_INVENTORY` | `BAE_CB_SERVICE_INVENTORY` | Service Inventory API. | +| `ORDERING` | `BAE_CB_ORDERING` | Product Ordering Management API. | +| `ACCOUNT` | `BAE_CB_BILLING` | Account Management API, including billing accounts. | +| `BILLING` | `BAE_CB_CUSTOMER_BILL` | Customer Bill Management API. | +| `USAGE` | `BAE_CB_USAGE` | Usage Management API. | +| `AUTHORIZE_SERVICE` | `BAE_CB_AUTHORIZE_SERVICE` | Complete Logic Proxy usage-authorization endpoint. | +| `DOME_BILLING_URL` | `BAE_CB_DOME_BILLING_URL` | External DOME billing engine URL when using that billing mode. | +| - | `BAE_CB_VAT_URL` | Endpoint of the European Commission's Taxes in Europe Database (TEDB) VAT service, used to get the standard VAT rate of the customer's country when calculating prices. Default: `https://ec.europa.eu/taxation_customs/tedb/ws/`. Change it only to use a mirror or a test service. | + +For example, with the all-in-one TMF API service reachable at `http://tmf:8632`: + +```bash +export BAE_SERVICE_HOST=https://marketplace.example.org/ +export BAE_CB_LOCAL_SITE=http://charging:8006/ +export BAE_CB_CATALOG=http://tmf:8632/tmf-api/productCatalogManagement/v4 +export BAE_CB_PARTY=http://tmf:8632/tmf-api/party/v4 +export BAE_CB_INVENTORY=http://tmf:8632/tmf-api/productInventory/v4 +export BAE_CB_ORDERING=http://tmf:8632/tmf-api/productOrderingManagement/v4 +export BAE_CB_BILLING=http://tmf:8632/tmf-api/accountManagement/v4 +export BAE_CB_CUSTOMER_BILL=http://tmf:8632/tmf-api/customerBillManagement/v4 +export BAE_CB_AUTHORIZE_SERVICE=https://marketplace.example.org/authorizeService/apiKeys +``` + +Use the corresponding individual service URL when deploying the TMF modules separately. Keep these URLs consistent with +[the API base paths](#configuring-the-tmf-apis) and the Logic Proxy endpoint configuration. + +### MongoDB + +The backend uses Django's `djongo` database engine. Its file configuration has this structure: + +```python +DATABASES = { + "default": { + "ENGINE": "djongo", + "NAME": "wstore_db", + "ENFORCE_SCHEMA": False, + "CLIENT": { + "host": "localhost" + } + } +} +``` + +| Environment variable | Purpose | +| --- | --- | +| `BAE_CB_MONGO_SERVER` | MongoDB host. The file default is `localhost`. | +| `BAE_CB_MONGO_PORT` | MongoDB port, converted to an integer. MongoDB's default port is `27017`. | +| `BAE_CB_MONGO_DB` | Database name. The file default is `wstore_db`. | +| `BAE_CB_MONGO_USER` | Optional database username. When provided, the backend sets `authSource` to the configured database name. | +| `BAE_CB_MONGO_PASS` | Database password. | +| `BAE_CB_MONGO_AUTH_MECHANISM` | Optional authentication mechanism passed to the MongoDB client. | + +```bash +export BAE_CB_MONGO_SERVER=mongo +export BAE_CB_MONGO_PORT=27017 +export BAE_CB_MONGO_DB=charging_db +export BAE_CB_MONGO_USER=charging +export BAE_CB_MONGO_PASS='' +``` + +### Roles and operator identity + +Use the same identity-provider role names in the Charging Backend and Logic Proxy. + +| Setting in `settings.py` | Default | Environment variable | +| --- | --- | --- | +| `ADMIN_ROLE` | `admin` | `BAE_LP_OAUTH2_ADMIN_ROLE` | +| `PROVIDER_ROLE` | `Seller` | `BAE_LP_OAUTH2_SELLER_ROLE` | +| `CUSTOMER_ROLE` | `Buyer` | `BAE_LP_OAUTH2_CUSTOMER_ROLE` | +| `OPERATOR_ID` | Empty | `BAE_CB_OPERATOR_ID` | +| `RELATED_PARTY_SCHEMA_LOCATION` | Supplied related-party extension schema URL | `BAE_CB_RELATED_PARTY_SCHEMA_LOCATION` | + +`SELLER_OPERATOR_ROLE` and `BUYER_OPERATOR_ROLE` are file settings, with defaults `SellerOperator` and `BuyerOperator`. +Set the operator ID to the identifier used by the marketplace operator's party record, and align it with +`BAE_LP_OPERATOR_ID` in the proxy. + +### Billing engine and scheduled tasks + +`BAE_CB_BILLING_ENGINE` selects the billing implementation: + +| Value | Behavior | +| --- | --- | +| `local` | Calculates and manages billing within the Charging Backend. This is the `BILLING_ENGINE` setting's default. | +| `dome` | Uses the DOME billing integration at `BAE_CB_DOME_BILLING_URL`. | + +For local billing, set the variable explicitly so the Docker entrypoint also registers and starts the billing cron jobs: + +```bash +export BAE_CB_BILLING_ENGINE=local +``` + +`CRONJOBS` in `settings.py` defines the schedule. With local billing selected, the supplied jobs are: + +| Management command | Scheduled times | +| --- | --- | +| `accounting_scheduler` | 00:00 daily. | +| `billing_scheduler` | 22:00, 01:00, and 05:00 daily. | +| `payment_scheduler` | 23:00 and 06:00 daily. | +| `retry_pending_terminations` | 03:00 daily. | + +Times follow the cron service's timezone. The accounting scheduler collects usage from plugins with pull accounting (see +the [Plugins Guide](plugins-guide.md#usage-accounting)); it returns immediately when no such plugin is installed. The +billing scheduler creates bills for completed billing periods; the payment scheduler processes bills awaiting payment. +The termination job retries pending product terminations. With the `dome` billing mode, the supplied `CRONJOBS` list +contains the termination job only. + +When the automatic payment of a recurring bill fails, the payment scheduler keeps retrying it during a grace period. +If the bill is still unpaid when the period ends, the product is terminated and the bill is closed. + +| Environment variable | Purpose | Default | +| --- | --- | --- | +| `BAE_CB_PAYMENT_RECOVERY_GRACE_HOURS` | Hours since the first failed payment attempt before the product is terminated. Use a positive value shorter than the billing cycle of the subscriptions. | `72` | +| `BAE_CB_WEBHOOK_DEDUP_WINDOW` | Seconds a processed CustomerBill notification is remembered to ignore duplicate deliveries. The TM Forum API sends one notification per registered listener; a duplicate received after the window is processed again. | `3600` | + +For a source installation, register the selected schedule from `src/` and run a cron service: + +```bash +python3 manage.py crontab add +python3 manage.py crontab show +``` + +After changing `CRONJOBS`, replace the registered schedule: + +```bash +python3 manage.py crontab remove +python3 manage.py crontab add +``` + +The optional HTTP scheduler endpoints for testing are enabled with `BAE_CB_BILLING_BY_HTTP_TEST_ENABLED=True`. + +### Payment providers + +`BAE_CB_PAYMENT_METHOD` selects a payment client independently of the billing engine. The file default is `dpas`. + +| Value | Provider configuration | +| --- | --- | +| `dpas` | `BAE_CB_DPAS_CLIENT_API_URL` supplies the payment-start endpoint; `DPAS_KEY` supplies the key used to verify payment-provider tokens. | +| `paypal` | `BAE_CB_PAYPAL_CLIENT_ID` and `BAE_CB_PAYPAL_CLIENT_SECRET` supply the application credentials. | +| `stripe` | `BAE_CB_STRIPE_API_KEY` supplies the Stripe API key. | +| `redsys` | `BAE_CB_REDSYS_MERCHANT_CODE`, `BAE_CB_REDSYS_TERMINAL`, `BAE_CB_REDSYS_SECRET_KEY`, `BAE_CB_REDSYS_URL`, and `BAE_CB_REDSYS_QUERY_URL` configure the merchant and payment/query endpoints. | +| `None` | Selects the base payment client for deployments with payment processing disconnected, such as development environments. Use the literal string `None`. | + +For example: + +```bash +export BAE_CB_PAYMENT_METHOD=paypal +export BAE_CB_PAYPAL_CLIENT_ID='' +export BAE_CB_PAYPAL_CLIENT_SECRET='' +``` + +The PayPal client's `MODE` constant in `src/wstore/charging_engine/payment_client/paypal_client.py` selects `sandbox` or +`live`. Its supplied value is `sandbox`. Stripe test integrations can additionally use `BAE_CB_STRIPE_TEST_API_BASE` +to direct requests to a test API endpoint. + +(email-notifications)= +### Email notifications + +The SMTP connection and the Contact us destination addresses are managed in +[Administration → Email](admin-guide.md#admin-email). The Charging Backend stores them in its database, and the +notification sender uses SMTP with STARTTLS and authentication. + +The following variables are *defaults; managed in Administration*. The first time the email configuration is used (when +a notification is sent or the Email screen is opened), the Charging Backend copies them to the database. From then on, +the saved configuration is used and these variables are ignored; change the values in Administration instead. + +| Environment variable | Email screen field | File default | +| --- | --- | --- | +| `BAE_CB_EMAIL_SMTP_SERVER` | SMTP Server | `wstore_smtp_server` | +| `BAE_CB_EMAIL_SMTP_PORT` | SMTP Port | `587` | +| `BAE_CB_EMAIL` | Source email | `wstore@email.com` | +| `BAE_CB_EMAIL_USER` | Email User | `email_user` | +| `BAE_CB_EMAIL_PASS` | Email Password | `wstore_email_passwd` | +| `BAE_CB_NOTIFICATION_RECIPIENT_EMAIL_GENERAL` | General inquiries destination email | Empty | +| `BAE_CB_NOTIFICATION_RECIPIENT_EMAIL_TECHNICAL` | Technical support destination email | Empty | +| `BAE_CB_NOTIFICATION_RECIPIENT_EMAIL_ONBOARDING` | Onboarding support destination email | Empty | +| `BAE_CB_NOTIFICATION_RECIPIENT_EMAIL_LEGAL` | Legal support destination email | Empty | +| `BAE_CB_NOTIFICATION_RECIPIENT_EMAIL` | Fallback for any destination above that is not set | Empty | + +The file defaults of the SMTP settings are placeholders. Unless the variables are set before the first use, the +placeholders are saved and must be replaced in **Administration → Email**. + +`BAE_CB_EMAIL` is also sent as the sender identity (`X-Email` header) in the requests of the payout and reporting +integrations; that use always follows the variable. + +### Charging periods and currencies + +Edit `CURRENCY_CODES` and `CHARGE_PERIODS` in `src/settings.py` to define the available currencies and charging periods. +Currencies are `(code, name)` pairs, for example `('EUR', 'Euro')`. The supplied period keys and durations are: + +| Period key | Days | +| --- | --- | +| `day` | 1 | +| `week` | 7 | +| `month` | 30 | +| `quarter` | 90 | +| `year` | 365 | +| `quinquennial` | 1825 | + +### Tokens and asset storage + +| Setting or environment variable | Purpose | +| --- | --- | +| `BAE_CB_PROPAGATE_TOKEN` | Whether the backend expects the user access token to be propagated from the proxy. Default: `True`. Align it with the proxy's token-propagation setting. | +| `BAE_CB_VERIFY_REQUESTS` | Certificate verification for outgoing requests that use this setting. Default: `True`. | +| `BAE_CB_MAX_UPLOAD_SIZE` | Maximum in-memory request size in bytes. Default: `52428800` (50 MiB). | +| `AWS_ENABLED` | Enables S3 asset storage with the value `True`. | +| `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` | Credentials for S3 asset storage. | +| `BUCKET_NAME` | S3 bucket used for assets. | +| `ACL_ENABLED` | Enables the configured S3 object ACL behavior with the value `True`. | +| `BAE_CB_PLUGIN_EXPANDED_MAX_BYTES` | Maximum total size of the extracted files of a plugin package. Default: `104857600` (100 MiB). | +| `BAE_CB_PLUGIN_ARCHIVE_MAX_ENTRIES` | Maximum number of entries in a plugin package. Default: `1000`. | +| `LOGLEVEL` | Log level of the Gunicorn server started by the Docker image, such as `debug`, `info`, or `warning`. Default: `info`. | + +The frontend has its own upload-size setting, `MAX_FILE_SIZE`. Configure both limits for the files the deployment accepts. + +## Configuring the Logic Proxy + +The [Logic Proxy](https://github.com/FIWARE-TMForum/business-ecosystem-logic-proxy) reads `config.js` from the repository +root. Supported environment variables override the file settings at startup. Settings saved through Administration are +loaded from MongoDB as described [above](#settings-managed-through-administration). + +Most Boolean environment switches in the proxy use lowercase `true` and `false`. + +### Listening address and public URL + +| Setting | Environment variable | Purpose | +| --- | --- | --- | +| `config.host` | `BAE_LP_HOST` | Proxy host used in generated internal URLs. The server listens on `config.port`. | +| `config.port` | `BAE_LP_PORT` | HTTP port; the supplied configuration uses `8004`. | +| `config.proxy` | `BAE_SERVICE_HOST` | Public origin, including scheme, host, and optional port, used when the proxy is reached through an ingress or reverse proxy. | +| `config.externalPortal` | `BAE_LP_EXTERNAL_PORTAL` | Public frontend URL, used for the OAuth2 login return to `/dashboard`. | +| `config.corsExposeRedirect` | `BAE_LP_CORS_EXPOSE_REDIRECT` | Exposes the redirect response header when set to `true`. | + +```bash +export BAE_LP_HOST=proxy +export BAE_LP_PORT=8004 +export BAE_SERVICE_HOST=https://marketplace.example.org/ +export BAE_LP_EXTERNAL_PORTAL=https://marketplace.example.org +``` + +`config.proxyPrefix`, `config.portalPrefix`, `config.logInPath`, and `config.logOutPath` are configured in `config.js`. +The supplied prefixes are empty, and the login/logout paths are `/login` and `/logOut`. + +Set `config.sessionSecret` in `config.js` to the session secret for the deployment; the supplied value is a +development placeholder. + +For native HTTPS, set `BAE_LP_HTTPS_ENABLED=true` and provide the TLS files: + +```bash +export BAE_LP_HTTPS_ENABLED=true +export BAE_LP_HTTPS_CERT=/certs/server.crt +export BAE_LP_HTTPS_KEY=/certs/server.key +export BAE_LP_HTTPS_CA=/certs/ca.crt +export BAE_LP_HTTPS_PORT=443 +``` + +When TLS is terminated by an ingress and the proxy serves HTTP internally, keep `config.https.enabled=false` in the file +and leave `BAE_LP_HTTPS_ENABLED` unset. + +### MongoDB and persisted configuration + +The proxy uses MongoDB for its application data and persisted configuration, including the default catalog, feature +switches, search settings, analytics settings, and feedback. Configure its database connection with: + +| Environment variable | `config.mongoDb` property | +| --- | --- | +| `BAE_LP_MONGO_SERVER` | `server` | +| `BAE_LP_MONGO_PORT` | `port` | +| `BAE_LP_MONGO_DB` | `db` | +| `BAE_LP_MONGO_USER` | `user` | +| `BAE_LP_MONGO_PASS` | `password` | + +```bash +export BAE_LP_MONGO_SERVER=mongo +export BAE_LP_MONGO_PORT=27017 +export BAE_LP_MONGO_DB=belp +export BAE_LP_MONGO_USER=proxy +export BAE_LP_MONGO_PASS='' +``` + +For authenticated connections, the proxy uses the configured database as the MongoDB authentication source. The search +engine's Elasticsearch connection is configured in the search engine service. + +### Backend API endpoints + +Each `config.endpoints` entry has a public `path`, a backend `apiPath`, `host`, `port`, and `appSsl` flag. + +- `path` is the alias exposed by the proxy, such as `catalog`. +- `apiPath` is the base path on the target backend, such as `/tmf-api/productCatalogManagement/v4`. +- `host` and `port` identify the target service. +- `appSsl` selects HTTPS for that backend connection. + +For example: + +```javascript +config.endpoints.catalog = { + path: 'catalog', + apiPath: '/tmf-api/productCatalogManagement/v4', + host: 'tmf', + port: '8632', + appSsl: false +}; +``` + +This maps `/catalog/productOffering` at the proxy to +`http://tmf:8632/tmf-api/productCatalogManagement/v4/productOffering`. + +The environment pattern is: + +```bash +export BAE_LP_ENDPOINT_CATALOG_PATH=/tmf-api/productCatalogManagement/v4 +export BAE_LP_ENDPOINT_CATALOG_HOST=tmf +export BAE_LP_ENDPOINT_CATALOG_PORT=8632 +export BAE_LP_ENDPOINT_CATALOG_SECURED=false +``` + +`_PATH` sets the backend `apiPath`. Set the public alias through the entry's `path` property in `config.js`. + +| `config.endpoints` key | Supplied public alias | Environment group used after `BAE_LP_ENDPOINT_` | +| --- | --- | --- | +| `catalog` | `catalog` | `CATALOG` | +| `resource` | `resource` | `RESOURCE` | +| `service` | `service` | `SERVICE` | +| `ordering` | `ordering` | `ORDERING` | +| `inventory` | `inventory` | `INVENTORY` | +| `resourceInventory` | `resourceInventory` | `RESOURCE_INVENTORY` | +| `serviceInventory` | `serviceInventory` | `SERVICE_INVENTORY` | +| `party` | `party` | `PARTY` | +| `account` | `account` | `BILLING` | +| `billing` | `billing` | `CUSTOMER_BILL` | +| `customer` | `customer` | `CUSTOMER` | +| `usage` | `usage` | `USAGE` | +| `charging` | `charging` | `CHARGING` | +| `rss` | `rss` | `RSS` | +| `quote` | `quote` | `QUOTE` | +| `document` | `document` | `DOCUMENT` | +| `revenue` | `revenue` | `REVENUE` | +| `invoicing` | `invoicing` | `INVOICING` | +| `search` | `search-bck` | `SEARCH` | + +Most entries point to the TMF APIs. The others are: + +| `config.endpoints` key | Target | +| --- | --- | +| `charging` | The Charging Backend. | +| `rss` | The revenue sharing models API of the Charging Backend. The proxy sends `/rss` requests to this host and port, rewriting the path to `/charging`, so set the group to the Charging Backend's host and port. It is not related to the former Revenue Sharing Service component, which is no longer used. | +| `revenue` | The external revenue engine that provides the revenue sharing dashboards shown in **Profile → Revenue sharing**. | +| `quote` | The Quote Management service. | +| `search` | The TMF Search Engine backend, used for organization searches. | + +Each group supports `_PATH`, `_HOST`, `_PORT`, and `_SECURED`. Backend hostnames and ports must be reachable from the +proxy process. Configure Charging Backend service URLs to reach the corresponding services from its own process. + +### Portal links and integrations + +The following deployment settings are returned to the frontend or used to connect marketplace workflows to other services. + +| Environment variable | Purpose | +| --- | --- | +| `BAE_LP_DOME_TRUST` | Trust/certification information link. | +| `BAE_LP_DOME_ABOUT` | About link. | +| `BAE_LP_DOME_REGISTER` | Provider registration link. | +| `BAE_LP_DOME_REGISTER_CUSTOMER` | Customer registration link. | +| `BAE_LP_DOME_PUBLISH` | Publishing information link. | +| `BAE_LP_DOME_REGISTRATION_FORM` | Registration form URL. | +| `BAE_LP_DOME_ONBOARDING_GUIDELINES` | Onboarding guide URL. | +| `BAE_LP_DOME_GUIDELINES` | General marketplace guidelines URL. | +| `BAE_LP_KNOWLEDGE_BASE_URL` | Knowledge-base URL. | +| `BAE_LP_TICKETING_URL` | Ticketing-system URL. | +| `BAE_LP_CHAT_URL` | Chat service URL. | +| `BAE_LP_MATOMO_ID`, `BAE_LP_MATOMO_URL` | Matomo site ID and tracker URL. | +| `BAE_LP_GOOGLE_TAG_MANAGER_ID` | Google Tag Manager container ID. | +| `BAE_LP_QUOTE_API` | Quote integration URL. | +| `BAE_LP_LEAR_URL` | LEAR integration URL. | +| `BAE_LP_COMPLIANCE_SERVER_URL` | Compliance service URL. | +| `BAE_LP_BILLING_ENGINE_URL` | Billing preview URL used by the proxy. | +| `BAE_LP_PAYMENT_GATEWAY` | Payment gateway link returned to the frontend. | +| `BAE_LP_PAYMENT_PROVIDER` | Payment-provider selection used by the proxy. | +| `BAE_LP_CONTACT_US_NOTIFICATION_URL` | Complete Charging Backend endpoint used to deliver Contact us notifications. | +| `BAE_LP_OPERATOR_ID` | Marketplace operator's party identifier. | +| `BAE_LP_PARTY_LOCATION` | Related-party extension schema URL. | +| `BAE_LP_PRICE_COMP_SCHEMA` | Price-component extension schema URL. | +| `BAE_LP_OFFERING_SCHEMA` | Offering extension schema URL. | + +Without an explicit contact-notification URL, the proxy constructs the target from its Charging Backend endpoint and +`/charging/api/orderManagement/notify/configured`. + +`BAE_LP_REVENUE_MODEL` sets the default operator revenue percentage, `BAE_LP_TAX_RATE` sets the tax percentage, and +`BAE_LP_USAGE_CHART` supplies the usage-chart URL. Percentage values are numbers from `0` to `100`. + +### Outgoing connections + +| Setting | Purpose | +| --- | --- | +| `HTTPS_PROXY` | Outbound HTTP proxy used for the requests to the verifiable-credential verifier. | +| TLS verification | The proxy sets `NODE_TLS_REJECT_UNAUTHORIZED=0` at startup, so it does not verify the TLS certificates of the backend services and integrations it calls. Protect the internal network between the proxy and these services accordingly. | + +`BAE_LP_INDEX_URL` and `BAE_LP_INDEX_API_VERSION` configure a legacy Elasticsearch connection. The current proxy stores +its data in MongoDB and does not use them. + +## Identity Management + +Configure authentication in the Logic Proxy and align the returned role names with the Charging Backend. +The OAuth2/OIDC provider is selected through `config.oauth2.provider`; supported provider identifiers include `fiware`, +`keycloak`, `github`, `i4trust`, and `oidc-discover`. Verifiable-credential login uses `config.siop`. + +### OAuth2 and OpenID Connect + +For example, an OAuth2/OIDC configuration can be provided in `config.js`: + +```javascript +config.oauth2 = { + provider: 'fiware', + server: 'https://identity.example.org', + clientID: '', + clientSecret: '', + callbackURL: 'https://marketplace.example.org/auth/fiware/callback', + oidc: true, + oidcScopes: 'openid', + oidcDiscoveryURI: null, + oidcTokenEndpointAuthMethod: 'client_secret_basic', + key: '', + defaultRole: null, + nonce: false +}; + +config.roles = { + admin: 'admin', + seller: 'Seller', + customer: 'Buyer', + orgAdmin: 'orgAdmin', + certifier: 'certifier', + sellerOperator: 'SellerOperator', + buyerOperator: 'BuyerOperator' +}; +``` + +Role mappings are top-level `config.roles` settings. The administrator, seller, customer, organization administrator, +and certifier mappings have the following environment overrides: + +| Environment variable | Purpose | +| --- | --- | +| `BAE_LP_OAUTH2_ADMIN_ROLE` | Marketplace administrator role. | +| `BAE_LP_OAUTH2_SELLER_ROLE` | Seller role. | +| `BAE_LP_OAUTH2_CUSTOMER_ROLE` | Customer/buyer role. | +| `BAE_LP_OAUTH2_ORG_ADMIN_ROLE` | Organization administrator role. | +| `BAE_LP_OAUTH2_ORG_CERTIFIER_ROLE` | Certifier role. | + +The OAuth2/OIDC connection settings are: + +| Environment variable | Purpose | +| --- | --- | +| `BAE_LP_OAUTH2_PROVIDER` | Provider identifier. | +| `BAE_LP_OAUTH2_SERVER` | Identity provider base URL. | +| `BAE_LP_OAUTH2_CLIENT_ID` | OAuth2 client ID. | +| `BAE_LP_OAUTH2_CLIENT_SECRET` | OAuth2 client secret. | +| `BAE_LP_OAUTH2_CALLBACK` | Full callback URL registered with the identity provider. | +| `BAE_LP_OAUTH2_DEFAULT_ROLE` | Default role applied by the configured authentication integration. | +| `BAE_LP_OAUTH2_NONCE` | Nonce support, enabled with `true`. | +| `BAE_LP_OAUTH2_IS_LEGACY` | Legacy identity-provider behavior, enabled with `true`. | +| `BAE_LP_OIDC_ENABLED` | OpenID Connect support, enabled with `true`. | +| `BAE_LP_OIDC_SCOPES` | Requested OIDC scopes. | +| `BAE_LP_OIDC_DISCOVERY_URI` | Discovery URL for the discovery-based provider. | +| `BAE_LP_OIDC_TOKEN_AUTH_METHOD` | Token endpoint authentication method. | +| `BAE_LP_OIDC_KEY` | OIDC key setting. | +| `BAE_LP_OIDC_REALM` | Realm when using Keycloak. | +| `BAE_LP_OIDC_TOKEN_KEY` | Signing private key for the iShare integration. | +| `BAE_LP_OIDC_TOKEN_CRT` | Certificate for the iShare integration. | + +For Keycloak, set `BAE_LP_OAUTH2_PROVIDER=keycloak` and `BAE_LP_OIDC_REALM` to the realm name. For discovery-based OIDC, +set `BAE_LP_OAUTH2_PROVIDER=oidc-discover` and provide the discovery URI, client credentials, callback, and scopes. + +### Verifiable-credential login + +Enable VC login with `BAE_LP_SIOP_ENABLED=true`. The proxy uses the `vc` provider and the verifier configuration below. + +| Environment variable | Purpose | +| --- | --- | +| `BAE_LP_SIOP_IS_REDIRECTION` | Selects verifier redirection when `true`; otherwise the configured polling flow is used. | +| `BAE_LP_SIOP_CLIENT_ID` | Client identifier used for the login request. | +| `BAE_LP_SIOP_CALLBACK_PATH` | Full callback URL for the VC flow. | +| `BAE_LP_SIOP_REQUEST_URI` | URI used to retrieve the signed login request. | +| `BAE_LP_SIOP_PRIVATE_KEY` | Hex-encoded private signing key. | +| `BAE_LP_SIOP_PRIVATE_KEY_PEM` | PEM signing key used by the JWT signer when provided. | +| `BAE_LP_SIO_SIGN_ALGORITHM` | Signing algorithm; the supplied default is `ES256`. | +| `BAE_LP_SIOP_VERIFIER_HOST` | Verifier base URL. | +| `BAE_LP_SIOP_VERIFIER_QRCODE_PATH` | Verifier QR login path. | +| `BAE_LP_SIOP_VERIFIER_TOKEN_PATH` | Verifier token endpoint path. | +| `BAE_LP_SIOP_VERIFIER_JWKS_PATH` | Verifier JWKS path. | +| `BAE_LP_SIOP_ALLOWED_ROLES` | Comma-separated role names for the configured VC integration. | +| `BAE_LP_SIOP_OPERATORS` | Comma-separated operator identifiers. | + +### External identity providers and login controls + +`BAE_LP_EXT_LOGIN=true` enables the external identity-provider service. The iShare-related deployment values are +`BAE_EORI`, `BAE_TOKEN_KEY`, and `BAE_TOKEN_CRT`. + +| Environment variable | Purpose | +| --- | --- | +| `BAE_LP_SHOW_LOCAL_LOGIN` | Displays local login when set to `true`. | +| `BAE_LP_PROPAGATE_TOKEN` | Propagates the user's access token to backend services when set to `true`. | +| `BAE_LP_ALLOW_LOCAL_EORI` | Enables locally supplied EORI values when set to `true`. | +| `BAE_LP_EDIT_PARTY` | Enables the configured party-editing behavior when set to `true`. | + +## Configuring the frontend + +The [BAE Frontend](https://github.com/Ficodes/BAE-Frontend) is not deployed on its own. Its compiled application is +served by the Logic Proxy from the `portal/bae-frontend` directory, so the frontend and the proxy share the same public +origin. The frontend is configured in two ways: + +- At build time, through the files in `src/environments/` and the theme definitions compiled into the bundle. +- At startup, through the Logic Proxy's `/config` response. + +| File | Build configuration | +| --- | --- | +| `src/environments/environment.ts` | Base environment file imported by the application. | +| `src/environments/environment.development.ts` | Replacement used by the development configuration. | +| `src/environments/environment.production.ts` | Replacement used by the production configuration, which is the default of `npm run build`. | + +`BASE_URL` is the Logic Proxy base URL used by the browser. The production file leaves it empty, so the frontend calls +the proxy on its own origin, which is the case when it is served by the proxy. + +The frontend loads `/config` during initialization and applies the returned role mappings, default catalog ID, feature +switches, search filters, analytics settings, portal links, tracking settings, and theme name. Configure these values +through the proxy or Administration, and reload the browser after changing them. Changes to the environment files or to +the themes require building the frontend and the Logic Proxy image again. + +`MAX_FILE_SIZE` in the frontend environment controls accepted upload sizes in bytes. The supplied value is `3145728` +(3 MiB). Align it with the Charging Backend's `BAE_CB_MAX_UPLOAD_SIZE` and the upload limits of the deployment's ingress. + +### Building the Logic Proxy image with the frontend + +To deploy a frontend build, for example with a new theme or a modified environment file, package it in a Logic Proxy +image: + +1. Build the frontend: + + ```bash + npm install + npm run build + ``` + + The compiled application is generated in `dist/bae-frontend`. + +2. Replace the `portal/bae-frontend` directory of the Logic Proxy with the build: + + ```bash + git clone https://github.com/FIWARE-TMForum/business-ecosystem-logic-proxy.git + rm -rf business-ecosystem-logic-proxy/portal/bae-frontend + cp -r dist/bae-frontend business-ecosystem-logic-proxy/portal/bae-frontend + ``` + +3. Build the Logic Proxy image from the root of its repository: + + ```bash + cd business-ecosystem-logic-proxy + docker build -f docker/Dockerfile -t /biz-ecosystem-logic-proxy: . + docker push /biz-ecosystem-logic-proxy: + ``` + +(frontend-themes)= +### Themes + +The frontend includes a theming system to adapt the marketplace's appearance, branding, and navigation. Each theme +defines: + +- **Visual styles**: colors and other CSS properties. +- **Assets**: logos, background images, and other graphics. +- **Navigation**: links in the header and footer. +- **Component behavior**: options such as the sections shown in the home page. +- **Text and labels**: theme-specific translations. + +The supplied themes are `BAE`, the default green theme, and `DOME`. Themes are compiled into the frontend bundle; the +theme used is selected at runtime. + +(selecting-the-theme)= +#### Selecting the theme + +Set `BAE_LP_THEME` in the Logic Proxy to the theme name. The proxy returns it as `theme` in `/config`, and the frontend +applies the registered theme whose `name` matches it, ignoring case. If no theme matches, or the variable is not set, +the default theme is applied. + +When `BAE_LP_THEME` is set and the proxy container runs its static collection step (`COLLECT=True`, the default), the +proxy also expects a `themes/` directory, used by the legacy portal, and exits if it is missing. Mount a +directory, which can be empty, at that path, or set `COLLECT=False`: + +```yaml +proxy: + image: /biz-ecosystem-logic-proxy: + volumes: + - ./proxy-themes/galaxy:/opt/business-ecosystem-logic-proxy/themes/galaxy + environment: + - BAE_LP_THEME=galaxy +``` + +#### Creating a theme + +The theme system is based on the frontend's `ThemeService`. At startup, it loads the theme selected by the proxy, adds a +`theme-` CSS class to the `` element, and exposes the theme configuration to the components. To add a theme, +for example one called *Galaxy*: + +1. Create a SCSS file in `src/app/themes/`, such as `galaxy.theme.scss`, that overrides the color variables for the + `body.theme-galaxy` selector. Colors are given as RGB components: + + ```scss + body.theme-galaxy { + --theme-primary-50: 138 43 226; + --theme-primary-100: 75 0 130; + --theme-secondary-50: 230 230 250; + --theme-secondary-100: 44 0 76; + } + ``` + +2. Create the theme configuration, such as `src/app/themes/galaxy.theme.ts`. Its `name` must match the CSS class, and + it defines the assets, the header and footer links, and the component options. Link labels are translation keys: + + ```ts + import { NavLink, ThemeConfig } from '../theme.interfaces'; + + const galaxyHeaderLinks: NavLink[] = [ + { label: 'HEADER._home', url: '/', isRouterLink: true }, + { + label: 'HEADER._starmaps', + id: 'starmapsDropdown', + children: [ + { label: 'HEADER._browse_maps', url: '/search', isRouterLink: true }, + { label: 'HEADER._about_maps', url: '/about-starmaps', isRouterLink: true } + ] + } + ]; + + export const GALAXY_THEME_CONFIG: ThemeConfig = { + name: 'Galaxy', + displayName: 'Galaxy Interstellar Marketplace', + assets: { + logoUrl: 'assets/themes/galaxy/galaxy-logo.svg', + jumboBgUrl: 'assets/themes/galaxy/stars-background.png', + cardDefaultBgUrl: 'assets/themes/galaxy/nebula-background.png' + }, + links: { + headerLinks: galaxyHeaderLinks + }, + dashboard: { + showFeaturedOfferings: true, + showPlatformBenefits: false + } + }; + ``` + +3. Register the theme: + - import the SCSS file in `src/styles.css`, after the supplied themes; + - import the configuration in `src/app/themes/index.ts` and add it to the `AVAILABLE_THEMES` array. +4. Add the theme assets under `src/assets/themes/galaxy/`. +5. Add the translations of the new labels in `src/assets/i18n/themes/`, with one file per language, such as + `en-galaxy.json` and `es-galaxy.json`. +6. [Build the Logic Proxy image](#building-the-logic-proxy-image-with-the-frontend) with the new frontend, and set + `BAE_LP_THEME=galaxy`. + +Components access the theme configuration through the `currentTheme$` observable of `ThemeService`. See the +[frontend repository](https://github.com/Ficodes/BAE-Frontend#application-theming-system) for details. + +## Configuring the TMF APIs + +The API implementation is [FIWARE TMForum API](https://github.com/FIWARE/tmforum-api). Its single repository contains +Micronaut services backed by an NGSI-LD broker, with individual API modules and an all-in-one application. +The marketplace uses the 2.x releases; see the [component versions](installation-administration-guide.md#component-versions). +They are built on Micronaut 5 and Java 25; the published images include their own Java runtime. The repository contains the [OpenAPI specifications](https://github.com/FIWARE/tmforum-api/tree/main/api/tm-forum) +and module-specific extensions alongside the implementation. + +Configure each deployed module through its `src/main/resources/application.yaml`, an external configuration file, or +environment variables. Micronaut maps each property to an environment variable in upper case with `_` as separator; +for example, `general.serverHost` is `GENERAL_SERVER_HOST`. The [installation instructions](installation-administration-guide.md#installation-with-docker-compose) +cover building and starting the services. + +### General settings + +| Property | Environment variable | Default | Purpose | +| --- | --- | --- | --- | +| `micronaut.server.port` | `MICRONAUT_SERVER_PORT` | `8632` | HTTP listening port. | +| `micronaut.http.services.ngsi.url` | `MICRONAUT_HTTP_SERVICES_NGSI_URL` | `http://localhost:1026` | NGSI-LD broker base URL. | +| `micronaut.http.services.ngsi.path` | `MICRONAUT_HTTP_SERVICES_NGSI_PATH` | `ngsi-ld/v1` | Broker API path. | +| `micronaut.http.services.ngsi.read-timeout` | `MICRONAUT_HTTP_SERVICES_NGSI_READ_TIMEOUT` | `30s` | Timeout of the requests to the broker. Always include the unit, such as `30s` or `2m`; a value without unit, such as `30`, silently disables the timeout. | +| `general.contextUrl` | `GENERAL_CONTEXT_URL` | NGSI-LD core context | JSON-LD context URL used by the API. | +| `general.serverHost` | `GENERAL_SERVER_HOST` | `http://localhost:8632` | Origin of the API reachable by the broker, used for subscription callbacks. Its host is also treated as local when validating references. | +| `general.basepath` | `GENERAL_BASEPATH` | `/` | Base path of an individually deployed module. | +| `general.tenant` | `GENERAL_TENANT` | None | Optional NGSI-LD tenant. | +| `apiExtension.enabled` | `API_EXTENSION_ENABLED` | Required | Customer billing extension. See [Customer billing extensions](#customer-billing-extensions). | +| `logger.levels.ROOT` | `LOGGER_LEVELS_ROOT` | `WARN` | Log level. | +| `endpoints.health.enabled`, `micronaut.metrics.enabled` | `ENDPOINTS_HEALTH_ENABLED`, `MICRONAUT_METRICS_ENABLED` | `true` | Health and Prometheus metrics endpoints. | + +Micronaut loads additional configuration files through `MICRONAUT_CONFIG_FILES` and selects profiles through +`MICRONAUT_ENVIRONMENTS`. See the [Micronaut configuration documentation](https://docs.micronaut.io/latest/guide/#propertySource) +for property binding and configuration-file precedence. + +### Broker profiles + +Select the profile of the NGSI-LD broker, together with a cache profile, in `MICRONAUT_ENVIRONMENTS`: + +| Profile | Purpose | +| --- | --- | +| `scorpio` | Query syntax of Scorpio. It also enables `general.replaceOnUpdate`, which Scorpio 6 requires to update list attributes correctly. For Scorpio versions earlier than 6.0.0, set `GENERAL_REPLACE_ON_UPDATE=false`. | +| `orion-ld` | Query syntax of Orion-LD. | +| `in-memory` | Local caches of entities and subscriptions in each instance. | +| `redis` | Caches in Redis, shared by several instances. Set its address with `REDIS_URI`. | + +The query syntax used with the broker can be adjusted with these properties: + +| Property | Environment variable | Purpose | +| --- | --- | --- | +| `general.ngsildOrQueryValue` | `GENERAL_NGSILD_OR_QUERY_VALUE` | Separator for alternative values of an attribute in broker queries. | +| `general.ngsildOrQueryKey` | `GENERAL_NGSILD_OR_QUERY_KEY` | Separator for alternative attributes in broker queries. | +| `general.encloseQuery` | `GENERAL_ENCLOSE_QUERY` | Encloses the alternatives in brackets. | +| `general.includeAttributeInList` | `GENERAL_INCLUDE_ATTRIBUTE_IN_LIST` | Repeats the attribute name for each alternative value of a query, instead of listing only the values. | +| `general.replaceOnUpdate` | `GENERAL_REPLACE_ON_UPDATE` | Replaces each updated attribute as a whole, instead of appending it. | +| `general.countHeader` | `GENERAL_COUNT_HEADER` | Broker header with the total number of results, used for pagination. Default: `NGSILD-Results-Count`. | + +The marketplace's integration tests run the all-in-one API with Scorpio 6 and the following configuration: + +```yaml +services: + tmf: + image: quay.io/fiware/tmforum-all-in-one:2.2.1 + environment: + MICRONAUT_SERVER_PORT: 8632 + MICRONAUT_ENVIRONMENTS: scorpio,in-memory + MICRONAUT_HTTP_SERVICES_NGSI_URL: http://scorpio:9090 + MICRONAUT_HTTP_SERVICES_NGSI_PATH: ngsi-ld/v1 + MICRONAUT_HTTP_SERVICES_NGSI_READ_TIMEOUT: 30s + GENERAL_SERVER_HOST: http://tmf:8632 + GENERAL_NGSILD_OR_QUERY_VALUE: "|" + GENERAL_NGSILD_OR_QUERY_KEY: "|" + GENERAL_INCLUDE_ATTRIBUTE_IN_LIST: "true" + GENERAL_ENCLOSE_QUERY: "true" + API_EXTENSION_ENABLED: "true" +``` + +For an individually deployed module, set the base path as well. For example, a Product Catalog API with Orion-LD: + +```yaml +micronaut: + server: + port: 8632 + http: + services: + ngsi: + url: http://orion-ld:1026 + path: ngsi-ld/v1 + read-timeout: 30s +general: + contextUrl: https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld + serverHost: http://product-catalog:8632 + basepath: /tmf-api/productCatalogManagement/v4 +``` + +### API base paths + +The all-in-one application defines an explicit base path for each API. The paths used by the marketplace are: + +| API | All-in-one base path | +| --- | --- | +| Product Catalog Management | `/tmf-api/productCatalogManagement/v4` | +| Party Management | `/tmf-api/party/v4` | +| Product Ordering Management | `/tmf-api/productOrderingManagement/v4` | +| Product Inventory | `/tmf-api/productInventory/v4` | +| Resource Catalog | `/tmf-api/resourceCatalog/v4` | +| Service Catalog | `/tmf-api/serviceCatalogManagement/v4` | +| Resource Inventory | `/tmf-api/resourceInventoryManagement/v4` | +| Service Inventory | `/tmf-api/serviceInventory/v4` | +| Account Management | `/tmf-api/accountManagement/v4` | +| Customer Bill Management | `/tmf-api/customerBillManagement/v4` | +| Customer Management | `/tmf-api/customerManagement/v4` | +| Usage Management | `/tmf-api/usageManagement/v4` | +| Quote | `/tmf-api/quote/v4` | +| Document Management | `/tmf-api/documentManagement/v4` | + +The all-in-one application also includes the Agreement, Party Role, Resource Function Activation, Resource Ordering, +Service Ordering, and Software Management APIs. For an individually deployed module, `api..basepath` reads +`general.basepath`, defaulting to `/`. Use the configured paths in the proxy's endpoint `_PATH` settings and the +Charging Backend's service URLs. + +The API's subscription callback origin, broker URL, and configured JSON-LD context must be reachable from the components +that use them. Configure the broker's own persistence in the broker deployment. + +### References to other deployments + +The APIs validate that the entities referenced in a request exist. In a federated deployment, where entities +reference those of another TM Forum deployment, list the trusted hosts so that their references are accepted: + +| Property | Environment variable | Default | Purpose | +| --- | --- | --- | --- | +| `references.external-hosts` | `REFERENCES_EXTERNAL_HOSTS` | Empty | Comma-separated host names, without scheme or port, whose references are accepted without validation. With an empty list, every reference is validated locally. | +| `references.local-hosts` | `REFERENCES_LOCAL_HOSTS` | Empty | Other host names of this deployment, such as its public host behind an ingress. They are always treated as local. | +| `mapping.strictRelationships` | `MAPPING_STRICT_RELATIONSHIPS` | `false` | When `true`, reading an entity that references a missing entity fails. With `false`, the reference is returned with its ID only. | + +Reference IDs must be absolute URIs; other IDs are rejected with HTTP 400. + +### Extension schemas + +Entities extended with `@schemaLocation`, such as the marketplace's related-party, price-component, and data space +extensions, are validated against the referenced JSON Schema, which must be reachable from the API. Downloaded schemas +are cached: + +| Property | Default | Purpose | +| --- | --- | --- | +| `general.schema-cache.enabled` | `true` | Enables the cache. | +| `general.schema-cache.time-to-live` | `30m` | Time before a schema is downloaded again. `0s` disables the cache. | +| `general.schema-cache.max-size` | `100` | Maximum number of cached schemas. | + +### API browser + +The `quay.io/fiware/tmforum-ui` image provides an optional read-only web browser of the all-in-one APIs. Run it next to +the API with `TMF_ENDPOINT` set to the API address, for example `http://tmf:8632`; it listens on port `8080`. Do not +expose it publicly, since it shows all the entities stored in the APIs. + +### Upgrading from 1.x releases + +Entities stored by the 1.x releases are read without migration. When upgrading: + +- Review the configuration overrides: the broker timeout key is `micronaut.http.services.ngsi.read-timeout` and needs + a unit; `micronaut.http.services.read-timeout` is not used; the date serialization key is now + `jackson.date-time-features.write-dates-as-timestamps`. +- With Scorpio 6, use the `scorpio` profile, which enables `replaceOnUpdate`. +- A `POST` with an empty list no longer stores the attribute, so the entity is returned without it. +- Running the JARs outside the images requires Java 25. + +See the [release notes](https://github.com/FIWARE/tmforum-api/tree/main/release-notes) of the repository for details. + +### Customer billing extensions + +For billing integrations that create or update applied customer billing rates, enable `apiExtension.enabled` in the +Customer Bill Management service. Its configuration, and the all-in-one configuration, read this value from +`API_EXTENSION_ENABLED`: + +```bash +export API_EXTENSION_ENABLED=true +``` + +Set the variable to `false` for deployments using the standard customer-billing controllers. + +### Document attachments + +The Document Management API can store attachment content in an S3-compatible service. Configure its `s3` properties +in the module or all-in-one configuration: + +| Property | Purpose | +| --- | --- | +| `s3.enabled` | Set to `true` to enable attachment storage. The supplied default is `false`. | +| `s3.endpoint` | Object-storage endpoint URL. | +| `s3.accessKey` | Storage access key. | +| `s3.secretKey` | Storage secret key. | +| `s3.bucket` | Attachment bucket name. | +| `s3.maxContentSize` | Maximum inline attachment size in bytes. Default: `10485760` (10 MiB). | +| `s3.region` | Region required by the selected storage provider. | + +Document attachments and Charging Backend assets have their own storage configuration. Align the attachment size with +the frontend and ingress limits for document-upload workflows. + +## Enabling Production + +Deploy a Logic Proxy image that includes the frontend built with its production configuration, which is the default of +`npm run build`; see [Building the Logic Proxy image with the frontend](#building-the-logic-proxy-image-with-the-frontend). +Route the public marketplace address to the Logic Proxy, which serves both the frontend and the APIs. + +Use a production startup command for the proxy that sets the environment immediately before starting the server: + +```bash +NODE_ENV=production node server.js +``` + +Configure that command in the container's startup configuration when deploying the proxy in a container. + +In the Charging Backend's `src/settings.py`, configure production values for `DEBUG`, `ALLOWED_HOSTS`, and `SECRET_KEY`: + +```python +DEBUG = False +ALLOWED_HOSTS = ["marketplace.example.org", "charging"] +SECRET_KEY = "" +``` + +Keep MongoDB storage persistent for both the proxy and Charging Backend, and persist the search engine's Elasticsearch +data. When using local billing, run the cron service with the selected schedule. Configure the public URLs and the +internal service endpoints for the addresses used by the browser and by each service. diff --git a/doc/configuration-guide.rst b/doc/configuration-guide.rst deleted file mode 100644 index 4e63d15..0000000 --- a/doc/configuration-guide.rst +++ /dev/null @@ -1,600 +0,0 @@ -=================== -Configuration Guide -=================== - -This guide covers the different configuration options that are available in order to setup a working Business API -Ecosystem instance. The different Business API Ecosystem components can be configured using two different mecahnisms, -settings files and environment variables. - -At this step, the different components of the Business API Ecosystem are installed. In the case of the TMForum APIs and -the RSS, this installation process has already required to configure their database connection before their deployment, -so they are already configured. Nevertheless, this section contains an explanation of the function of the different -settings of the RSS properties files. - --------------------------------- -Configuring the Charging Backend --------------------------------- - -The Charging Backend creates some objects and connections in the different APIs while working, so the first step is -configuring the different URLs of the Business API Ecosystem components by modifying the file *services_settings.py*, -which by default contains the following content: :: - - SITE = 'http://localhost:8004/' - LOCAL_SITE = 'http://localhost:8006/' - - CATALOG = 'http://localhost:8080/DSProductCatalog' - INVENTORY = 'http://localhost:8080/DSProductInventory' - ORDERING = 'http://localhost:8080/DSProductOrdering' - BILLING = 'http://localhost:8080/DSBillingManagement' - RSS = 'http://localhost:8080/DSRevenueSharing' - USAGE = 'http://localhost:8080/DSUsageManagement' - AUTHORIZE_SERVICE = 'http://localhost:8004/authorizeService/apiKeys' - -These settings point to the different APIs accessed by the charging backend. In particular: - -* SITE: External URL of the complete Business API Ecosystem using for Href creation -* LOCAL_SITE: URL where the Charging Backend is going to run -* CATALOG: URL of the catalog API including its path -* INVENTORY: URL of the inventory API including its path -* ORDERING: URL of the ordering API including its path -* BILLING: URL of the billing API including its path -* RSS: URL of the RSS including its path -* USAGE: URL of the Usage API including its path -* AUTHORIZE_SERVICE: Complete URL of the usage authorization service. This service is provided by the logic proxy, and is used to generate API Keys to be used by accounting systems when providing usage information. - -These settings can be configured using the following environment variables: :: - - BAE_SERVICE_HOST=http://proxy.docker:8004/ - BAE_CB_LOCAL_SITE=http://charging.docker:8006/ - BAE_CB_CATALOG=http://apis.docker:8080/DSProductCatalog - BAE_CB_INVENTORY=http://apis.docker:8080/DSProductInventory - BAE_CB_ORDERING=http://apis.docker:8080/DSProductOrdering - BAE_CB_BILLING=http://apis.docker:8080/DSBillingManagement - BAE_CB_RSS=http://rss.docker:8080/DSRevenueSharing - BAE_CB_USAGE=http://apis.docker:8080/DSUsageManagement - BAE_CB_AUTHORIZE_SERVICE=http://proxy.docker:8004/authorizeService/apiKeys - - -Once the services have been configured, the next step is configuring the database. In this case, the charging backend uses -MongoDB, and its connection can be configured modifying the *DATABASES* setting of the *settings.py* file. :: - - DATABASES = { - "default": { - "ENGINE": "djongo", - "NAME": "wstore_db", - "ENFORCE_SCHEMA": False, - "CLIENT": { - "host": "localhost", - "port": 27017 - "username': "mongoadmin", - "password': "mongopass" - }, - } - } - -This setting contains the following fields: - -* ENGINE: Database engine, must be fixed to djongo -* NAME: Name of the database to be used -* CLIENT: Configuration for connecting to MongoDB - * host: Host of the database. If empty it uses the default *localhost* host - * port: Port of the database. If empty it uses the default *27017* port - * username: User of the database. If empty the software creates a non authenticated connection - * password: Database user password. If empty the software creates a non authenticated connection - -These settings can be configured using the environment with the following variables: :: - - BAE_CB_MONGO_SERVER=mongo - BAE_CB_MONGO_PORT=27017 - BAE_CB_MONGO_DB=charging_db - BAE_CB_MONGO_USER=user - BAE_CB_MONGO_PASS=passwd - -Once the database connection has been configured, the next step is configuring the name of the IdM roles to be used by -updating *settings.py* :: - - ADMIN_ROLE = 'provider' - PROVIDER_ROLE = 'seller' - CUSTOMER_ROLE = 'customer' - -This settings contain the following values: - -* ADMIN_ROLE: IDM role of the system admin -* PROVIDER_ROLE: IDM role of the users with seller privileges -* CUSTOMER_ROLE: IDM role of the users with customer privileges - -These parameters can be configured with the environment using: :: - - BAE_LP_OAUTH2_ADMIN_ROLE=admin - BAE_LP_OAUTH2_SELLER_ROLE=seller - BAE_LP_OAUTH2_CUSTOMER_ROLE=customer - -The charging backend is the component in charge of maintaining the supported currencies and the timeframe of the different -periods using in recurring pricing models. To configure both, the following settings are used: :: - - CURRENCY_CODES = [ - ('EUR', 'Euro'), - ('AUD', 'Australia Dollar'), - ... - ] - CHARGE_PERIODS = { - 'daily': 1, # One day - 'weekly': 7, # One week - 'monthly': 30, # One month - ... - } - -* CURRENCY_CODES: Includes the list of currencies supported by the system as a tuple of currency code and currency name. -* CHARGE_PERIODS: Includes the list of supported periods for recurring models, specifing the time (in days) between periodic charges - -The Charging Backend component is able to send email notifications to the users when they are charged or receive a payment. -In this way, it is possible to provide email configuration in the *settings.py* file by modifying the following fields: :: - - WSTOREMAILUSER = 'email_user' - WSTOREMAIL = 'wstore_email' - WSTOREMAILPASS = 'wstore_email_passwd' - SMTPSERVER = 'wstore_smtp_server' - SMTPPORT = 587 - -This settings contain the following values: -* WSTOREMAILUSER: Username used for authenticating in the email server -* WSTOREMAIL: Email to be used as the sender of the notifications -* WSTOREMAILPASS: Password of the user for authenticating in the email server -* SMTPSERVER: Email server host -* SMTPPORT: Email server port - -These settings can be configured with the environment using: :: - - BAE_CB_EMAIL=charging@email.com - BAE_CB_EMAIL_USER=user - BAE_CB_EMAIL_PASS=pass - BAE_CB_EMAIL_SMTP_SERVER=smtp.server.com - BAE_CB_EMAIL_SMTP_PORT=587 - -.. note:: - The email configuration in optional. However, the field WSTOREMAIL must be provided since it is used internally for RSS configuration - -Additionally, the Charging Backend is the component that charges customers and pays providers. For this purpose it uses -PayPal. For configuring paypal, the first step is setting *PAYMENT_METHOD* to *paypal* in the *settings.py* file :: - - PAYMENT_METHOD = 'paypal' - -Then, it is required to provide PayPal application credentials by updating the file *src/wstore/charging_engine/payment_client/paypal_client.py* :: - - PAYPAL_CLIENT_ID = '' - PAYPAL_CLIENT_SECRET = '' - MODE = 'sandbox' # sandbox or live - -These settings contain the following values: - -* PAYPAL_CLIENT_ID: Id of the application provided by PayPal -* PAYPAL_CLIENT_SECRET: Secret of the application provided by PayPal -* MODE: Mode of the connection. It can be *sandbox* if using the PayPal sandbox for testing the system. Or *live* if using the real PayPal APIs - -In addition, these settings can be configured using the following environment variables: :: - - BAE_CB_PAYMENT_METHOD=paypal - BAE_CB_PAYPAL_CLIENT_ID=client_id - BAE_CB_PAYPAL_CLIENT_SECRET=client_secret - -The charging backend component can be configured to expect or not the user access token to be propagated -from the business logic proxy component, depending on the use case and the expected plugins to be installed. -This can be configured with the following setting: :: - - PROPAGATE_TOKEN = True - -This setting can be also configured using the environment as follows: :: - - export BAE_CB_PROPAGATE_TOKEN=true - -Moreover, the Charging Backend is the component that activates the purchased services. In this regard, the Charging Backend -has the possibility of signing its acquisition notifications with a certificate, so the external system being offered can -validate that is the Charging Backend the one making the request. To use this functionality it is needed to configure the -certificate and the private Key to be used by providing its path in the following settings of the *settings.py* file :: - - NOTIF_CERT_FILE = None - NOTIF_CERT_KEY_FILE = None - -The Charging Backend uses a Cron task to check the status of recurring and usage subscriptions, and for paying sellers. -The periodicity of this tasks can be configured using the CRONJOBS setting of settings.py using the standard Cron format :: - - CRONJOBS = [ - ('0 5 * * *', 'django.core.management.call_command', ['pending_charges_daemon']), - ('0 6 * * *', 'django.core.management.call_command', ['resend_cdrs']), - ('0 4 * * *', 'django.core.management.call_command', ['resend_upgrade'] - ] - -Once the Cron task has been configured, it is necessary to include it in the Cron tasks using the command: -:: - - $ python3 manage.py crontab add - -It is also possible to show current jobs or remove jobs using the commands: -:: - - $ python3 manage.py crontab show - - $ python3 manage.py crontab remove - ---------------------------- -Configuring the Logic Proxy ---------------------------- - -Configuration of the Logic Proxy is located at *config.js* and can be provided in two different ways: providing the values -in the file or using the defined environment variables. Note that the environment variables override the values in *config.js*. - -The first setting to be configured is the port and host where the proxy is going to run, these settings are located in *config.js* :: - - config.port = 80; - config.host = 'localhost'; - -In addition, the environment variables *BAE_LP_PORT* and *BAE_LP_HOST* can be used to override those values. :: - - export BAE_LP_PORT=80 - export BAE_LP_HOST=localhost - -If you want to run the proxy in HTTPS you can update *config.https* setting :: - - config.https = { - enabled: false, - certFile: 'cert/cert.crt', - keyFile: 'cert/key.key', - caFile: 'cert/ca.crt', - port: 443 - }; - -In this case you have to set *enabled* to true, and provide the paths to the certificate (*certFile*), to the private key (*keyFile*), -and to the CA certificate (*caFile*). - -In order to provide the HTTPS configuration using the environment, the following variables has been defined. :: - - export BAE_LP_HTTPS_ENABLED=true - export BAE_LP_HTTPS_CERT=cert/cert.crt - export BAE_LP_HTTPS_CA=cert/key.key - export BAE_LP_HTTPS_KEY=cert/ca.crt - export BAE_LP_HTTPS_PORT=443 - -The logic proxy supports the BAE to be deployed behind a proxy (or NGINX, Apache, etc) not sending X-Forwarding headers. In this -regard, the following setting is used in order to provide information about the actual endpoint which is used to access to the -Business API Ecosystem: :: - - config.proxy = { - enabled: true, - host: 'store.lab.fiware.org', - secured: true, - port: 443 - }; - -Which can be also configured using the *BAE_SERVICE_HOST* environment variable. :: - - export BAE_SERVICE_HOST=https://store.lab.fiware.org/ - -Then, it is possible to modify some of the URLs of the system. In particular, it is possible to provide a prefix for the API, -a prefix for the portal, and modifying the login and logout URLS :: - - config.proxyPrefix = ''; - config.portalPrefix = ''; - config.logInPath = '/login'; - config.logOutPath = '/logOut'; - -In addition, it is possible to configure the theme to be used by providing its name. Details about the configuration of -Themes are provided in the *Configuring Themes* section:: - - config.theme = ''; - -The theme can be configured using the *BAE_LP_THEME* variable. :: - - export BAE_LP_THEME=fiwaretheme - -The BAE supports multiple external IDPs to be configured in order to allow organizations -to login using their own IDP, when registered in a trust provider like iShare. To enable such feature the following setting -needs to be configured: :: - - config.extLogin = true; - -This setting can be also configured using the environment as follows: :: - - export BAE_LP_EXT_LOGIN=true - -In addition, it is possible to configure whether the proxy component should propagate user access token -to the backend components (charging backend, RSS and APIs), depending on the use case and the plugins -installed. To configure such setting, the following is used: :: - - config.propagateToken = true; - -That can be configured using the environment as follows: :: - - export BAE_LP_PROPAGATE_TOKEN=true - -Moreover, the Proxy uses MongoDB for maintaining some info, such as the current shopping cart of a user. you can configure -the connection to MongoDB by updating the following setting: :: - - config.mongoDb = { - server: 'localhost', - port: 27017, - user: '', - password: '', - db: 'belp' - }; - -In this setting you can configure the host (*server*), the port (*port*), the database user (*user*), the database user password -(*password*), and the database name (*db*). - -In addition, the database connection can be configured with the environment as following: :: - - export BAE_LP_MONGO_USER=user - export BAE_LP_MONGO_PASS=pass - export BAE_LP_MONGO_SERVER=localhost - export BAE_LP_MONGO_PORT=27017 - export BAE_LP_MONGO_DB=belp - -As already stated, the Proxy is the component that acts as the endpoint for accessing the different APIs. In this way, -the proxy needs to know the URLs of them in order to redirect the different requests. This endpoints can be configured using the -following settings :: - - config.endpoints = { - 'catalog': { - 'path': 'DSProductCatalog', - 'host': 'localhost' - 'port': '8080', - 'appSsl': false - }, - 'ordering': { - 'path': 'DSProductOrdering', - 'host': 'localhost' - 'port': '8080', - 'appSsl': false - }, - - ... - -The setting *config.endpoints* contains the specific configuration of each of the APIs, including its *path*, its *host*, -its *port*, and whether the API is using SSL or not. - -.. note:: - The default configuration included in the config file is the one used by the installation script, so if you have used the script for - installing the Business API Ecosystem you do not need to modify these fields - -Each of the different APIs can be configured with environment variables with the following pattern: :: - - export BAE_LP_ENDPOINT_CATALOG_PATH=DSProductCatalog - export BAE_LP_ENDPOINT_CATALOG_PORT=8080 - export BAE_LP_ENDPOINT_CATALOG_HOST=localhost - export BAE_LP_ENDPOINT_CATALOG_SECURED=false - -The Business API Ecosystem uses an indexes system managed by the Logic Proxy in order to perform queries, -searches, and paging the results. Starting in version 7.6.0 it is possible to use elasticsearch for the -indexing rather than using the local file system. The indexing system is configured with the following settings. :: - - config.indexes = { - 'engine': 'elasticsearch', // local or elasticsearch - 'elasticHost': 'elastic.docker:9200' - 'apiVersion': '7.5' - }; - -The *engine* setting can be used to chose between *local* indexes and *elasticsearch* indexes. -If the later is chosen the URL of elasticsearch is provided with *elasticHost*. - -These settings can be configured using the environment as follows: :: - - export BAE_LP_INDEX_ENGINE=elasticsearch - export BAE_LP_INDEX_URL=elasticsearch:9200 - export BAE_LP_INDEX_API_VERSION=7 - -Finally, there are two fields that allow to configure the behaviour of the system while running. On the one hand, *config.revenueModel* -allows to configure the default percentage that the Business API Ecosystem is going to retrieve in all the transactions. -On the other hand, *config.usageChartURL* allows to configure the URL of the chart to be used to display product usage to -customers in the web portal. They can be configured with environment variables with *BAE_LP_REVENUE_MODEL* and *BAE_LP_USAGE_CHART* - -Identity Management -=================== - -Additionally, the proxy is the component that acts as the front end of the Business API Ecosystem, both providing a web portal, -and providing the endpoint for accessing to the different APIs. In this regard, the Proxy includes the IDP and login configuration. -The BAE supports multiple IPD implementations. In particular: - -* FIWARE Keyrock -* Keycloak -* GitHub -* FIWARE Keyrock + iShare protocol -* OIDC with discovery server - -To configure the IPD integration thw setting *oauth2* is used. The following example shows an example configuration using Keyrock :: - - config.oauth2 = { - 'provider': 'fiware', - 'server': 'https://account.lab.fiware.org', - 'clientID': '', - 'clientSecret': '', - 'callbackURL': 'http://:/auth/fiware/callback', - 'roles': { - 'admin': 'admin', - 'customer': 'customer', - 'seller': 'seller', - 'orgAdmin': 'orgAdmin' - } - }; - - -In this settings, the value of *provider* is used to configure the IDP type. Then, -it is needed to include the IDM instance being used (*server*), the client id given by the IdM (*clientID*), -the client secret given by the IdM (*clientSecret*), and the callback URL configured in the IdM (*callbackURL*). - -In addition, the different roles allow to specify what users are admins of the system (*Admin*), what users can create products -and offerings (*Seller*), and what users are admins of a particular organization, enabling to manage its information (*orgAdmin*). -Note that while *admin* and *seller* roles are granted directly to the users in the Business API Ecosystem application, the *orgAdmin* -role has to be granted to users within IdM organizations. - -.. note:: - Admin, Seller, and orgAdmin roles are configured in the Proxy settings, so any name can be chosen for them in the IDM - -The OAuth2 settings can be configured using the environment as follows: :: - - export BAE_LP_OAUTH2_PROVIDER=fiware - export BAE_LP_OAUTH2_SERVER=https://account.lab.fiware.org - export BAE_LP_OAUTH2_CLIENT_ID=client_id - export BAE_LP_OAUTH2_CLIENT_SECRET=client_secret - export BAE_LP_OAUTH2_CALLBACK=http://:/auth/fiware/callback - export BAE_LP_OAUTH2_ADMIN_ROLE=admin - export BAE_LP_OAUTH2_SELLER_ROLE=seller - export BAE_LP_OAUTH2_ORG_ADMIN_ROLE=orgAdmin - - -For Keycloak provider some extra settings need to be provided. The following is an example of a Keycloak configuration: :: - - config.oauth2 = { - provider: 'keycloak', - server: 'http://keycloak.docker:8080', - clientID: 'bae', - clientSecret: 'df68d1b9-f85f-4b5e-807c-c8be3ba27388', - callbackURL: 'http://proxy.docker:8004/auth/keycloak/callback', - realm: 'bae', - roles: { - admin: 'admin', - customer: 'customer', - seller: 'seller', - orgAdmin: 'manager' - } - } - -It can be seen that the *provider* setting is set to keycloak and that the *realm* setting is used to specify the Keycloak realm. -Such setting can be configured using the environment using: :: - - export BAE_LP_OIDC_REALM=bae - -When using the iShare protocol, the configuration requires the certificate issues by iShare to be provided in order to generate -and sign the JWT used in such a protocol. Such info can be provided by the settings *tokenCrt* and *tokenKey* or via enviroment with: :: - - export BAE_LP_OIDC_TOKEN_KEY=... - export BAE_LP_OIDC_TOKEN_CRT=... - -Finally, if the OIDC protocol is used the following settings need to be configured: - -* oidcScopes: Scopes requested in the OIDC request -* oidcDiscoveryURI: Discovery endpoint for the OIDC protocol -* oidcTokenEndpointAuthMethod: Method used for retriving the access token in the OIDC server - -Such settings can be configured with the environ using: :: - - BAE_LP_OIDC_SCOPES - BAE_LP_OIDC_DISCOVERY_URI - BAE_LP_OIDC_TOKEN_AUTH_METHOD - ------------------------- -Configuring the TMF APIs ------------------------- - -When the TMF APIs are deployed from sources, the connection to the MySQL database is configured during the installation process -setting up the jdbc connection as described in the *Installation and Administration* guide. - -On the other hand, the Docker image biz-ecosystem-apis, which is used to the deploy TMF APIs using Docker, uses two environment -variables for configuring such connection. :: - - MYSQL_ROOT_PASSWORD=my-secret-pw - MYSQL_HOST=mysql - -Finally, the TMF APIs can optionally use a configuration file called *settings.properties* which is located by default at */etc/default/apis*. -This file include a setting *server* which allows to provide the URL used to access to the Business API Ecosystem and, in particular, by the APIs -in order to generate *hrefs* with the proper reference. :: - - server=https://store.lab.fiware.org/ - -This setting can also be configured using the environment variable *BAE_SERVICE_HOST* :: - - export BAE_SERVICE_HOST=https://store.lab.fiware.org/ - - -------------------- -Configuring the RSS -------------------- - -The RSS has its settings included in two files located at */etc/default/rss*. The file *database.properties* contains -by default the following fields: :: - - database.url=jdbc:mysql://localhost:3306/RSS - database.username=root - database.password=root - database.driverClassName=com.mysql.jdbc.Driver - -This file contains the configuration required in order to connect to the database. - -* database.url: URL used to connect to the database, this URL includes the host and port of the database as well as the concrete database to be used -* database.username: User to be used to connect to the database -* database.password: Password of the database user -* database.driverClassName: Driver class of the database. By default MySQL - -In addition, database settings can be configured using the environment. In particular, using the following variables: :: - - export BAE_RSS_DATABASE_URL=jdbc:mysql://mysql:3306/RSS - export BAE_RSS_DATABASE_USERNAME=root - export BAE_RSS_DATABASE_PASSWORD=my-secret-pw - export BAE_RSS_DATABASE_DRIVERCLASSNAME=com.mysql.jdbc.Driver - -The file *oauth.properties* contains by default the following fields (It is recommended not to modify them) :: - - config.grantedRole=admin - config.sellerRole=Seller - config.aggregatorRole=aggregator - -This file contains the name of the roles (registered in the idm) that are going to be used by the RSS. - -* config.grantedRole: Role in the IDM of the users with admin privileges -* config.sellerRole: Role in the IDM of the users with seller privileges -* config.aggregatorRole: Role of the users who are admins of an store instance. In the context of the Business API Ecosystem there is only a single store instance, so you can safely ignore this flag - -Those settings can also be configured using the environment as :: - - export BAE_RSS_OAUTH_CONFIG_GRANTEDROLE=admin - export BAE_RSS_OAUTH_CONFIG_SELLERROLE=Seller - export BAE_RSS_OAUTH_CONFIG_AGGREGATORROLE=Aggregator - ------------------- -Configuring Themes ------------------- - -The Business API Ecosystem provides a basic mechanism for the creation of themes intended to customize the web portal -of the system. Themes include a set of files which can override any of the default portal files located in the *public/resources* -or *views* directories of the logic proxy. To do that, themes map the directory structure and include files with the same -name of the default ones to be overridden. - -The Logic Proxy can include multiple themes which should be stored in the *themes* directory located at the root of the -project. - -To enable themes, the *config.theme* setting is provided within the *config.js* file of the Logic Proxy. Themes are -enabled by providing the name of the theme directory in this setting. :: - - config.theme = 'dark-theme'; - -.. note:: - Setting *config.theme* to an empty string makes the Business API Ecosystem to use its default theme - -To start using a theme the following command has to be executed: :: - - $ node collect_static.js - -This command merges the theme files and the default ones into a *static* directory used by the Logic Proxy to retrieve -portal static files. - -------------------- -Enabling Production -------------------- - -The default installation of the Business API Ecosystem deploys its different components in *debug* mode. This is useful -for development and testing but it is not adequate for production environments. - -Enabling the production mode makes the different components to start caching requests and views and minimizing JavaScript -files. - -To enable the production mode, the first step is setting the environment variable *NODE_ENV* to *production* in the machine -containing the Logic Proxy. :: - - $ export NODE_ENV=production - -Then, it is needed to collect static files in order to compress JavaScript files. :: - - $ node collect_static.js - - -Finally, change the setting *DEBUG* of the Charging Backend to False. :: - - DEBUG=False diff --git a/doc/dataspace-guide.md b/doc/dataspace-guide.md new file mode 100644 index 0000000..907bd92 --- /dev/null +++ b/doc/dataspace-guide.md @@ -0,0 +1,331 @@ +# Data Space Integration Guide + +The Business API Ecosystem can act as the marketplace of a data space built with the +[FIWARE Data Space Connector](https://github.com/FIWARE/data-space-connector). In this setup, providers use the +marketplace to describe the data services that their connector exposes, and to publish them with the access and usage +policies that apply. Customers acquire them through the marketplace, and the connectors of both parties use the +contracted information to grant and control access. + +This guide explains how the data space integration is enabled, which information providers enter in the marketplace, +how it is stored, and how the connector uses it. + +## How the integration works + +The marketplace does not call the connector directly. All the information is stored in the +[TM Forum APIs](https://github.com/FIWARE/tmforum-api), as attributes and characteristics of organizations, product +specifications, and product offerings. The components of the connector read the TM Forum entities and react to their +events: + +| Connector component | Use of the marketplace information | +| --- | --- | +| [Contract Management](https://github.com/FIWARE/contract-management) | Listens to TM Forum events. When a product order is completed, it registers the customer organization in the provider's Trusted Issuers List with the credentials and claims defined in the product specification, and registers the product's authorization policies in the ODRL Policy Administration Point. | +| Dataspace Protocol (DSP) controller | Publishes DSP-compatible product offerings in the DSP catalog of the connector, applies their access and contract policies during catalog requests and contract negotiation, and provisions the transfer to the data service. | +| Verifier, Trusted Issuers List, and ODRL Policy Administration Point | Authenticate the consumer with verifiable credentials and enforce the registered policies when the data service is accessed. | + +The marketplace information is organized in three places: + +| Where | Information | Feature | +| --- | --- | --- | +| Organization profile | Contract management connection of the organization. | Data space | +| Product specification | Credentials configuration and authorization policies required to access the service. | Data space | +| Product specification | DSP endpoints, upstream address, transfer settings, target, service configuration, credentials, and policy. | Data space and DSP | +| Product offering | DSP contract definition with access and contract policies. | Data space and DSP | + +## Enabling the integration + +The integration is controlled by two marketplace features: + +| Feature | Configuration key | Environment variable | Default | Effect | +| --- | --- | --- | --- | --- | +| Data space | `dataSpaceEnabled` | `BAE_LP_DATASPACE_ENABLED` | `true` | Shows the contract management fields in the organization profile and the **Dataspace configuration** step in product specifications. | +| DSP | `dspEnabled` | `BAE_LP_DSP_ENABLED` | `false` | Adds the **DSP compatible** option and the DSP configuration to product specifications, and the **Contract definition** step to offerings. It requires **Data space** to be enabled too. | + +Marketplace administrators can change them in **Administration → Features**: switch on **Data space** and **DSP**, +select **Save**, and reload the marketplace. Values saved there take precedence over the environment variables. + +![Data space and DSP switches in Administration → Features](images/dataspace/ds-features.png) + +Before enabling the features, deploy the provider connectors and make sure that their TM Forum APIs are the ones used +by the marketplace, or are synchronized with them. + +> **Note:** Disabling a feature hides its fields, but does not delete the information already stored. However, saving +> an organization profile while **Data space** is disabled removes its contract management information, and editing a +> DSP-compatible product specification while **DSP** is disabled removes its DSP configuration. Avoid editing these +> entities while the features are disabled. + +## Organization profile + +With **Data space** enabled, the organization profile includes the connection to the organization's contract +management service. Organization administrators edit it in **Profile → General** during an organization session: + +| Field | Information to provide | +| --- | --- | +| Contract Management Address | URL of the organization's contract management service. | +| Contract Management Client ID | Client ID that identifies the marketplace in the contract management service. | +| Contract Management Scopes | Scopes requested for that client. Enter multiple scopes separated by commas, for example `external-marketplace, another-scope`. | + +Select **Update** to save the profile. Use the connection details supplied by the operator of your connector. + +![Organization profile with the contract management address, client ID, and scopes](images/dataspace/ds-org-contract-management.png) + +The values are stored as a `contractManagement` characteristic of the organization in the TM Forum Party API. The +characteristic is only stored when at least one of the fields has a value: + +```json +"partyCharacteristic": [ + { + "name": "contractManagement", + "value": { + "address": "https://contract-management.atlascloud.eu", + "clientId": "bae-marketplace", + "scope": ["external-marketplace"] + } + } +] +``` + +## Product specifications + +Providers create product specifications in **My Offerings → Product specifications**. With **Data space** enabled, +the form includes a **Dataspace configuration** step after **Configuration options**. Without DSP, the step is +optional. + +### Credentials configuration and authorization policies + +In **Dataspace configuration**, select **Add dataspace configuration** to add a characteristic. Give it a name and +an optional description, choose its type, enter its JSON value, and select **Add JSON** and +**Save configuration option**. Two types are available: + +| Type | Purpose | +| --- | --- | +| Credentials configuration | The verifiable credential, and the claims within it, that the customer's users need to access the service. When an order for the product is completed, Contract Management registers the customer organization as a trusted issuer of that credential and those claims. | +| Authorization policy | An ODRL policy that controls access to the data service. When an order is completed, Contract Management registers it in the ODRL Policy Administration Point. | + +![Dataspace configuration dialog with a credentials configuration](images/dataspace/ds-credentials-configuration.png) + +A credentials configuration identifies the credential type and the claims accepted, for example users with the +`OPERATOR` role for the provider: + +```json +{ + "credentialsType": "OperatorCredential", + "claims": [ + { + "name": "roles", + "path": "$.roles[?(@.target==\"did:web:atlascloud.eu\")].names[*]", + "allowedValues": ["OPERATOR"] + } + ] +} +``` + +An authorization policy is an ODRL policy. The following one allows users with an `OperatorCredential` and the +`OPERATOR` role to read the NGSI-LD entities of the service: + +```json +{ + "@context": {"odrl": "http://www.w3.org/ns/odrl/2/"}, + "@type": "odrl:Policy", + "odrl:uid": "https://atlascloud.eu/policy/fleet-telemetry-read", + "odrl:permission": { + "odrl:assigner": "did:web:atlascloud.eu", + "odrl:target": { + "@type": "odrl:AssetCollection", + "odrl:source": "urn:asset", + "odrl:refinement": [ + {"@type": "odrl:Constraint", "odrl:leftOperand": "http:path", "odrl:operator": "http:isInPath", "odrl:rightOperand": "/ngsi-ld/v1/entities"} + ] + }, + "odrl:assignee": { + "@type": "odrl:PartyCollection", + "odrl:source": "urn:user", + "odrl:refinement": { + "@type": "odrl:LogicalConstraint", + "odrl:and": [ + {"odrl:leftOperand": "vc:role", "odrl:operator": "odrl:hasPart", "odrl:rightOperand": {"@value": "OPERATOR", "@type": "xsd:string"}}, + {"odrl:leftOperand": "vc:type", "odrl:operator": "odrl:hasPart", "odrl:rightOperand": {"@value": "OperatorCredential", "@type": "xsd:string"}} + ] + } + }, + "odrl:action": "odrl:read" + } +} +``` + +The characteristics are stored with the value types `credentialsConfiguration` and `authorizationPolicy` and the +`@schemaLocation` of the corresponding Contract Management schemas: +[credentials configuration](https://raw.githubusercontent.com/FIWARE/contract-management/refs/heads/main/schemas/credentials/credentialConfigCharacteristic.json) +and [authorization policy](https://raw.githubusercontent.com/FIWARE/contract-management/refs/heads/policy-support/schemas/odrl/policyCharacteristic.json). + +(dsp-compatible-products)= +### DSP-compatible products + +With **DSP** enabled, the **General Info** step of the product specification includes the **DSP compatible** option. +Select it for products whose data service is offered through the +[Dataspace Protocol](https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol), so that other +connectors can find it in the provider's DSP catalog, negotiate a contract, and start a transfer. + +![DSP compatible option in the General Info step of a product specification](images/dataspace/ds-dsp-compatible.png) + +For a DSP-compatible product, the **Dataspace configuration** step is required and includes a **DSP configuration** +section: + +| Field | Description | +| --- | --- | +| Endpoints | At least one endpoint, with a **Name**, the **Endpoint URL**, and a **Description**. Enter the DSP addresses where the service can be negotiated, for example one for DCP and another one for OID4VC. Select **Add endpoint** to add each one. | +| Upstream address | Required. Address of the upstream service that serves the data, as reachable from the connector, for example `data-service-scorpio:9090`. | +| Transfer type | Required. `HttpData-PULL` or `HttpData-PUSH`. The current connector supports `HttpData-PULL`. | +| Transfer path | Optional. Path appended to the transfer endpoint returned to the consumer, so that it receives a ready-to-use URL, for example `/ngsi-ld/v1/entities`. | +| Target specification | Required JSON. ODRL target that describes the offered service, used when access is provided through OID4VC. | +| Service configuration | Required JSON. Configuration used by the connector's credentials configuration service when it provisions transfers through OID4VC. | +| Credentials config | Required JSON. Credential and claims required to access the service, with the same format as a credentials configuration. | +| Policy config | Required JSON. ODRL authorization policy for the service, with the same format as an authorization policy. | + +The JSON fields must contain valid JSON before the step can be completed. + +![Dataspace configuration step of a DSP-compatible product, with a credentials configuration characteristic and the DSP configuration](images/dataspace/ds-product-dataspace-step.png) + +Examples of the target specification and the service configuration: + +```json +{ + "@type": "odrl:AssetCollection", + "odrl:refinement": [ + {"@type": "odrl:Constraint", "odrl:leftOperand": "http:path", "odrl:operator": "http:isInPath", "odrl:rightOperand": "/*/ngsi-ld/v1/entities"} + ] +} +``` + +```json +{ + "defaultOidcScope": "openid", + "authorizationType": "DEEPLINK", + "oidcScopes": { + "openid": { + "credentials": [ + { + "type": "OperatorCredential", + "trustedParticipantsLists": ["https://tir.dataspace.eu"], + "trustedIssuersLists": ["https://til.atlascloud.eu"], + "jwtInclusion": {"enabled": true, "fullInclusion": true} + } + ] + } + } +} +``` + +When the specification is saved, the marketplace assigns it an `externalId`, which identifies the asset in the DSP +catalog, and stores the DSP configuration as characteristics: + +| Characteristic `valueType` | Field | +| --- | --- | +| `endpointUrl` | One per endpoint; the name and description of the endpoint are the characteristic's name and description. | +| `upstreamAddress` | Upstream address. | +| `transferType` | Transfer type. | +| `transferPath` | Transfer path, when provided. | +| `targetSpecification` | Target specification. | +| `serviceConfiguration` | Service configuration. | +| `credentialsConfig` | Credentials config. | +| `authorizationPolicy` | Policy config. | + +Once a specification has an `externalId`, the form treats it as DSP compatible when it is edited again. + +## Product offerings + +With **DSP** enabled, offerings based on a DSP-compatible product specification include a **Contract definition** +step between **Terms & Conditions** and **Price plans**. Select **DSP contract definition** to attach the policies +that the connector applies to the offering: + +| Field | Purpose | +| --- | --- | +| Access policy | ODRL policy that controls who can see the offering in the provider's DSP catalog. Consumers that do not fulfil it do not find the offering. | +| Contract policy | ODRL policy that controls who can negotiate a contract for the offering. A consumer can see the offering but cannot negotiate it if it does not fulfil this policy. | + +Both fields are required and must contain valid JSON. + +![Contract definition step of an offering with the access and contract policies](images/dataspace/ds-contract-definition.png) + +For example, an access policy that only shows the offering to full members of the data space, and a contract policy +that only allows negotiation on weekdays: + +```json +{ + "@context": {"odrl": "http://www.w3.org/ns/odrl/2/", "dspace": "https://w3id.org/dspace/v0.8/"}, + "@type": "odrl:Offer", + "odrl:permission": [ + { + "odrl:action": "odrl:use", + "odrl:constraint": [ + {"odrl:leftOperand": "dspace:membershipType", "odrl:operator": "odrl:eq", "odrl:rightOperand": "FullMember"} + ] + } + ] +} +``` + +```json +{ + "@context": {"odrl": "http://www.w3.org/ns/odrl/2/"}, + "@type": "odrl:Offer", + "odrl:permission": [ + { + "odrl:action": "odrl:use", + "odrl:constraint": [ + {"odrl:leftOperand": "odrl:dayOfWeek", "odrl:operator": "odrl:lt", "odrl:rightOperand": 6} + ] + } + ] +} +``` + +The connector evaluates these policies after verifying the credentials of the consumer's connector. The contract +definition is stored as a product offering term, and the offering receives an `externalId`: + +```json +"productOfferingTerm": [ + { + "name": "edc:contractDefinition", + "accessPolicy": { "...": "..." }, + "contractPolicy": { "...": "..." }, + "@schemaLocation": "https://raw.githubusercontent.com/wistefan/edc-dsc/refs/heads/init/schemas/contract-definition.json" + } +] +``` + +The rest of the offering, including its price plans and procurement mode, is configured as for any other offering. + +## Acquiring and using a data service + +Customers find dataspace products in the marketplace like any other product, and acquire them through the usual +purchase or quote flows. The data space connectors take part as follows: + +1. The customer acquires the offering, and the product order is completed in the TM Forum API. +2. The provider's Contract Management registers the customer organization in the Trusted Issuers List with the + credentials configuration of the product, and registers its authorization policies. +3. The customer's organization issues the required credentials, such as an `OperatorCredential` with the `OPERATOR` + role, to its users or applications. +4. The users or applications access the data service through the provider's connector, which verifies their + credentials and enforces the policies. + +For DSP-compatible offerings, the consumer's connector can also use the Dataspace Protocol: + +1. Request the provider's DSP catalog. The offerings are listed according to their access policy. +2. Negotiate a contract for an offering. The negotiation is accepted according to its contract policy and results in a + contract agreement. +3. Start a transfer process with the agreement, using the `HttpData-PULL` transfer type. +4. Retrieve the endpoint and the access token of the transfer, and use them to access the data. The endpoint points + to the upstream address, with the transfer path appended. + +The detailed requests are described in the +[DSP integration guide](https://github.com/FIWARE/data-space-connector/blob/main/doc/DSP_INTEGRATION.md) of the +FIWARE Data Space Connector. + +## References + +- [FIWARE Data Space Connector](https://github.com/FIWARE/data-space-connector) and its + [DSP integration guide](https://github.com/FIWARE/data-space-connector/blob/main/doc/DSP_INTEGRATION.md) +- [FIWARE Contract Management](https://github.com/FIWARE/contract-management) +- [FIWARE TM Forum APIs](https://github.com/FIWARE/tmforum-api) +- [IDSA Dataspace Protocol](https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol) +- [ODRL Information Model](https://www.w3.org/TR/odrl-model/) diff --git a/doc/images/admin/admin-analytics.png b/doc/images/admin/admin-analytics.png new file mode 100644 index 0000000..9cbd90d Binary files /dev/null and b/doc/images/admin/admin-analytics.png differ diff --git a/doc/images/admin/admin-categories.png b/doc/images/admin/admin-categories.png new file mode 100644 index 0000000..e4a3e6a Binary files /dev/null and b/doc/images/admin/admin-categories.png differ diff --git a/doc/images/admin/admin-category-create-summary.png b/doc/images/admin/admin-category-create-summary.png new file mode 100644 index 0000000..8fec33d Binary files /dev/null and b/doc/images/admin/admin-category-create-summary.png differ diff --git a/doc/images/admin/admin-category-create.png b/doc/images/admin/admin-category-create.png new file mode 100644 index 0000000..1666923 Binary files /dev/null and b/doc/images/admin/admin-category-create.png differ diff --git a/doc/images/admin/admin-category-update.png b/doc/images/admin/admin-category-update.png new file mode 100644 index 0000000..34d744f Binary files /dev/null and b/doc/images/admin/admin-category-update.png differ diff --git a/doc/images/admin/admin-content-create.png b/doc/images/admin/admin-content-create.png new file mode 100644 index 0000000..ea51983 Binary files /dev/null and b/doc/images/admin/admin-content-create.png differ diff --git a/doc/images/admin/admin-content-delete.png b/doc/images/admin/admin-content-delete.png new file mode 100644 index 0000000..1480578 Binary files /dev/null and b/doc/images/admin/admin-content-delete.png differ diff --git a/doc/images/admin/admin-content-faq-create.png b/doc/images/admin/admin-content-faq-create.png new file mode 100644 index 0000000..85ad29b Binary files /dev/null and b/doc/images/admin/admin-content-faq-create.png differ diff --git a/doc/images/admin/admin-content-faq.png b/doc/images/admin/admin-content-faq.png new file mode 100644 index 0000000..15b919e Binary files /dev/null and b/doc/images/admin/admin-content-faq.png differ diff --git a/doc/images/admin/admin-content-news.png b/doc/images/admin/admin-content-news.png new file mode 100644 index 0000000..9f90bc0 Binary files /dev/null and b/doc/images/admin/admin-content-news.png differ diff --git a/doc/images/admin/admin-default-catalog.png b/doc/images/admin/admin-default-catalog.png new file mode 100644 index 0000000..c48b42e Binary files /dev/null and b/doc/images/admin/admin-default-catalog.png differ diff --git a/doc/images/admin/admin-email.png b/doc/images/admin/admin-email.png new file mode 100644 index 0000000..2dbb5e3 Binary files /dev/null and b/doc/images/admin/admin-email.png differ diff --git a/doc/images/admin/admin-features.png b/doc/images/admin/admin-features.png new file mode 100644 index 0000000..4890cc6 Binary files /dev/null and b/doc/images/admin/admin-features.png differ diff --git a/doc/images/admin/admin-navigation.png b/doc/images/admin/admin-navigation.png new file mode 100644 index 0000000..e4a3e6a Binary files /dev/null and b/doc/images/admin/admin-navigation.png differ diff --git a/doc/images/admin/admin-personal-session.png b/doc/images/admin/admin-personal-session.png new file mode 100644 index 0000000..42e8324 Binary files /dev/null and b/doc/images/admin/admin-personal-session.png differ diff --git a/doc/images/admin/admin-plugin-delete.png b/doc/images/admin/admin-plugin-delete.png new file mode 100644 index 0000000..da73a1e Binary files /dev/null and b/doc/images/admin/admin-plugin-delete.png differ diff --git a/doc/images/admin/admin-plugins.png b/doc/images/admin/admin-plugins.png new file mode 100644 index 0000000..df1c6ae Binary files /dev/null and b/doc/images/admin/admin-plugins.png differ diff --git a/doc/images/admin/admin-revenue-sharing.png b/doc/images/admin/admin-revenue-sharing.png new file mode 100644 index 0000000..958b3ae Binary files /dev/null and b/doc/images/admin/admin-revenue-sharing.png differ diff --git a/doc/images/admin/admin-search-filters.png b/doc/images/admin/admin-search-filters.png new file mode 100644 index 0000000..1534eda Binary files /dev/null and b/doc/images/admin/admin-search-filters.png differ diff --git a/doc/images/admin/admin-search.png b/doc/images/admin/admin-search.png new file mode 100644 index 0000000..baccbff Binary files /dev/null and b/doc/images/admin/admin-search.png differ diff --git a/doc/images/admin/admin-user-menu.png b/doc/images/admin/admin-user-menu.png new file mode 100644 index 0000000..01ed43d Binary files /dev/null and b/doc/images/admin/admin-user-menu.png differ diff --git a/doc/images/admin/admin-verification.png b/doc/images/admin/admin-verification.png new file mode 100644 index 0000000..8a4e19e Binary files /dev/null and b/doc/images/admin/admin-verification.png differ diff --git a/doc/images/admin/idps1.png b/doc/images/admin/idps1.png deleted file mode 100644 index 63c2ca5..0000000 Binary files a/doc/images/admin/idps1.png and /dev/null differ diff --git a/doc/images/admin/idps2.png b/doc/images/admin/idps2.png deleted file mode 100644 index b30795a..0000000 Binary files a/doc/images/admin/idps2.png and /dev/null differ diff --git a/doc/images/admin/idps3.png b/doc/images/admin/idps3.png deleted file mode 100644 index d5ea7e4..0000000 Binary files a/doc/images/admin/idps3.png and /dev/null differ diff --git a/doc/images/dataspace/ds-contract-definition.png b/doc/images/dataspace/ds-contract-definition.png new file mode 100644 index 0000000..6026670 Binary files /dev/null and b/doc/images/dataspace/ds-contract-definition.png differ diff --git a/doc/images/dataspace/ds-credentials-configuration.png b/doc/images/dataspace/ds-credentials-configuration.png new file mode 100644 index 0000000..0e2db1d Binary files /dev/null and b/doc/images/dataspace/ds-credentials-configuration.png differ diff --git a/doc/images/dataspace/ds-dsp-compatible.png b/doc/images/dataspace/ds-dsp-compatible.png new file mode 100644 index 0000000..ac22221 Binary files /dev/null and b/doc/images/dataspace/ds-dsp-compatible.png differ diff --git a/doc/images/dataspace/ds-features.png b/doc/images/dataspace/ds-features.png new file mode 100644 index 0000000..16c3106 Binary files /dev/null and b/doc/images/dataspace/ds-features.png differ diff --git a/doc/images/dataspace/ds-org-contract-management.png b/doc/images/dataspace/ds-org-contract-management.png new file mode 100644 index 0000000..bf865bd Binary files /dev/null and b/doc/images/dataspace/ds-org-contract-management.png differ diff --git a/doc/images/dataspace/ds-product-dataspace-step.png b/doc/images/dataspace/ds-product-dataspace-step.png new file mode 100644 index 0000000..8771d83 Binary files /dev/null and b/doc/images/dataspace/ds-product-dataspace-step.png differ diff --git a/doc/images/installation/java-terms.png b/doc/images/installation/java-terms.png deleted file mode 100644 index dc4d69a..0000000 Binary files a/doc/images/installation/java-terms.png and /dev/null differ diff --git a/doc/images/installation/mysql-root.png b/doc/images/installation/mysql-root.png deleted file mode 100644 index 1955403..0000000 Binary files a/doc/images/installation/mysql-root.png and /dev/null differ diff --git a/doc/images/installation/sanity-catalogues.png b/doc/images/installation/sanity-catalogues.png new file mode 100644 index 0000000..11830e6 Binary files /dev/null and b/doc/images/installation/sanity-catalogues.png differ diff --git a/doc/images/installation/sanity-user-menu.png b/doc/images/installation/sanity-user-menu.png new file mode 100644 index 0000000..931a019 Binary files /dev/null and b/doc/images/installation/sanity-user-menu.png differ diff --git a/doc/images/installation/sanity1.png b/doc/images/installation/sanity1.png deleted file mode 100644 index 6bdd885..0000000 Binary files a/doc/images/installation/sanity1.png and /dev/null differ diff --git a/doc/images/installation/sanity10.png b/doc/images/installation/sanity10.png deleted file mode 100644 index cb3c8a9..0000000 Binary files a/doc/images/installation/sanity10.png and /dev/null differ diff --git a/doc/images/installation/sanity11.png b/doc/images/installation/sanity11.png deleted file mode 100644 index 0052d36..0000000 Binary files a/doc/images/installation/sanity11.png and /dev/null differ diff --git a/doc/images/installation/sanity12.png b/doc/images/installation/sanity12.png deleted file mode 100644 index 867d423..0000000 Binary files a/doc/images/installation/sanity12.png and /dev/null differ diff --git a/doc/images/installation/sanity13.png b/doc/images/installation/sanity13.png deleted file mode 100644 index e1621fc..0000000 Binary files a/doc/images/installation/sanity13.png and /dev/null differ diff --git a/doc/images/installation/sanity2.png b/doc/images/installation/sanity2.png deleted file mode 100644 index 03a099a..0000000 Binary files a/doc/images/installation/sanity2.png and /dev/null differ diff --git a/doc/images/installation/sanity3.png b/doc/images/installation/sanity3.png deleted file mode 100644 index eaae0bf..0000000 Binary files a/doc/images/installation/sanity3.png and /dev/null differ diff --git a/doc/images/installation/sanity4.png b/doc/images/installation/sanity4.png deleted file mode 100644 index ee9cb34..0000000 Binary files a/doc/images/installation/sanity4.png and /dev/null differ diff --git a/doc/images/installation/sanity5.png b/doc/images/installation/sanity5.png deleted file mode 100644 index f4a1961..0000000 Binary files a/doc/images/installation/sanity5.png and /dev/null differ diff --git a/doc/images/installation/sanity6.png b/doc/images/installation/sanity6.png deleted file mode 100644 index 4ae6460..0000000 Binary files a/doc/images/installation/sanity6.png and /dev/null differ diff --git a/doc/images/installation/sanity7.png b/doc/images/installation/sanity7.png deleted file mode 100644 index 06d41a4..0000000 Binary files a/doc/images/installation/sanity7.png and /dev/null differ diff --git a/doc/images/installation/sanity8.png b/doc/images/installation/sanity8.png deleted file mode 100644 index d6229bf..0000000 Binary files a/doc/images/installation/sanity8.png and /dev/null differ diff --git a/doc/images/installation/sanity9.png b/doc/images/installation/sanity9.png deleted file mode 100644 index cf5835a..0000000 Binary files a/doc/images/installation/sanity9.png and /dev/null differ diff --git a/doc/images/plugin/accounting1.png b/doc/images/plugin/accounting1.png deleted file mode 100644 index 6e6eeda..0000000 Binary files a/doc/images/plugin/accounting1.png and /dev/null differ diff --git a/doc/images/plugin/ckan1.png b/doc/images/plugin/ckan1.png deleted file mode 100644 index 06a5250..0000000 Binary files a/doc/images/plugin/ckan1.png and /dev/null differ diff --git a/doc/images/plugin/ckan2.png b/doc/images/plugin/ckan2.png deleted file mode 100644 index 815dac7..0000000 Binary files a/doc/images/plugin/ckan2.png and /dev/null differ diff --git a/doc/images/plugin/plugin-resource-details.png b/doc/images/plugin/plugin-resource-details.png new file mode 100644 index 0000000..e555652 Binary files /dev/null and b/doc/images/plugin/plugin-resource-details.png differ diff --git a/doc/images/plugin/plugin-service-config.png b/doc/images/plugin/plugin-service-config.png new file mode 100644 index 0000000..e030c2e Binary files /dev/null and b/doc/images/plugin/plugin-service-config.png differ diff --git a/doc/images/plugin/plugin-service-details-empty.png b/doc/images/plugin/plugin-service-details-empty.png new file mode 100644 index 0000000..ba90428 Binary files /dev/null and b/doc/images/plugin/plugin-service-details-empty.png differ diff --git a/doc/images/plugin/plugin-service-details.png b/doc/images/plugin/plugin-service-details.png new file mode 100644 index 0000000..ea4a747 Binary files /dev/null and b/doc/images/plugin/plugin-service-details.png differ diff --git a/doc/images/plugin/plugin-service-type.png b/doc/images/plugin/plugin-service-type.png new file mode 100644 index 0000000..79be8b1 Binary files /dev/null and b/doc/images/plugin/plugin-service-type.png differ diff --git a/doc/images/plugin/plugin-spec-save-dialog.png b/doc/images/plugin/plugin-spec-save-dialog.png new file mode 100644 index 0000000..108fbff Binary files /dev/null and b/doc/images/plugin/plugin-spec-save-dialog.png differ diff --git a/doc/images/plugin/wirecloud1.png b/doc/images/plugin/wirecloud1.png deleted file mode 100644 index 43b63b6..0000000 Binary files a/doc/images/plugin/wirecloud1.png and /dev/null differ diff --git a/doc/images/plugin/wirecloud2.png b/doc/images/plugin/wirecloud2.png deleted file mode 100644 index f88b80c..0000000 Binary files a/doc/images/plugin/wirecloud2.png and /dev/null differ diff --git a/doc/images/user/cat1.png b/doc/images/user/cat1.png deleted file mode 100644 index 55036c2..0000000 Binary files a/doc/images/user/cat1.png and /dev/null differ diff --git a/doc/images/user/cat2.png b/doc/images/user/cat2.png deleted file mode 100644 index 7ba68d2..0000000 Binary files a/doc/images/user/cat2.png and /dev/null differ diff --git a/doc/images/user/cat3.png b/doc/images/user/cat3.png deleted file mode 100644 index cd68864..0000000 Binary files a/doc/images/user/cat3.png and /dev/null differ diff --git a/doc/images/user/cat4.png b/doc/images/user/cat4.png deleted file mode 100644 index a10fcdb..0000000 Binary files a/doc/images/user/cat4.png and /dev/null differ diff --git a/doc/images/user/cat5.png b/doc/images/user/cat5.png deleted file mode 100644 index dabb356..0000000 Binary files a/doc/images/user/cat5.png and /dev/null differ diff --git a/doc/images/user/cat6.png b/doc/images/user/cat6.png deleted file mode 100644 index 3115c6a..0000000 Binary files a/doc/images/user/cat6.png and /dev/null differ diff --git a/doc/images/user/cat7.png b/doc/images/user/cat7.png deleted file mode 100644 index ecd3112..0000000 Binary files a/doc/images/user/cat7.png and /dev/null differ diff --git a/doc/images/user/catalog1.png b/doc/images/user/catalog1.png deleted file mode 100644 index 6f84aac..0000000 Binary files a/doc/images/user/catalog1.png and /dev/null differ diff --git a/doc/images/user/catalog2.png b/doc/images/user/catalog2.png deleted file mode 100644 index 71eca3f..0000000 Binary files a/doc/images/user/catalog2.png and /dev/null differ diff --git a/doc/images/user/catalog3.png b/doc/images/user/catalog3.png deleted file mode 100644 index 60906a3..0000000 Binary files a/doc/images/user/catalog3.png and /dev/null differ diff --git a/doc/images/user/catalog4.png b/doc/images/user/catalog4.png deleted file mode 100644 index 22e5c57..0000000 Binary files a/doc/images/user/catalog4.png and /dev/null differ diff --git a/doc/images/user/catalog5.png b/doc/images/user/catalog5.png deleted file mode 100644 index 6e0ad0e..0000000 Binary files a/doc/images/user/catalog5.png and /dev/null differ diff --git a/doc/images/user/catalog6.png b/doc/images/user/catalog6.png deleted file mode 100644 index 98dae94..0000000 Binary files a/doc/images/user/catalog6.png and /dev/null differ diff --git a/doc/images/user/catalog7.png b/doc/images/user/catalog7.png deleted file mode 100644 index 0cf8162..0000000 Binary files a/doc/images/user/catalog7.png and /dev/null differ diff --git a/doc/images/user/catalog8.png b/doc/images/user/catalog8.png deleted file mode 100644 index 4fd6c4e..0000000 Binary files a/doc/images/user/catalog8.png and /dev/null differ diff --git a/doc/images/user/catalog9.png b/doc/images/user/catalog9.png deleted file mode 100644 index a120a40..0000000 Binary files a/doc/images/user/catalog9.png and /dev/null differ diff --git a/doc/images/user/custord1.png b/doc/images/user/custord1.png deleted file mode 100644 index 2358f85..0000000 Binary files a/doc/images/user/custord1.png and /dev/null differ diff --git a/doc/images/user/custord2.png b/doc/images/user/custord2.png deleted file mode 100644 index 2b349a1..0000000 Binary files a/doc/images/user/custord2.png and /dev/null differ diff --git a/doc/images/user/custord3.png b/doc/images/user/custord3.png deleted file mode 100644 index 3d9daf3..0000000 Binary files a/doc/images/user/custord3.png and /dev/null differ diff --git a/doc/images/user/custord4.png b/doc/images/user/custord4.png deleted file mode 100644 index c6d4096..0000000 Binary files a/doc/images/user/custord4.png and /dev/null differ diff --git a/doc/images/user/custord5.png b/doc/images/user/custord5.png deleted file mode 100644 index 8aecd04..0000000 Binary files a/doc/images/user/custord5.png and /dev/null differ diff --git a/doc/images/user/custord6.png b/doc/images/user/custord6.png deleted file mode 100644 index 4598e65..0000000 Binary files a/doc/images/user/custord6.png and /dev/null differ diff --git a/doc/images/user/custord7.png b/doc/images/user/custord7.png deleted file mode 100644 index 91654f4..0000000 Binary files a/doc/images/user/custord7.png and /dev/null differ diff --git a/doc/images/user/inv1.png b/doc/images/user/inv1.png deleted file mode 100644 index 4544389..0000000 Binary files a/doc/images/user/inv1.png and /dev/null differ diff --git a/doc/images/user/inv10.png b/doc/images/user/inv10.png deleted file mode 100644 index fdc2047..0000000 Binary files a/doc/images/user/inv10.png and /dev/null differ diff --git a/doc/images/user/inv11.png b/doc/images/user/inv11.png deleted file mode 100644 index d139aab..0000000 Binary files a/doc/images/user/inv11.png and /dev/null differ diff --git a/doc/images/user/inv13.png b/doc/images/user/inv13.png deleted file mode 100644 index 262ff95..0000000 Binary files a/doc/images/user/inv13.png and /dev/null differ diff --git a/doc/images/user/inv14.png b/doc/images/user/inv14.png deleted file mode 100644 index d702a3c..0000000 Binary files a/doc/images/user/inv14.png and /dev/null differ diff --git a/doc/images/user/inv2.png b/doc/images/user/inv2.png deleted file mode 100644 index 41a6b6a..0000000 Binary files a/doc/images/user/inv2.png and /dev/null differ diff --git a/doc/images/user/inv3.png b/doc/images/user/inv3.png deleted file mode 100644 index 5f66080..0000000 Binary files a/doc/images/user/inv3.png and /dev/null differ diff --git a/doc/images/user/inv4.png b/doc/images/user/inv4.png deleted file mode 100644 index 0ebdf04..0000000 Binary files a/doc/images/user/inv4.png and /dev/null differ diff --git a/doc/images/user/inv5.png b/doc/images/user/inv5.png deleted file mode 100644 index e860c3a..0000000 Binary files a/doc/images/user/inv5.png and /dev/null differ diff --git a/doc/images/user/inv6.png b/doc/images/user/inv6.png deleted file mode 100644 index 2e20f58..0000000 Binary files a/doc/images/user/inv6.png and /dev/null differ diff --git a/doc/images/user/inv7.png b/doc/images/user/inv7.png deleted file mode 100644 index c7ff43c..0000000 Binary files a/doc/images/user/inv7.png and /dev/null differ diff --git a/doc/images/user/inv8.png b/doc/images/user/inv8.png deleted file mode 100644 index 34751df..0000000 Binary files a/doc/images/user/inv8.png and /dev/null differ diff --git a/doc/images/user/inv9.png b/doc/images/user/inv9.png deleted file mode 100644 index 5f9375d..0000000 Binary files a/doc/images/user/inv9.png and /dev/null differ diff --git a/doc/images/user/offering1.png b/doc/images/user/offering1.png deleted file mode 100644 index 1393632..0000000 Binary files a/doc/images/user/offering1.png and /dev/null differ diff --git a/doc/images/user/offering10.png b/doc/images/user/offering10.png deleted file mode 100644 index 2218140..0000000 Binary files a/doc/images/user/offering10.png and /dev/null differ diff --git a/doc/images/user/offering11.png b/doc/images/user/offering11.png deleted file mode 100644 index 35b53a0..0000000 Binary files a/doc/images/user/offering11.png and /dev/null differ diff --git a/doc/images/user/offering12.png b/doc/images/user/offering12.png deleted file mode 100644 index f2bc880..0000000 Binary files a/doc/images/user/offering12.png and /dev/null differ diff --git a/doc/images/user/offering12b.png b/doc/images/user/offering12b.png deleted file mode 100644 index 18b3630..0000000 Binary files a/doc/images/user/offering12b.png and /dev/null differ diff --git a/doc/images/user/offering12c.png b/doc/images/user/offering12c.png deleted file mode 100644 index 4a5a6e5..0000000 Binary files a/doc/images/user/offering12c.png and /dev/null differ diff --git a/doc/images/user/offering12d.png b/doc/images/user/offering12d.png deleted file mode 100644 index 6688823..0000000 Binary files a/doc/images/user/offering12d.png and /dev/null differ diff --git a/doc/images/user/offering12e.png b/doc/images/user/offering12e.png deleted file mode 100644 index ab2aa4b..0000000 Binary files a/doc/images/user/offering12e.png and /dev/null differ diff --git a/doc/images/user/offering12f.png b/doc/images/user/offering12f.png deleted file mode 100644 index f0cb4af..0000000 Binary files a/doc/images/user/offering12f.png and /dev/null differ diff --git a/doc/images/user/offering13.png b/doc/images/user/offering13.png deleted file mode 100644 index a81893a..0000000 Binary files a/doc/images/user/offering13.png and /dev/null differ diff --git a/doc/images/user/offering14.png b/doc/images/user/offering14.png deleted file mode 100644 index aaf0e25..0000000 Binary files a/doc/images/user/offering14.png and /dev/null differ diff --git a/doc/images/user/offering15.png b/doc/images/user/offering15.png deleted file mode 100644 index 59d13f1..0000000 Binary files a/doc/images/user/offering15.png and /dev/null differ diff --git a/doc/images/user/offering16.png b/doc/images/user/offering16.png deleted file mode 100644 index 2128407..0000000 Binary files a/doc/images/user/offering16.png and /dev/null differ diff --git a/doc/images/user/offering16b.png b/doc/images/user/offering16b.png deleted file mode 100644 index 007c37b..0000000 Binary files a/doc/images/user/offering16b.png and /dev/null differ diff --git a/doc/images/user/offering16c.png b/doc/images/user/offering16c.png deleted file mode 100644 index fa017b3..0000000 Binary files a/doc/images/user/offering16c.png and /dev/null differ diff --git a/doc/images/user/offering17.png b/doc/images/user/offering17.png deleted file mode 100644 index f041da1..0000000 Binary files a/doc/images/user/offering17.png and /dev/null differ diff --git a/doc/images/user/offering18.png b/doc/images/user/offering18.png deleted file mode 100644 index 1100eec..0000000 Binary files a/doc/images/user/offering18.png and /dev/null differ diff --git a/doc/images/user/offering19.png b/doc/images/user/offering19.png deleted file mode 100644 index eb577f5..0000000 Binary files a/doc/images/user/offering19.png and /dev/null differ diff --git a/doc/images/user/offering2.png b/doc/images/user/offering2.png deleted file mode 100644 index 04540eb..0000000 Binary files a/doc/images/user/offering2.png and /dev/null differ diff --git a/doc/images/user/offering20.png b/doc/images/user/offering20.png deleted file mode 100644 index f6bef9e..0000000 Binary files a/doc/images/user/offering20.png and /dev/null differ diff --git a/doc/images/user/offering21.png b/doc/images/user/offering21.png deleted file mode 100644 index f9b27d8..0000000 Binary files a/doc/images/user/offering21.png and /dev/null differ diff --git a/doc/images/user/offering22.png b/doc/images/user/offering22.png deleted file mode 100644 index f33d309..0000000 Binary files a/doc/images/user/offering22.png and /dev/null differ diff --git a/doc/images/user/offering23.png b/doc/images/user/offering23.png deleted file mode 100644 index 1a52a1e..0000000 Binary files a/doc/images/user/offering23.png and /dev/null differ diff --git a/doc/images/user/offering24.png b/doc/images/user/offering24.png deleted file mode 100644 index 5a730f3..0000000 Binary files a/doc/images/user/offering24.png and /dev/null differ diff --git a/doc/images/user/offering3.png b/doc/images/user/offering3.png deleted file mode 100644 index 6b508e2..0000000 Binary files a/doc/images/user/offering3.png and /dev/null differ diff --git a/doc/images/user/offering4.png b/doc/images/user/offering4.png deleted file mode 100644 index d2cc8a7..0000000 Binary files a/doc/images/user/offering4.png and /dev/null differ diff --git a/doc/images/user/offering5.png b/doc/images/user/offering5.png deleted file mode 100644 index 4bbdd48..0000000 Binary files a/doc/images/user/offering5.png and /dev/null differ diff --git a/doc/images/user/offering6.png b/doc/images/user/offering6.png deleted file mode 100644 index ce89edd..0000000 Binary files a/doc/images/user/offering6.png and /dev/null differ diff --git a/doc/images/user/offering7.png b/doc/images/user/offering7.png deleted file mode 100644 index bceb8f0..0000000 Binary files a/doc/images/user/offering7.png and /dev/null differ diff --git a/doc/images/user/offering8.png b/doc/images/user/offering8.png deleted file mode 100644 index 20cabfc..0000000 Binary files a/doc/images/user/offering8.png and /dev/null differ diff --git a/doc/images/user/offering9.png b/doc/images/user/offering9.png deleted file mode 100644 index 41ffe84..0000000 Binary files a/doc/images/user/offering9.png and /dev/null differ diff --git a/doc/images/user/order1.png b/doc/images/user/order1.png deleted file mode 100644 index 813ec59..0000000 Binary files a/doc/images/user/order1.png and /dev/null differ diff --git a/doc/images/user/order2.png b/doc/images/user/order2.png deleted file mode 100644 index 349cd99..0000000 Binary files a/doc/images/user/order2.png and /dev/null differ diff --git a/doc/images/user/order3.png b/doc/images/user/order3.png deleted file mode 100644 index 13429d3..0000000 Binary files a/doc/images/user/order3.png and /dev/null differ diff --git a/doc/images/user/order4.png b/doc/images/user/order4.png deleted file mode 100644 index a494273..0000000 Binary files a/doc/images/user/order4.png and /dev/null differ diff --git a/doc/images/user/order4b.png b/doc/images/user/order4b.png deleted file mode 100644 index 131a3aa..0000000 Binary files a/doc/images/user/order4b.png and /dev/null differ diff --git a/doc/images/user/order5.png b/doc/images/user/order5.png deleted file mode 100644 index 1967483..0000000 Binary files a/doc/images/user/order5.png and /dev/null differ diff --git a/doc/images/user/order6.png b/doc/images/user/order6.png deleted file mode 100644 index d3c53eb..0000000 Binary files a/doc/images/user/order6.png and /dev/null differ diff --git a/doc/images/user/order7.png b/doc/images/user/order7.png deleted file mode 100644 index 8885a7d..0000000 Binary files a/doc/images/user/order7.png and /dev/null differ diff --git a/doc/images/user/order8.png b/doc/images/user/order8.png deleted file mode 100644 index 9866cc1..0000000 Binary files a/doc/images/user/order8.png and /dev/null differ diff --git a/doc/images/user/order9.png b/doc/images/user/order9.png deleted file mode 100644 index 2ea126d..0000000 Binary files a/doc/images/user/order9.png and /dev/null differ diff --git a/doc/images/user/org.png b/doc/images/user/org.png deleted file mode 100644 index 64a1071..0000000 Binary files a/doc/images/user/org.png and /dev/null differ diff --git a/doc/images/user/product1.png b/doc/images/user/product1.png deleted file mode 100644 index 7e21b92..0000000 Binary files a/doc/images/user/product1.png and /dev/null differ diff --git a/doc/images/user/product10.png b/doc/images/user/product10.png deleted file mode 100644 index 93c9cdb..0000000 Binary files a/doc/images/user/product10.png and /dev/null differ diff --git a/doc/images/user/product11.png b/doc/images/user/product11.png deleted file mode 100644 index 301f699..0000000 Binary files a/doc/images/user/product11.png and /dev/null differ diff --git a/doc/images/user/product12.png b/doc/images/user/product12.png deleted file mode 100644 index 58c1f20..0000000 Binary files a/doc/images/user/product12.png and /dev/null differ diff --git a/doc/images/user/product13.png b/doc/images/user/product13.png deleted file mode 100644 index 76baea4..0000000 Binary files a/doc/images/user/product13.png and /dev/null differ diff --git a/doc/images/user/product14.png b/doc/images/user/product14.png deleted file mode 100644 index 3bb2f6b..0000000 Binary files a/doc/images/user/product14.png and /dev/null differ diff --git a/doc/images/user/product15.png b/doc/images/user/product15.png deleted file mode 100644 index 623db2f..0000000 Binary files a/doc/images/user/product15.png and /dev/null differ diff --git a/doc/images/user/product16.png b/doc/images/user/product16.png deleted file mode 100644 index 4c2dc86..0000000 Binary files a/doc/images/user/product16.png and /dev/null differ diff --git a/doc/images/user/product17.png b/doc/images/user/product17.png deleted file mode 100644 index b6a80a1..0000000 Binary files a/doc/images/user/product17.png and /dev/null differ diff --git a/doc/images/user/product18.png b/doc/images/user/product18.png deleted file mode 100644 index c0aef10..0000000 Binary files a/doc/images/user/product18.png and /dev/null differ diff --git a/doc/images/user/product19.png b/doc/images/user/product19.png deleted file mode 100644 index de17442..0000000 Binary files a/doc/images/user/product19.png and /dev/null differ diff --git a/doc/images/user/product19b.png b/doc/images/user/product19b.png deleted file mode 100644 index 58a5fea..0000000 Binary files a/doc/images/user/product19b.png and /dev/null differ diff --git a/doc/images/user/product2.png b/doc/images/user/product2.png deleted file mode 100644 index cad1aba..0000000 Binary files a/doc/images/user/product2.png and /dev/null differ diff --git a/doc/images/user/product20.png b/doc/images/user/product20.png deleted file mode 100644 index e9146e8..0000000 Binary files a/doc/images/user/product20.png and /dev/null differ diff --git a/doc/images/user/product21.png b/doc/images/user/product21.png deleted file mode 100644 index 7ca65e7..0000000 Binary files a/doc/images/user/product21.png and /dev/null differ diff --git a/doc/images/user/product22.png b/doc/images/user/product22.png deleted file mode 100644 index 7b8a4c0..0000000 Binary files a/doc/images/user/product22.png and /dev/null differ diff --git a/doc/images/user/product23.png b/doc/images/user/product23.png deleted file mode 100644 index 28572b7..0000000 Binary files a/doc/images/user/product23.png and /dev/null differ diff --git a/doc/images/user/product24.png b/doc/images/user/product24.png deleted file mode 100644 index e582efa..0000000 Binary files a/doc/images/user/product24.png and /dev/null differ diff --git a/doc/images/user/product25.png b/doc/images/user/product25.png deleted file mode 100644 index 2cd3571..0000000 Binary files a/doc/images/user/product25.png and /dev/null differ diff --git a/doc/images/user/product3.png b/doc/images/user/product3.png deleted file mode 100644 index 71cff76..0000000 Binary files a/doc/images/user/product3.png and /dev/null differ diff --git a/doc/images/user/product4.png b/doc/images/user/product4.png deleted file mode 100644 index 75a0c9d..0000000 Binary files a/doc/images/user/product4.png and /dev/null differ diff --git a/doc/images/user/product5.png b/doc/images/user/product5.png deleted file mode 100644 index db6ed42..0000000 Binary files a/doc/images/user/product5.png and /dev/null differ diff --git a/doc/images/user/product6.png b/doc/images/user/product6.png deleted file mode 100644 index bfdb756..0000000 Binary files a/doc/images/user/product6.png and /dev/null differ diff --git a/doc/images/user/product7.png b/doc/images/user/product7.png deleted file mode 100644 index e41aa1e..0000000 Binary files a/doc/images/user/product7.png and /dev/null differ diff --git a/doc/images/user/product8.png b/doc/images/user/product8.png deleted file mode 100644 index 5896336..0000000 Binary files a/doc/images/user/product8.png and /dev/null differ diff --git a/doc/images/user/product9.png b/doc/images/user/product9.png deleted file mode 100644 index aff17d4..0000000 Binary files a/doc/images/user/product9.png and /dev/null differ diff --git a/doc/images/user/profile1.png b/doc/images/user/profile1.png deleted file mode 100644 index 08eddcb..0000000 Binary files a/doc/images/user/profile1.png and /dev/null differ diff --git a/doc/images/user/profile10.png b/doc/images/user/profile10.png deleted file mode 100644 index 2030b2e..0000000 Binary files a/doc/images/user/profile10.png and /dev/null differ diff --git a/doc/images/user/profile11.png b/doc/images/user/profile11.png deleted file mode 100644 index ac87444..0000000 Binary files a/doc/images/user/profile11.png and /dev/null differ diff --git a/doc/images/user/profile2.png b/doc/images/user/profile2.png deleted file mode 100644 index a82fe73..0000000 Binary files a/doc/images/user/profile2.png and /dev/null differ diff --git a/doc/images/user/profile3.png b/doc/images/user/profile3.png deleted file mode 100644 index c6dcf40..0000000 Binary files a/doc/images/user/profile3.png and /dev/null differ diff --git a/doc/images/user/profile4.png b/doc/images/user/profile4.png deleted file mode 100644 index 73fe430..0000000 Binary files a/doc/images/user/profile4.png and /dev/null differ diff --git a/doc/images/user/profile5.png b/doc/images/user/profile5.png deleted file mode 100644 index b782282..0000000 Binary files a/doc/images/user/profile5.png and /dev/null differ diff --git a/doc/images/user/profile6.png b/doc/images/user/profile6.png deleted file mode 100644 index a1fb656..0000000 Binary files a/doc/images/user/profile6.png and /dev/null differ diff --git a/doc/images/user/profile7.png b/doc/images/user/profile7.png deleted file mode 100644 index 31f56c3..0000000 Binary files a/doc/images/user/profile7.png and /dev/null differ diff --git a/doc/images/user/profile8.png b/doc/images/user/profile8.png deleted file mode 100644 index 249d608..0000000 Binary files a/doc/images/user/profile8.png and /dev/null differ diff --git a/doc/images/user/profile9.png b/doc/images/user/profile9.png deleted file mode 100644 index 46a760e..0000000 Binary files a/doc/images/user/profile9.png and /dev/null differ diff --git a/doc/images/user/profileOrg.png b/doc/images/user/profileOrg.png deleted file mode 100644 index 23de9cc..0000000 Binary files a/doc/images/user/profileOrg.png and /dev/null differ diff --git a/doc/images/user/provord1.png b/doc/images/user/provord1.png deleted file mode 100644 index a24d896..0000000 Binary files a/doc/images/user/provord1.png and /dev/null differ diff --git a/doc/images/user/provord10.png b/doc/images/user/provord10.png deleted file mode 100644 index d5f48b7..0000000 Binary files a/doc/images/user/provord10.png and /dev/null differ diff --git a/doc/images/user/provord11.png b/doc/images/user/provord11.png deleted file mode 100644 index 00b18ce..0000000 Binary files a/doc/images/user/provord11.png and /dev/null differ diff --git a/doc/images/user/provord12.png b/doc/images/user/provord12.png deleted file mode 100644 index 0591e66..0000000 Binary files a/doc/images/user/provord12.png and /dev/null differ diff --git a/doc/images/user/provord2.png b/doc/images/user/provord2.png deleted file mode 100644 index d83d1ec..0000000 Binary files a/doc/images/user/provord2.png and /dev/null differ diff --git a/doc/images/user/provord3.png b/doc/images/user/provord3.png deleted file mode 100644 index e94cdcd..0000000 Binary files a/doc/images/user/provord3.png and /dev/null differ diff --git a/doc/images/user/provord4.png b/doc/images/user/provord4.png deleted file mode 100644 index 7d1f423..0000000 Binary files a/doc/images/user/provord4.png and /dev/null differ diff --git a/doc/images/user/provord5.png b/doc/images/user/provord5.png deleted file mode 100644 index 49c91f5..0000000 Binary files a/doc/images/user/provord5.png and /dev/null differ diff --git a/doc/images/user/provord6.png b/doc/images/user/provord6.png deleted file mode 100644 index a845d52..0000000 Binary files a/doc/images/user/provord6.png and /dev/null differ diff --git a/doc/images/user/provord7.png b/doc/images/user/provord7.png deleted file mode 100644 index 7a7d7ad..0000000 Binary files a/doc/images/user/provord7.png and /dev/null differ diff --git a/doc/images/user/provord8.png b/doc/images/user/provord8.png deleted file mode 100644 index 993baf1..0000000 Binary files a/doc/images/user/provord8.png and /dev/null differ diff --git a/doc/images/user/provord9.png b/doc/images/user/provord9.png deleted file mode 100644 index 27b1e6f..0000000 Binary files a/doc/images/user/provord9.png and /dev/null differ diff --git a/doc/images/user/revenue1.png b/doc/images/user/revenue1.png deleted file mode 100644 index e38318c..0000000 Binary files a/doc/images/user/revenue1.png and /dev/null differ diff --git a/doc/images/user/revenue10.png b/doc/images/user/revenue10.png deleted file mode 100644 index a9ce356..0000000 Binary files a/doc/images/user/revenue10.png and /dev/null differ diff --git a/doc/images/user/revenue2.png b/doc/images/user/revenue2.png deleted file mode 100644 index 1d053d8..0000000 Binary files a/doc/images/user/revenue2.png and /dev/null differ diff --git a/doc/images/user/revenue3.png b/doc/images/user/revenue3.png deleted file mode 100644 index a804d42..0000000 Binary files a/doc/images/user/revenue3.png and /dev/null differ diff --git a/doc/images/user/revenue4.png b/doc/images/user/revenue4.png deleted file mode 100644 index 51f1e64..0000000 Binary files a/doc/images/user/revenue4.png and /dev/null differ diff --git a/doc/images/user/revenue5.png b/doc/images/user/revenue5.png deleted file mode 100644 index ff3b65e..0000000 Binary files a/doc/images/user/revenue5.png and /dev/null differ diff --git a/doc/images/user/revenue6.png b/doc/images/user/revenue6.png deleted file mode 100644 index 86e3dc2..0000000 Binary files a/doc/images/user/revenue6.png and /dev/null differ diff --git a/doc/images/user/revenue7.png b/doc/images/user/revenue7.png deleted file mode 100644 index 17e9c4e..0000000 Binary files a/doc/images/user/revenue7.png and /dev/null differ diff --git a/doc/images/user/revenue8.png b/doc/images/user/revenue8.png deleted file mode 100644 index 5772096..0000000 Binary files a/doc/images/user/revenue8.png and /dev/null differ diff --git a/doc/images/user/revenue9.png b/doc/images/user/revenue9.png deleted file mode 100644 index 6996f44..0000000 Binary files a/doc/images/user/revenue9.png and /dev/null differ diff --git a/doc/images/user/search1.png b/doc/images/user/search1.png deleted file mode 100644 index 9a8a757..0000000 Binary files a/doc/images/user/search1.png and /dev/null differ diff --git a/doc/images/user/search10.png b/doc/images/user/search10.png deleted file mode 100644 index 652a2ef..0000000 Binary files a/doc/images/user/search10.png and /dev/null differ diff --git a/doc/images/user/search2.png b/doc/images/user/search2.png deleted file mode 100644 index a01504b..0000000 Binary files a/doc/images/user/search2.png and /dev/null differ diff --git a/doc/images/user/search3.png b/doc/images/user/search3.png deleted file mode 100644 index a4fe374..0000000 Binary files a/doc/images/user/search3.png and /dev/null differ diff --git a/doc/images/user/search4.png b/doc/images/user/search4.png deleted file mode 100644 index a06c043..0000000 Binary files a/doc/images/user/search4.png and /dev/null differ diff --git a/doc/images/user/search5.png b/doc/images/user/search5.png deleted file mode 100644 index b199e88..0000000 Binary files a/doc/images/user/search5.png and /dev/null differ diff --git a/doc/images/user/search6.png b/doc/images/user/search6.png deleted file mode 100644 index 2718dba..0000000 Binary files a/doc/images/user/search6.png and /dev/null differ diff --git a/doc/images/user/search6b.png b/doc/images/user/search6b.png deleted file mode 100644 index 48528e0..0000000 Binary files a/doc/images/user/search6b.png and /dev/null differ diff --git a/doc/images/user/search7.png b/doc/images/user/search7.png deleted file mode 100644 index bfe0c14..0000000 Binary files a/doc/images/user/search7.png and /dev/null differ diff --git a/doc/images/user/search8.png b/doc/images/user/search8.png deleted file mode 100644 index 36c3ef2..0000000 Binary files a/doc/images/user/search8.png and /dev/null differ diff --git a/doc/images/user/search9.png b/doc/images/user/search9.png deleted file mode 100644 index e583cdf..0000000 Binary files a/doc/images/user/search9.png and /dev/null differ diff --git a/doc/images/user/tran1.png b/doc/images/user/tran1.png deleted file mode 100644 index 4543a5e..0000000 Binary files a/doc/images/user/tran1.png and /dev/null differ diff --git a/doc/images/user/tran2.png b/doc/images/user/tran2.png deleted file mode 100644 index ea0c7ec..0000000 Binary files a/doc/images/user/tran2.png and /dev/null differ diff --git a/doc/images/user/tran3.png b/doc/images/user/tran3.png deleted file mode 100644 index ae09a4b..0000000 Binary files a/doc/images/user/tran3.png and /dev/null differ diff --git a/doc/images/user/tran4.png b/doc/images/user/tran4.png deleted file mode 100644 index 955bdab..0000000 Binary files a/doc/images/user/tran4.png and /dev/null differ diff --git a/doc/images/user/tran5.png b/doc/images/user/tran5.png deleted file mode 100644 index 328e249..0000000 Binary files a/doc/images/user/tran5.png and /dev/null differ diff --git a/doc/images/user/tran6.png b/doc/images/user/tran6.png deleted file mode 100644 index f6ba0d6..0000000 Binary files a/doc/images/user/tran6.png and /dev/null differ diff --git a/doc/images/user/tran7.png b/doc/images/user/tran7.png deleted file mode 100644 index fe7ca92..0000000 Binary files a/doc/images/user/tran7.png and /dev/null differ diff --git a/doc/images/user/ug-01-user-menu.png b/doc/images/user/ug-01-user-menu.png new file mode 100644 index 0000000..931a019 Binary files /dev/null and b/doc/images/user/ug-01-user-menu.png differ diff --git a/doc/images/user/ug-02-change-session.png b/doc/images/user/ug-02-change-session.png new file mode 100644 index 0000000..c7da6e5 Binary files /dev/null and b/doc/images/user/ug-02-change-session.png differ diff --git a/doc/images/user/ug-03-personal-profile.png b/doc/images/user/ug-03-personal-profile.png new file mode 100644 index 0000000..7e4f660 Binary files /dev/null and b/doc/images/user/ug-03-personal-profile.png differ diff --git a/doc/images/user/ug-04-org-contacts.png b/doc/images/user/ug-04-org-contacts.png new file mode 100644 index 0000000..732e1b4 Binary files /dev/null and b/doc/images/user/ug-04-org-contacts.png differ diff --git a/doc/images/user/ug-04-org-profile.png b/doc/images/user/ug-04-org-profile.png new file mode 100644 index 0000000..bf865bd Binary files /dev/null and b/doc/images/user/ug-04-org-profile.png differ diff --git a/doc/images/user/ug-05-billing-address-form.png b/doc/images/user/ug-05-billing-address-form.png new file mode 100644 index 0000000..b38ce87 Binary files /dev/null and b/doc/images/user/ug-05-billing-address-form.png differ diff --git a/doc/images/user/ug-05-billing-addresses.png b/doc/images/user/ug-05-billing-addresses.png new file mode 100644 index 0000000..fa0118b Binary files /dev/null and b/doc/images/user/ug-05-billing-addresses.png differ diff --git a/doc/images/user/ug-06-revenue-sharing.png b/doc/images/user/ug-06-revenue-sharing.png new file mode 100644 index 0000000..a0c7d0a Binary files /dev/null and b/doc/images/user/ug-06-revenue-sharing.png differ diff --git a/doc/images/user/ug-07-search.png b/doc/images/user/ug-07-search.png new file mode 100644 index 0000000..432d9c0 Binary files /dev/null and b/doc/images/user/ug-07-search.png differ diff --git a/doc/images/user/ug-08-catalogue-page.png b/doc/images/user/ug-08-catalogue-page.png new file mode 100644 index 0000000..13a7967 Binary files /dev/null and b/doc/images/user/ug-08-catalogue-page.png differ diff --git a/doc/images/user/ug-08-catalogues.png b/doc/images/user/ug-08-catalogues.png new file mode 100644 index 0000000..df28c5e Binary files /dev/null and b/doc/images/user/ug-08-catalogues.png differ diff --git a/doc/images/user/ug-09-offer-compliance.png b/doc/images/user/ug-09-offer-compliance.png new file mode 100644 index 0000000..feab5bc Binary files /dev/null and b/doc/images/user/ug-09-offer-compliance.png differ diff --git a/doc/images/user/ug-09-offer-overview.png b/doc/images/user/ug-09-offer-overview.png new file mode 100644 index 0000000..c73d20a Binary files /dev/null and b/doc/images/user/ug-09-offer-overview.png differ diff --git a/doc/images/user/ug-09-offer-pricing.png b/doc/images/user/ug-09-offer-pricing.png new file mode 100644 index 0000000..6e3cca3 Binary files /dev/null and b/doc/images/user/ug-09-offer-pricing.png differ diff --git a/doc/images/user/ug-10-cart.png b/doc/images/user/ug-10-cart.png new file mode 100644 index 0000000..5a044b1 Binary files /dev/null and b/doc/images/user/ug-10-cart.png differ diff --git a/doc/images/user/ug-10-purchase-drawer-terms.png b/doc/images/user/ug-10-purchase-drawer-terms.png new file mode 100644 index 0000000..94d6b01 Binary files /dev/null and b/doc/images/user/ug-10-purchase-drawer-terms.png differ diff --git a/doc/images/user/ug-10-purchase-drawer.png b/doc/images/user/ug-10-purchase-drawer.png new file mode 100644 index 0000000..7a7a843 Binary files /dev/null and b/doc/images/user/ug-10-purchase-drawer.png differ diff --git a/doc/images/user/ug-11-checkout.png b/doc/images/user/ug-11-checkout.png new file mode 100644 index 0000000..40c15bf Binary files /dev/null and b/doc/images/user/ug-11-checkout.png differ diff --git a/doc/images/user/ug-12-order-details.png b/doc/images/user/ug-12-order-details.png new file mode 100644 index 0000000..3491340 Binary files /dev/null and b/doc/images/user/ug-12-order-details.png differ diff --git a/doc/images/user/ug-12-orders-customer.png b/doc/images/user/ug-12-orders-customer.png new file mode 100644 index 0000000..0110d2c Binary files /dev/null and b/doc/images/user/ug-12-orders-customer.png differ diff --git a/doc/images/user/ug-13-invoice-details.png b/doc/images/user/ug-13-invoice-details.png new file mode 100644 index 0000000..d655d5e Binary files /dev/null and b/doc/images/user/ug-13-invoice-details.png differ diff --git a/doc/images/user/ug-13-invoices.png b/doc/images/user/ug-13-invoices.png new file mode 100644 index 0000000..7ed003b Binary files /dev/null and b/doc/images/user/ug-13-invoices.png differ diff --git a/doc/images/user/ug-14-inventory.png b/doc/images/user/ug-14-inventory.png new file mode 100644 index 0000000..f067a1c Binary files /dev/null and b/doc/images/user/ug-14-inventory.png differ diff --git a/doc/images/user/ug-14-product-details.png b/doc/images/user/ug-14-product-details.png new file mode 100644 index 0000000..3f67db2 Binary files /dev/null and b/doc/images/user/ug-14-product-details.png differ diff --git a/doc/images/user/ug-14-unsubscribe-confirmation.png b/doc/images/user/ug-14-unsubscribe-confirmation.png new file mode 100644 index 0000000..fa400f5 Binary files /dev/null and b/doc/images/user/ug-14-unsubscribe-confirmation.png differ diff --git a/doc/images/user/ug-15-billing-confirmation.png b/doc/images/user/ug-15-billing-confirmation.png new file mode 100644 index 0000000..b69c058 Binary files /dev/null and b/doc/images/user/ug-15-billing-confirmation.png differ diff --git a/doc/images/user/ug-15-modify-characteristics.png b/doc/images/user/ug-15-modify-characteristics.png new file mode 100644 index 0000000..c573419 Binary files /dev/null and b/doc/images/user/ug-15-modify-characteristics.png differ diff --git a/doc/images/user/ug-16-product-specs.png b/doc/images/user/ug-16-product-specs.png new file mode 100644 index 0000000..8913a21 Binary files /dev/null and b/doc/images/user/ug-16-product-specs.png differ diff --git a/doc/images/user/ug-16-workspace.png b/doc/images/user/ug-16-workspace.png new file mode 100644 index 0000000..e372549 Binary files /dev/null and b/doc/images/user/ug-16-workspace.png differ diff --git a/doc/images/user/ug-17-catalogue-summary.png b/doc/images/user/ug-17-catalogue-summary.png new file mode 100644 index 0000000..548ab2d Binary files /dev/null and b/doc/images/user/ug-17-catalogue-summary.png differ diff --git a/doc/images/user/ug-17-catalogues.png b/doc/images/user/ug-17-catalogues.png new file mode 100644 index 0000000..11830e6 Binary files /dev/null and b/doc/images/user/ug-17-catalogues.png differ diff --git a/doc/images/user/ug-18-resource-details.png b/doc/images/user/ug-18-resource-details.png new file mode 100644 index 0000000..e555652 Binary files /dev/null and b/doc/images/user/ug-18-resource-details.png differ diff --git a/doc/images/user/ug-18-service-details.png b/doc/images/user/ug-18-service-details.png new file mode 100644 index 0000000..ea4a747 Binary files /dev/null and b/doc/images/user/ug-18-service-details.png differ diff --git a/doc/images/user/ug-18-service-spec-general.png b/doc/images/user/ug-18-service-spec-general.png new file mode 100644 index 0000000..060f977 Binary files /dev/null and b/doc/images/user/ug-18-service-spec-general.png differ diff --git a/doc/images/user/ug-18-service-spec-save-dialog.png b/doc/images/user/ug-18-service-spec-save-dialog.png new file mode 100644 index 0000000..108fbff Binary files /dev/null and b/doc/images/user/ug-18-service-spec-save-dialog.png differ diff --git a/doc/images/user/ug-18-service-type.png b/doc/images/user/ug-18-service-type.png new file mode 100644 index 0000000..79be8b1 Binary files /dev/null and b/doc/images/user/ug-18-service-type.png differ diff --git a/doc/images/user/ug-19-general-info.png b/doc/images/user/ug-19-general-info.png new file mode 100644 index 0000000..ba4d039 Binary files /dev/null and b/doc/images/user/ug-19-general-info.png differ diff --git a/doc/images/user/ug-19-key-feature.png b/doc/images/user/ug-19-key-feature.png new file mode 100644 index 0000000..abc0378 Binary files /dev/null and b/doc/images/user/ug-19-key-feature.png differ diff --git a/doc/images/user/ug-19-product-details-features.png b/doc/images/user/ug-19-product-details-features.png new file mode 100644 index 0000000..68da635 Binary files /dev/null and b/doc/images/user/ug-19-product-details-features.png differ diff --git a/doc/images/user/ug-20-faqs.png b/doc/images/user/ug-20-faqs.png new file mode 100644 index 0000000..7f3e364 Binary files /dev/null and b/doc/images/user/ug-20-faqs.png differ diff --git a/doc/images/user/ug-20-linked-specs.png b/doc/images/user/ug-20-linked-specs.png new file mode 100644 index 0000000..e2caba8 Binary files /dev/null and b/doc/images/user/ug-20-linked-specs.png differ diff --git a/doc/images/user/ug-20-save-dialog.png b/doc/images/user/ug-20-save-dialog.png new file mode 100644 index 0000000..76ca4e4 Binary files /dev/null and b/doc/images/user/ug-20-save-dialog.png differ diff --git a/doc/images/user/ug-21-configuration-option.png b/doc/images/user/ug-21-configuration-option.png new file mode 100644 index 0000000..8a9a177 Binary files /dev/null and b/doc/images/user/ug-21-configuration-option.png differ diff --git a/doc/images/user/ug-21-configuration-options-list.png b/doc/images/user/ug-21-configuration-options-list.png new file mode 100644 index 0000000..267d683 Binary files /dev/null and b/doc/images/user/ug-21-configuration-options-list.png differ diff --git a/doc/images/user/ug-22-compliance-profile.png b/doc/images/user/ug-22-compliance-profile.png new file mode 100644 index 0000000..5d5f33b Binary files /dev/null and b/doc/images/user/ug-22-compliance-profile.png differ diff --git a/doc/images/user/ug-22-request-validation.png b/doc/images/user/ug-22-request-validation.png new file mode 100644 index 0000000..b80b733 Binary files /dev/null and b/doc/images/user/ug-22-request-validation.png differ diff --git a/doc/images/user/ug-23-contract-definition.png b/doc/images/user/ug-23-contract-definition.png new file mode 100644 index 0000000..6026670 Binary files /dev/null and b/doc/images/user/ug-23-contract-definition.png differ diff --git a/doc/images/user/ug-23-credentials-configuration.png b/doc/images/user/ug-23-credentials-configuration.png new file mode 100644 index 0000000..0e2db1d Binary files /dev/null and b/doc/images/user/ug-23-credentials-configuration.png differ diff --git a/doc/images/user/ug-23-dsp-compatible.png b/doc/images/user/ug-23-dsp-compatible.png new file mode 100644 index 0000000..ac22221 Binary files /dev/null and b/doc/images/user/ug-23-dsp-compatible.png differ diff --git a/doc/images/user/ug-23-dsp-configuration.png b/doc/images/user/ug-23-dsp-configuration.png new file mode 100644 index 0000000..8771d83 Binary files /dev/null and b/doc/images/user/ug-23-dsp-configuration.png differ diff --git a/doc/images/user/ug-24-usage-list.png b/doc/images/user/ug-24-usage-list.png new file mode 100644 index 0000000..86d87d5 Binary files /dev/null and b/doc/images/user/ug-24-usage-list.png differ diff --git a/doc/images/user/ug-24-usage-metrics.png b/doc/images/user/ug-24-usage-metrics.png new file mode 100644 index 0000000..f90dc10 Binary files /dev/null and b/doc/images/user/ug-24-usage-metrics.png differ diff --git a/doc/images/user/ug-24-usage-summary.png b/doc/images/user/ug-24-usage-summary.png new file mode 100644 index 0000000..b6b18a5 Binary files /dev/null and b/doc/images/user/ug-24-usage-summary.png differ diff --git a/doc/images/user/ug-25-offer-category.png b/doc/images/user/ug-25-offer-category.png new file mode 100644 index 0000000..fbc4d5e Binary files /dev/null and b/doc/images/user/ug-25-offer-category.png differ diff --git a/doc/images/user/ug-25-offer-general.png b/doc/images/user/ug-25-offer-general.png new file mode 100644 index 0000000..7e42d48 Binary files /dev/null and b/doc/images/user/ug-25-offer-general.png differ diff --git a/doc/images/user/ug-25-offer-terms.png b/doc/images/user/ug-25-offer-terms.png new file mode 100644 index 0000000..f0d4cc5 Binary files /dev/null and b/doc/images/user/ug-25-offer-terms.png differ diff --git a/doc/images/user/ug-26-plan-type.png b/doc/images/user/ug-26-plan-type.png new file mode 100644 index 0000000..94fc09b Binary files /dev/null and b/doc/images/user/ug-26-plan-type.png differ diff --git a/doc/images/user/ug-26-price-plans-list.png b/doc/images/user/ug-26-price-plans-list.png new file mode 100644 index 0000000..9ae4fdf Binary files /dev/null and b/doc/images/user/ug-26-price-plans-list.png differ diff --git a/doc/images/user/ug-26-price-plans-step.png b/doc/images/user/ug-26-price-plans-step.png new file mode 100644 index 0000000..a0dfbcf Binary files /dev/null and b/doc/images/user/ug-26-price-plans-step.png differ diff --git a/doc/images/user/ug-27-choose-options.png b/doc/images/user/ug-27-choose-options.png new file mode 100644 index 0000000..719fdab Binary files /dev/null and b/doc/images/user/ug-27-choose-options.png differ diff --git a/doc/images/user/ug-27-configuration-profile.png b/doc/images/user/ug-27-configuration-profile.png new file mode 100644 index 0000000..1c6ea65 Binary files /dev/null and b/doc/images/user/ug-27-configuration-profile.png differ diff --git a/doc/images/user/ug-27-plan-editor.png b/doc/images/user/ug-27-plan-editor.png new file mode 100644 index 0000000..5549bb7 Binary files /dev/null and b/doc/images/user/ug-27-plan-editor.png differ diff --git a/doc/images/user/ug-28-price-component.png b/doc/images/user/ug-28-price-component.png new file mode 100644 index 0000000..f9bce9c Binary files /dev/null and b/doc/images/user/ug-28-price-component.png differ diff --git a/doc/images/user/ug-29-tier-form.png b/doc/images/user/ug-29-tier-form.png new file mode 100644 index 0000000..6826cb8 Binary files /dev/null and b/doc/images/user/ug-29-tier-form.png differ diff --git a/doc/images/user/ug-29-tiers.png b/doc/images/user/ug-29-tiers.png new file mode 100644 index 0000000..a960d0f Binary files /dev/null and b/doc/images/user/ug-29-tiers.png differ diff --git a/doc/images/user/ug-30-procurement-modes.png b/doc/images/user/ug-30-procurement-modes.png new file mode 100644 index 0000000..72ed305 Binary files /dev/null and b/doc/images/user/ug-30-procurement-modes.png differ diff --git a/doc/images/user/ug-30-procurement.png b/doc/images/user/ug-30-procurement.png new file mode 100644 index 0000000..4175203 Binary files /dev/null and b/doc/images/user/ug-30-procurement.png differ diff --git a/doc/images/user/ug-31-confirm-publish.png b/doc/images/user/ug-31-confirm-publish.png new file mode 100644 index 0000000..eb40685 Binary files /dev/null and b/doc/images/user/ug-31-confirm-publish.png differ diff --git a/doc/images/user/ug-31-preview-card.png b/doc/images/user/ug-31-preview-card.png new file mode 100644 index 0000000..a6afa2e Binary files /dev/null and b/doc/images/user/ug-31-preview-card.png differ diff --git a/doc/images/user/ug-31-preview-details.png b/doc/images/user/ug-31-preview-details.png new file mode 100644 index 0000000..9dd5572 Binary files /dev/null and b/doc/images/user/ug-31-preview-details.png differ diff --git a/doc/images/user/ug-32-offers-actions.png b/doc/images/user/ug-32-offers-actions.png new file mode 100644 index 0000000..e1e0fbc Binary files /dev/null and b/doc/images/user/ug-32-offers-actions.png differ diff --git a/doc/images/user/ug-33-confirm-action.png b/doc/images/user/ug-33-confirm-action.png new file mode 100644 index 0000000..dcfaad2 Binary files /dev/null and b/doc/images/user/ug-33-confirm-action.png differ diff --git a/doc/images/user/ug-33-order-details.png b/doc/images/user/ug-33-order-details.png new file mode 100644 index 0000000..9409caa Binary files /dev/null and b/doc/images/user/ug-33-order-details.png differ diff --git a/doc/images/user/ug-33-order-notes.png b/doc/images/user/ug-33-order-notes.png new file mode 100644 index 0000000..f683bff Binary files /dev/null and b/doc/images/user/ug-33-order-notes.png differ diff --git a/doc/images/user/ug-33-orders-provider.png b/doc/images/user/ug-33-orders-provider.png new file mode 100644 index 0000000..5c510c0 Binary files /dev/null and b/doc/images/user/ug-33-orders-provider.png differ diff --git a/doc/images/user/ug-34-quotes-customer.png b/doc/images/user/ug-34-quotes-customer.png new file mode 100644 index 0000000..ccf73e8 Binary files /dev/null and b/doc/images/user/ug-34-quotes-customer.png differ diff --git a/doc/images/user/ug-34-request-quote.png b/doc/images/user/ug-34-request-quote.png new file mode 100644 index 0000000..72d5e3c Binary files /dev/null and b/doc/images/user/ug-34-request-quote.png differ diff --git a/doc/images/user/ug-35-chat.png b/doc/images/user/ug-35-chat.png new file mode 100644 index 0000000..209a423 Binary files /dev/null and b/doc/images/user/ug-35-chat.png differ diff --git a/doc/images/user/ug-35-customer-accept-action.png b/doc/images/user/ug-35-customer-accept-action.png new file mode 100644 index 0000000..fe74b2a Binary files /dev/null and b/doc/images/user/ug-35-customer-accept-action.png differ diff --git a/doc/images/user/ug-35-proposal-uploaded.png b/doc/images/user/ug-35-proposal-uploaded.png new file mode 100644 index 0000000..b7ae1f3 Binary files /dev/null and b/doc/images/user/ug-35-proposal-uploaded.png differ diff --git a/doc/images/user/ug-35-provider-accepted.png b/doc/images/user/ug-35-provider-accepted.png new file mode 100644 index 0000000..b7ca3e8 Binary files /dev/null and b/doc/images/user/ug-35-provider-accepted.png differ diff --git a/doc/images/user/ug-35-quotes-provider.png b/doc/images/user/ug-35-quotes-provider.png new file mode 100644 index 0000000..8f4c059 Binary files /dev/null and b/doc/images/user/ug-35-quotes-provider.png differ diff --git a/doc/images/user/ug-36-create-offer-action.png b/doc/images/user/ug-36-create-offer-action.png new file mode 100644 index 0000000..14c602b Binary files /dev/null and b/doc/images/user/ug-36-create-offer-action.png differ diff --git a/doc/images/user/ug-36-party.png b/doc/images/user/ug-36-party.png new file mode 100644 index 0000000..c0590a1 Binary files /dev/null and b/doc/images/user/ug-36-party.png differ diff --git a/doc/images/user/ug-36-summary.png b/doc/images/user/ug-36-summary.png new file mode 100644 index 0000000..7f842c9 Binary files /dev/null and b/doc/images/user/ug-36-summary.png differ diff --git a/doc/images/user/ug-37-create-tender.png b/doc/images/user/ug-37-create-tender.png new file mode 100644 index 0000000..08f2c76 Binary files /dev/null and b/doc/images/user/ug-37-create-tender.png differ diff --git a/doc/images/user/ug-38-invited-providers.png b/doc/images/user/ug-38-invited-providers.png new file mode 100644 index 0000000..b41eb7c Binary files /dev/null and b/doc/images/user/ug-38-invited-providers.png differ diff --git a/doc/images/user/ug-38-select-providers.png b/doc/images/user/ug-38-select-providers.png new file mode 100644 index 0000000..636608b Binary files /dev/null and b/doc/images/user/ug-38-select-providers.png differ diff --git a/doc/images/user/ug-38-submit-confirm.png b/doc/images/user/ug-38-submit-confirm.png new file mode 100644 index 0000000..03b78ee Binary files /dev/null and b/doc/images/user/ug-38-submit-confirm.png differ diff --git a/doc/images/user/ug-39-provider-invite-actions.png b/doc/images/user/ug-39-provider-invite-actions.png new file mode 100644 index 0000000..8016724 Binary files /dev/null and b/doc/images/user/ug-39-provider-invite-actions.png differ diff --git a/doc/images/user/ug-39-tender-expanded.png b/doc/images/user/ug-39-tender-expanded.png new file mode 100644 index 0000000..17b50bc Binary files /dev/null and b/doc/images/user/ug-39-tender-expanded.png differ diff --git a/doc/images/user/ug-39-tenders-provider.png b/doc/images/user/ug-39-tenders-provider.png new file mode 100644 index 0000000..f55cf52 Binary files /dev/null and b/doc/images/user/ug-39-tenders-provider.png differ diff --git a/doc/images/user/ug-40-analytics.png b/doc/images/user/ug-40-analytics.png new file mode 100644 index 0000000..9f62ae2 Binary files /dev/null and b/doc/images/user/ug-40-analytics.png differ diff --git a/doc/img/favicon.ico b/doc/img/favicon.ico deleted file mode 100644 index 3a9caa3..0000000 Binary files a/doc/img/favicon.ico and /dev/null differ diff --git a/doc/img/favicon.png b/doc/img/favicon.png deleted file mode 100644 index de5f32d..0000000 Binary files a/doc/img/favicon.png and /dev/null differ diff --git a/doc/index.md b/doc/index.md new file mode 100644 index 0000000..c6de094 --- /dev/null +++ b/doc/index.md @@ -0,0 +1,47 @@ +# Overview + +[![FIWARE Data Monetization](https://img.shields.io/badge/FIWARE-Data_Monetization-51b6a3.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAVCAYAAAC33pUlAAAABHNCSVQICAgIfAhkiAAAA8NJREFUSEuVlUtIFlEUx+eO+j3Uz8wSLLJ3pBiBUljRu1WLCAKXbXpQEUFERSQF0aKVFAUVrSJalNXGgmphFEhQiZEIPQwKLbEUK7VvZrRvbr8zzjfNl4/swplz7rn/8z/33HtmRhn/MWzbXmloHVeG0a+VSmAXorXS+oehVD9+0zDN9mgk8n0sWtYnHo5tT9daH4BsM+THQC8naK02jCZ83/HlKaVSzBey1sm8BP9nnUpdjOfl/Qyzj5ust6cnO5FItJLoJqB6yJ4QuNcjVOohegpihshS4F6S7DTVVlNtFFxzNBa7kcaEwUGcbVnH8xOJD67WG9n1NILuKtOsQG9FngOc+lciic1iQ8uQGhJ1kVAKKXUs60RoQ5km93IfaREvuoFj7PZsy9rGXE9G/NhBsDOJ63Acp1J82eFU7OIVO1OxWGwpSU5hb0GqfMydMHYSdiMVnncNY5Vy3VbwRUEydvEaRxmAOSSqJMlJISTxS9YWTYLcg3B253xsPkc5lXk3XLlwrPLuDPKDqDIutzYaj3eweMkPeCCahO3+fEIF8SfLtg/5oI3Mh0ylKM4YRBaYzuBgPuRnBYD3mmhA1X5Aka8NKl4nNz7BaKTzSgsLCzWbvyo4eK9r15WwLKRAmmCXXDoA1kaG2F4jWFbgkxUnlcrB/xj5iHxFPiBN4JekY4nZ6ccOiQ87hgwhe+TOdogT1nfpgEDTvYAucIwHxBfNyhpGrR+F8x00WD33VCNTOr/Wd+9C51Ben7S0ZJUq3qZJ2OkZz+cL87ZfWuePlwRcHZjeUMxFwTrJZAJfSvyWZc1VgORTY8rBcubetdiOk+CO+jPOcCRTF+oZ0okUIyuQeSNL/lPrulg8flhmJHmE2gBpE9xrJNkwpN4rQIIyujGoELCQz8ggG38iGzjKkXufJ2Klun1iu65bnJub2yut3xbEK3UvsDEInCmvA6YjMeE1bCn8F9JBe1eAnS2JksmkIlEDfi8R46kkEkMWdqOv+AvS9rcp2bvk8OAESvgox7h4aWNMLd32jSMLvuwDAwORSE7Oe3ZRKrFwvYGrPOBJ2nZ20Op/mqKNzgraOTPt6Bnx5citUINIczX/jUw3xGL2+ia8KAvsvp0ePoL5hXkXO5YvQYSFAiqcJX8E/gyX8QUvv8eh9XUq3h7mE9tLJoNKqnhHXmCO+dtJ4ybSkH1jc9XRaHTMz1tATBe2UEkeAdKu/zWIkUbZxD+veLxEQhhUFmbnvOezsJrk+zmqMo6vIL2OXzPvQ8v7dgtpoQnkF/LP8Ruu9zXdJHg4igAAAABJRU5ErkJgggA=)](https://www.fiware.org/developers/catalogue) +[![stackoverflow tag: fiware](https://img.shields.io/badge/tag-fiware-orange.svg?logo=stackoverflow)](http://stackoverflow.com/questions/tagged/fiware) + +This project is part of [FIWARE](https://www.fiware.org) and has been made in collaboration with the [TM Forum](https://www.tmforum.org). + +The Business API Ecosystem combines the FIWARE Business Framework with [FIWARE's implementation of the TM Forum APIs](https://github.com/FIWARE/tmforum-api). This component allows the monetization of different kind of assets (both digital and physical) during the whole service life cycle, from offering creation to its charging, accounting and revenue settlement and sharing. The Business API Ecosystem exposes its functionality through TM Forum standard APIs, including catalog management, ordering management, inventory management, usage management, billing, customer, and party APIs. + +The Business API Ecosystem is not a single software repository, but it is composed of different projects which work coordinately to provide the complete functionality. + +In particular, the Business API Ecosystem is made of the following components: + +- *[FIWARE TM Forum APIs](https://github.com/FIWARE/tmforum-api)*: A single repository containing Micronaut services backed by an NGSI-LD broker. The APIs can run as individual services or in the all-in-one application. See the [Configuration Guide](configuration-guide.md#configuring-the-tmf-apis) for their deployment settings and base paths. +- *Business Ecosystem Charging Backend*: Is the component in charge of processing the different pricing models, the accounting information, and the revenue sharing reports. With this information, the Business Ecosystem Charging Backend is able to calculate amounts to be charged, charge customers, and pay sellers. +- *Business Ecosystem Logic Proxy*: Acts as the endpoint for accessing the Business API Ecosystem. On the one hand, it orchestrates the APIs validating user requests, including authentication, authorization, and the content of the request from a business logic point of view. On the other hand, it serves a web portal that can be used to interact with the system. + + +This documentation describes the release `2026.12.01` of the Business API Ecosystem: the Logic Proxy 12.0.0 +(with the BAE Frontend 3.0.0), the Charging Backend 12.0.0, and the TM Forum APIs 2.2.1. + + +Feedback, corrections, and documentation requests can be submitted through [GitHub Issues](https://github.com/FIWARE-TMForum/Business-API-Ecosystem/issues/new). + +## Index + +The User Guide and Administrator Guide describe the default **BAE theme** interface. + +- [Installation and Administration Guide](installation-administration-guide.md): The guide for maintainers that explains how to install the BAE. +- [Configuration Guide](configuration-guide.md): Deployment settings, environment variables, and their relationship to settings managed through Administration. +- [Administrator Guide](admin-guide.md): The guide for marketplace administrators managing categories, business settings, features, and public content through the web interface. +- [User Guide](user-guide.md): Profiles, purchasing, inventory, provider specifications and offers, pricing, quotes, and tenders in the web interface. +- [Data Space Integration Guide](dataspace-guide.md): How the marketplace integrates with the FIWARE Data Space Connector, and the data space information of organizations, products, and offers. +- [Plugins Guide](plugins-guide.md): How to develop and manage service and resource plugins, and how providers complete their information. + +(documentation)= +```{toctree} +:maxdepth: 2 +:caption: Documentation + +installation-administration-guide +configuration-guide +admin-guide +user-guide +dataspace-guide +plugins-guide +``` diff --git a/doc/index.rst b/doc/index.rst deleted file mode 100644 index 5c6aae8..0000000 --- a/doc/index.rst +++ /dev/null @@ -1,65 +0,0 @@ -======== -Overview -======== - -.. figure:: https://img.shields.io/badge/FIWARE-Data_Monetization-51b6a3.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAVCAYAAAC33pUlAAAABHNCSVQICAgIfAhkiAAAA8NJREFUSEuVlUtIFlEUx+eO+j3Uz8wSLLJ3pBiBUljRu1WLCAKXbXpQEUFERSQF0aKVFAUVrSJalNXGgmphFEhQiZEIPQwKLbEUK7VvZrRvbr8zzjfNl4/swplz7rn/8z/33HtmRhn/MWzbXmloHVeG0a+VSmAXorXS+oehVD9+0zDN9mgk8n0sWtYnHo5tT9daH4BsM+THQC8naK02jCZ83/HlKaVSzBey1sm8BP9nnUpdjOfl/Qyzj5ust6cnO5FItJLoJqB6yJ4QuNcjVOohegpihshS4F6S7DTVVlNtFFxzNBa7kcaEwUGcbVnH8xOJD67WG9n1NILuKtOsQG9FngOc+lciic1iQ8uQGhJ1kVAKKXUs60RoQ5km93IfaREvuoFj7PZsy9rGXE9G/NhBsDOJ63Acp1J82eFU7OIVO1OxWGwpSU5hb0GqfMydMHYSdiMVnncNY5Vy3VbwRUEydvEaRxmAOSSqJMlJISTxS9YWTYLcg3B253xsPkc5lXk3XLlwrPLuDPKDqDIutzYaj3eweMkPeCCahO3+fEIF8SfLtg/5oI3Mh0ylKM4YRBaYzuBgPuRnBYD3mmhA1X5Aka8NKl4nNz7BaKTzSgsLCzWbvyo4eK9r15WwLKRAmmCXXDoA1kaG2F4jWFbgkxUnlcrB/xj5iHxFPiBN4JekY4nZ6ccOiQ87hgwhe+TOdogT1nfpgEDTvYAucIwHxBfNyhpGrR+F8x00WD33VCNTOr/Wd+9C51Ben7S0ZJUq3qZJ2OkZz+cL87ZfWuePlwRcHZjeUMxFwTrJZAJfSvyWZc1VgORTY8rBcubetdiOk+CO+jPOcCRTF+oZ0okUIyuQeSNL/lPrulg8flhmJHmE2gBpE9xrJNkwpN4rQIIyujGoELCQz8ggG38iGzjKkXufJ2Klun1iu65bnJub2yut3xbEK3UvsDEInCmvA6YjMeE1bCn8F9JBe1eAnS2JksmkIlEDfi8R46kkEkMWdqOv+AvS9rcp2bvk8OAESvgox7h4aWNMLd32jSMLvuwDAwORSE7Oe3ZRKrFwvYGrPOBJ2nZ20Op/mqKNzgraOTPt6Bnx5citUINIczX/jUw3xGL2+ia8KAvsvp0ePoL5hXkXO5YvQYSFAiqcJX8E/gyX8QUvv8eh9XUq3h7mE9tLJoNKqnhHXmCO+dtJ4ybSkH1jc9XRaHTMz1tATBe2UEkeAdKu/zWIkUbZxD+veLxEQhhUFmbnvOezsJrk+zmqMo6vIL2OXzPvQ8v7dgtpoQnkF/LP8Ruu9zXdJHg4igAAAABJRU5ErkJgggA= - :target: https://www.fiware.org/developers/catalogue -.. figure:: https://img.shields.io/badge/tag-fiware-orange.svg?logo=stackoverflow - :target: http://stackoverflow.com/questions/tagged/fiware - -This project is part of `FIWARE `__ and has been made in collaboration with the `TM Forum `__. - -The Business API Ecosystem is a joint component made up of the FIWARE Business Framework and a set of APIs (and its -reference implementations) provided by the TMForum. This component allows the monetization of different kind of assets -(both digital and physical) during the whole service life cycle, from offering creation to its charging, accounting -and revenue settlement and sharing. The Business API Ecosystem exposes its complete functionality through TMForum -standard APIs; concretely, it includes the catalog management, ordering management, inventory management, -usage management, billing, customer, and party APIs. - -The Business API Ecosystem is not a single software repository, but it is composed of different projects which -work coordinately to provide the complete functionality. - -In particular, the Business API Ecosystem is made of the following components: - -* *Reference implementations of TM Forum APIs*: Reference implementation of the catalog management, ordering management, inventory management, usage management, billing, customer, and party APIs. -* *Business Ecosystem Charging Backend*: Is the component in charge of processing the different pricing models, the accounting information, and the revenue sharing reports. With this information, the Business Ecosystem Charging Backend is able to calculate amounts to be charged, charge customers, and pay sellers. -* *Business Ecosystem RSS*: Is in charge of distributing the revenues originated by the usage of a given service among the involved stakeholders. In particular, it focuses on distributing part of the revenue generated by a service between the Business API Ecosystem instance provider and the Service Provider(s) responsible for the service. With the term "service" we refer to both final applications and backend application services (typically exposed through an API). Note that, in the case of composite services, more than one service provider may have to receive a share of the revenues. -* *Business Ecosystem Logic Proxy*: Acts as the endpoint for accessing the Business API Ecosystem. On the one hand, it orchestrates the APIs validating user requests, including authentication, authorization, and the content of the request from a business logic point of view. On the other hand, it serves a web portal that can be used to interact with the system. - -The current documentation covers the Business API Ecosystem version 8.1.0, corresponding to FIWARE release 8. Any feedback on this document is highly welcomed, including bugs, -typos or things you think should be included but aren't. Please send them to the "Contact Person" email that appears in the -`Catalogue page for this GEi`_. Or create an issue at `GitHub Issues`_ - -.. _Catalogue page for this GEi: https://github.com/FIWARE/catalogue/tree/master/data-publication -.. _GitHub Issues: https://github.com/FIWARE-TMForum/Business-API-Ecosystem/issues/new - - -Index -===== - -:doc:`installation-administration-guide` - The guide for maintainers that explains how to install the BAE. - -:doc:`configuration-guide` - The guide for administrations which explains the different configuration options - -:doc:`user-guide` - The guide for users that explains how to use it. - -:doc:`programmer-guide` - The guide for programmers that explains how to develop plugins - -:doc:`plugins-guide` - The guide for admins that cover the available plugins - -.. _documentation: - -.. toctree:: - :maxdepth: 2 - :caption: Documentation - - installation-administration-guide - configuration-guide - user-guide - programmer-guide - plugins-guide diff --git a/doc/installation-administration-guide.md b/doc/installation-administration-guide.md new file mode 100644 index 0000000..eada4e1 --- /dev/null +++ b/doc/installation-administration-guide.md @@ -0,0 +1,358 @@ +# Installation and Administration Guide + +This guide explains how to deploy the Business API Ecosystem (BAE) with Docker, Docker Compose, or Kubernetes. All +components are distributed as container images; use them for development environments as well as for production. + +The configuration of each component is described in the [Configuration Guide](configuration-guide.md), and the +settings managed through the web interface in the [Administrator Guide](admin-guide.md). + + +(component-versions)= +## Component versions + +This guide and the reference deployment files use the versions of the release `2026.12.01`, generated from the +project's [stack definition](https://github.com/FIWARE-TMForum/Business-API-Ecosystem/blob/master/stack.yaml): + +| Component | Version | Image | +| --- | --- | --- | +| Logic Proxy | 12.0.0 | `fiware/biz-ecosystem-logic-proxy:12.0.0` | +| BAE Frontend | 3.0.0 | Included in the Logic Proxy image | +| Charging Backend | 12.0.0 | `fiware/biz-ecosystem-charging-backend:12.0.0` | +| TM Forum APIs | 2.2.1 | `quay.io/fiware/tmforum-all-in-one:2.2.1` | + + +## Architecture + +A marketplace deployment is made of the following services: + +| Service | Image | Purpose | +| --- | --- | --- | +| Logic Proxy | `fiware/biz-ecosystem-logic-proxy` | Entry point of the marketplace. It serves the web frontend, authenticates users, and validates and forwards the requests to the other services. | +| Charging Backend | `fiware/biz-ecosystem-charging-backend` | Pricing, billing, payments, usage accounting, uploaded files, notifications, and plugins. | +| TM Forum APIs | `quay.io/fiware/tmforum-all-in-one`, or one `quay.io/fiware/tmforum-` image per API | Catalogs, inventories, orders, parties, bills, usage, quotes, and documents, stored in an NGSI-LD broker. | +| NGSI-LD broker | For example, `scorpiobroker/all-in-one-runner` with PostgreSQL, or Orion-LD with MongoDB | Storage of the TM Forum entities. | +| MongoDB | `mongo` | Databases of the Logic Proxy and the Charging Backend. | +| Identity provider | For example, `fiware/idm` (Keyrock) or Keycloak | User login and roles. | + +The frontend is included in the Logic Proxy image. Optional integrations, such as the +[TMF Search Engine](https://github.com/SEAMWARE/tmf-search-engine), the Quote Management service, the analytics +service, or a data space connector, are deployed separately and connected through the +[Configuration Guide](configuration-guide.md) and the [Administrator Guide](admin-guide.md). + +(installation-with-docker)= +## Docker images + +| Image | Registry | +| --- | --- | +| `fiware/biz-ecosystem-logic-proxy` | [Docker Hub](https://hub.docker.com/r/fiware/biz-ecosystem-logic-proxy/) | +| `fiware/biz-ecosystem-charging-backend` | [Docker Hub](https://hub.docker.com/r/fiware/biz-ecosystem-charging-backend/) | +| `quay.io/fiware/tmforum-all-in-one` and `quay.io/fiware/tmforum-` | [Quay](https://quay.io/organization/fiware) | + +Use the tags listed in [Component versions](#component-versions). The images are configured through environment variables, as +described in the [Configuration Guide](configuration-guide.md). + +### Persistent data + +Mount persistent storage for: + +| Service | Path or data | +| --- | --- | +| Charging Backend | `/opt/business-ecosystem-charging-backend/src/media`: uploaded files and generated invoices, in the `assets` and `bills` subdirectories. | +| Charging Backend | `/opt/business-ecosystem-charging-backend/src/wstore/asset_manager/resource_plugins/plugins`: installed plugins. All the Charging Backend replicas must share it. | +| Charging Backend | `/opt/business-ecosystem-charging-backend/src/plugins`: optional directory to provide plugin packages to the command-line tools. | +| MongoDB | Its data directory, which holds the Logic Proxy and Charging Backend databases, including the settings saved through Administration. | +| NGSI-LD broker | The broker's database, which holds all the TM Forum entities. | +| Identity provider | Its database, with the users, organizations, applications, and roles. | + +The Logic Proxy does not need persistent storage. Its `/opt/business-ecosystem-logic-proxy/themes` directory is only +used by the legacy portal; see [Selecting the theme](configuration-guide.md#selecting-the-theme). + +(installation-with-docker-compose)= +## Docker Compose + +The repository includes a reference Compose file in +[`docker/compose`](https://github.com/FIWARE-TMForum/Business-API-Ecosystem/tree/master/docker/compose). It deploys +the Logic Proxy, the Charging Backend, the all-in-one TM Forum APIs with the Scorpio broker, MongoDB, and FIWARE +Keyrock as identity provider, with the default BAE theme. Quotes, tenders, analytics, and search are disabled until +their services are deployed. + +Requirements: + +- [Docker](https://docs.docker.com/engine/install/) with [Docker Compose](https://docs.docker.com/compose/install/) v2. +- About 6 GB of memory for the containers. + +### 1. Prepare the configuration + +Copy the files of `docker/compose` and create the `.env` file from the example: + +```bash +cd docker/compose +cp .env.example .env +``` + +| Variable | Purpose | +| --- | --- | +| `BAE_PUBLIC_URL` | Public URL of the marketplace, used by the browser. Default: `http://proxy.docker:8004`. | +| `BAE_PORT` | Host port of the Logic Proxy. | +| `IDM_PUBLIC_URL` | URL of Keyrock. It must be reachable both by the browser and by the Logic Proxy container. Default: `http://idm.docker:3000`. | +| `IDM_PORT` | Host port of Keyrock. | +| `IDM_DB_PASSWORD`, `IDM_ADMIN_EMAIL`, `IDM_ADMIN_PASSWORD` | Keyrock database password and initial administrator account. | +| `OAUTH2_CLIENT_ID`, `OAUTH2_CLIENT_SECRET`, `OIDC_KEY` | Credentials of the marketplace application in Keyrock, completed in step 3. | +| `PROXY_VERSION`, `CHARGING_VERSION`, `TMF_VERSION` | Image tags. The defaults are the [component versions](#component-versions). | + +The default URLs use the `proxy.docker` and `idm.docker` host names, which are also the names of the services inside +the Compose network. For a local deployment, map them to your machine in the hosts file (`/etc/hosts` on Linux and +macOS): + +```text +127.0.0.1 proxy.docker idm.docker +``` + +### 2. Start the services + +```bash +docker compose up -d +docker compose ps +``` + +The first start takes a few minutes while the databases and the TM Forum APIs initialize. The Charging Backend waits +until the TM Forum APIs answer. + +### 3. Register the marketplace in the identity provider + +1. Open Keyrock at `IDM_PUBLIC_URL` and sign in with `IDM_ADMIN_EMAIL` and `IDM_ADMIN_PASSWORD`. +2. Register a new application, with `BAE_PUBLIC_URL` as **URL** and `BAE_PUBLIC_URL/auth/fiware/callback` as + **Callback URL**. Select the *Authorization Code* and *Refresh Token* grant types. +3. Create the application roles `admin`, `seller`, `customer`, and `orgAdmin`, and assign them to the users and + organizations; see [Identity Management](configuration-guide.md#identity-management). +4. Enable OpenID Connect for the application and copy its JWT secret. +5. Set `OAUTH2_CLIENT_ID` and `OAUTH2_CLIENT_SECRET` to the application's OAuth2 credentials, and `OIDC_KEY` to the + JWT secret, in `.env`. +6. Apply the changes: + + ```bash + docker compose up -d proxy + ``` + +Open `BAE_PUBLIC_URL` in the browser and sign in. A user with the `admin` role can then complete the marketplace +setup in **Administration**, starting with the default catalog and the categories; see the +[Administrator Guide](admin-guide.md). + +### Operation + +| Task | Command | +| --- | --- | +| View the logs of a service | `docker compose logs -f proxy` | +| Stop the deployment | `docker compose down` | +| Stop it and delete all data | `docker compose down -v` | +| Upgrade | Update the versions in `.env`, then run `docker compose pull` and `docker compose up -d`. | + +To adapt the deployment, add the variables of the [Configuration Guide](configuration-guide.md) to the services +of the Compose file. For example, set `BAE_CB_PAYMENT_METHOD` and the provider credentials to enable payments, or +connect another identity provider. For a production deployment: + +- Publish the Logic Proxy through a reverse proxy or ingress with TLS, and set `BAE_PUBLIC_URL` to its public URL. +- Do not publish the ports of the other services. +- Replace the example passwords, and use an identity provider deployment suited for production. +- Back up the volumes of MongoDB, the broker database, and the Charging Backend. + +(installation-with-kubernetes)= +## Kubernetes + +The Business API Ecosystem is deployed in Kubernetes with the Helm charts of the +[FIWARE Helm charts repository](https://github.com/FIWARE/helm-charts): + +| Chart | Deploys | +| --- | --- | +| [`business-api-ecosystem`](https://github.com/FIWARE/helm-charts/tree/main/charts/business-api-ecosystem) | The Logic Proxy and the Charging Backend. | +| [`tm-forum-api`](https://github.com/FIWARE/helm-charts/tree/main/charts/tm-forum-api) | The TM Forum APIs, as one all-in-one deployment or one deployment per API. | + +The same repository provides charts for the other services, such as +[`scorpio-broker-aaio`](https://github.com/FIWARE/helm-charts/tree/main/charts/scorpio-broker-aaio) or +[`orion`](https://github.com/FIWARE/helm-charts/tree/main/charts/orion) for the broker, and +[`keyrock`](https://github.com/FIWARE/helm-charts/tree/main/charts/keyrock) for the identity provider. Deploy MongoDB +with the chart or operator of your choice. + +Requirements: + +- A Kubernetes cluster and [Helm](https://helm.sh/) 3. +- MongoDB, an NGSI-LD broker, and an identity provider reachable from the cluster. +- An ingress controller, or OpenShift routes, to publish the marketplace. + +Add the chart repository: + +```bash +helm repo add fiware https://fiware.github.io/helm-charts +helm repo update +``` + +### 1. Deploy the TM Forum APIs + +The following values deploy the all-in-one APIs connected to a Scorpio broker, with the configuration described in +[Configuring the TMF APIs](configuration-guide.md#configuring-the-tmf-apis). With `fullnameOverride: tm-forum-api`, +the APIs are available in the cluster at `http://tm-forum-api-svc:8080`. + +```yaml +# tmf-values.yaml +fullnameOverride: tm-forum-api +allInOne: + enabled: true + image: + tag: "2.2.1" # stack: apis +defaultConfig: + serverHost: http://tm-forum-api-svc:8080 + ngsiLd: + url: http://scorpio:9090 + additionalEnvVars: + - name: API_EXTENSION_ENABLED + value: "true" + - name: MICRONAUT_ENVIRONMENTS + value: scorpio,in-memory + - name: GENERAL_NGSILD_OR_QUERY_VALUE + value: "|" + - name: GENERAL_NGSILD_OR_QUERY_KEY + value: "|" + - name: GENERAL_INCLUDE_ATTRIBUTE_IN_LIST + value: "true" + - name: GENERAL_ENCLOSE_QUERY + value: "true" +``` + +```bash +helm install tmf fiware/tm-forum-api -n marketplace --create-namespace -f tmf-values.yaml +``` + +`allInOne.image.tag` selects the API release; without it, the chart's `appVersion` is used. See the chart's +README for its other options, such as the broker read timeout (`defaultConfig.ngsiLd.readTimeout`), caches, or +ingress. + +### 2. Deploy the marketplace + +The following values deploy the Logic Proxy and the Charging Backend, connected to the APIs above, to a MongoDB +service named `mongodb`, and to a Keyrock instance, and publish the marketplace through an ingress: + +```yaml +# bae-values.yaml +externalUrl: https://marketplace.example.org + +oauth: + provider: fiware + server: https://idm.example.org + clientId: + clientSecret: + callbackPath: /auth/fiware/callback + oidc: true + adminrole: admin + sellerrole: seller + customerrole: customer + orgadminrole: orgAdmin + +tmForum: + catalog: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/productCatalogManagement/v4} + resources: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/resourceCatalog/v4} + services: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/serviceCatalogManagement/v4} + inventory: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/productInventory/v4} + resourceInventory: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/resourceInventoryManagement/v4} + serviceInventory: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/serviceInventory/v4} + party: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/party/v4} + customer: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/customerManagement/v4} + ordering: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/productOrderingManagement/v4} + billing: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/accountManagement/v4} + customerBill: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/customerBillManagement/v4} + usage: {host: tm-forum-api-svc, port: 8080, path: /tmf-api/usageManagement/v4} + +bizEcosystemLogicProxy: + statefulset: + image: + tag: "12.0.0" # stack: proxy + nodeEnvironment: production + collectStaticCommand: "False" + db: {host: mongodb, port: 27017, user: bae, password: , database: belp_db} + purchaseEnabled: true + dataSpaceEnabled: true + ingress: + enabled: true + hosts: + - host: marketplace.example.org + paths: ["/"] + +bizEcosystemChargingBackend: + deployment: + image: + tag: "12.0.0" # stack: charging + db: {host: mongodb, port: 27017, user: bae, password: , database: charging_db} + payment: + method: "None" + extraEnvVars: + - name: BAE_CB_BILLING_ENGINE + value: local +``` + +```bash +helm install bae fiware/business-api-ecosystem -n marketplace -f bae-values.yaml +``` + +Register the marketplace in the identity provider as described for [Docker Compose](#3-register-the-marketplace-in-the-identity-provider), +using `externalUrl` as the application URL and `externalUrl/auth/fiware/callback` as callback URL. + +The chart's README lists all its values. Take into account: + +- **Image versions.** The charts deploy the image versions of their own release by default. Set the image tags to the + [component versions](#component-versions), as in the examples. + +- **Feature defaults.** The chart sets the feature switches of the Logic Proxy, such as `purchaseEnabled`, + `quoteEnabled`, `tenderingEnabled`, or `dataSpaceEnabled`, to `false` unless they are set in the values. As described + in [Settings managed through Administration](configuration-guide.md#settings-managed-through-administration), they + are only defaults; marketplace administrators can change them in **Administration → Features**. +- **Local billing.** The chart does not set `BAE_CB_BILLING_ENGINE`. Set it to `local` through + `bizEcosystemChargingBackend.extraEnvVars`, as in the example, so that the billing, payment, and usage collection + jobs are scheduled. +- **Other settings.** Use `bizEcosystemChargingBackend.extraEnvVars` (or `extraEnvVarsSecret` for sensitive values) + for Charging Backend variables without a chart value. The Logic Proxy settings are limited to the chart values. +- **Theme.** The default BAE theme is applied without configuration. The chart only sets `BAE_LP_THEME` when + `bizEcosystemLogicProxy.theme.enabled` is `true`, which also copies a legacy portal theme from the image set in + `theme.image`. +- **Secrets.** Set `bizEcosystemLogicProxy.existingSecret` and `bizEcosystemChargingBackend.existingSecret` to read + the passwords and client secrets from existing Kubernetes Secrets instead of the values. +- **Persistence.** The Charging Backend files are stored in the PVC of `bizEcosystemChargingBackend.media`. Enable + `bizEcosystemChargingBackend.plugins` to keep the installed plugins in a PVC. +- **Unused values.** `bizEcosystemLogicProxy.elastic.*` configures a legacy index and has no effect. + +To upgrade, update the chart repository and run `helm upgrade` with the same values files. + +## Installing plugins + +Plugins can be installed from **Administration → Plugins** in the web interface or with the Charging Backend's +management commands. See [Managing plugins](plugins-guide.md#managing-plugins) in the Plugins Guide. + +## Sanity check procedures + +The sanity checks verify that an installation is ready to be tested. + +### Services + +Check that all the services are running: `docker compose ps` or `kubectl get pods -n marketplace`. Then check the +Logic Proxy and its connection to the TM Forum APIs, replacing the URL with `BAE_PUBLIC_URL` or `externalUrl`: + +```bash +curl -s -o /dev/null -w '%{http_code}\n' https://marketplace.example.org/config +curl -s -o /dev/null -w '%{http_code}\n' "https://marketplace.example.org/catalog/productOffering?limit=1" +``` + +Both requests must return `200`. In the logs of the Charging Backend, check that it connected to MongoDB and that +`Customer bill webhook listener started successfully` is reported. + +### End-to-end test + +This test requires an identity-provider user with the `admin` and `seller` roles. + +1. Open the marketplace in the browser. The home page of the marketplace is displayed. +2. Select **Login**, and sign in with the user in the identity provider. +3. Open the user menu and check that it includes **My Offerings**, and **Administration** for the personal session. + + ![User menu with the marketplace sections](images/installation/sanity-user-menu.png) + +4. Open **My Offerings → Catalogues** and create a catalogue with a name and a description. +5. Check that the new catalogue is listed. + + ![Catalogue list in My Offerings](images/installation/sanity-catalogues.png) diff --git a/doc/installation-administration-guide.rst b/doc/installation-administration-guide.rst deleted file mode 100644 index 2692eef..0000000 --- a/doc/installation-administration-guide.rst +++ /dev/null @@ -1,440 +0,0 @@ -===================================== -Installation and Administration Guide -===================================== - -This guide covers the installation of the Business API Ecosystem (BAE) version 8.1.0. The recommended procedure for the -installation of the Business API Ecosystem is using Docker and the Docker images available in Docker Hub. - ------------------------- -Installation with Docker ------------------------- - -The installation with Docker requires the following: - -* `Docker `__ -* `Docker Compose `__ - -As stated, the Business API Ecosystem in made up of a set of different components which work jointly in order to provide -the functionality. In this regard the following images have been defined: - -* fiware/biz-ecosystem-apis: This image includes all the TMForum APIs and can be found in `Docker Hub `__ -* fiware/biz-ecosystem-charging-backend: This image includes the Charging Backend component and can be found in `Docker Hub `__ -* fiware/biz-ecosystem-logic-proxy: This image includes the Logic Proxy component and can be found in `Docker Hub `__ -* fiware/biz-ecosystem-rss: This Image include the Revenue Sharing Component and can be found in `Docker Hub `__ - -Local BAE deployment -==================== - -The easiest way to deploy the Business API Ecosystem with Docker is using *Docker Compose*. There have been created -a docker compose file that allows to deploy the Business API Ecosystem locally. -Such a file can be found `here `__ - -The local BAE repository deploys all the BAE components as well as a Keyrock instance that can be used as IDM. -By default, local BAE requires an external network called *bae* that will be used by the different BAE components -for communications. That network can be created with the following command: :: - - docker network create bae - -As an alternative, local BAE can be configured using the bridge driver, meaning that the different components -will be assigned a port in the host machine and a local IP to access them. The bridge mode can be enabled -uncommeting driver and IP configuration: :: - - networks: - bae: - name: bae - external: false - driver: bridge - ipam: - config: - - subnet: 10.2.0.0/16 - -The BAE can be launched with: :: - - docker compose up -d - -And terminated with: :: - - docker compose down - -The local BAE repository includes database initializations that will create a Marketplace application within Keyrock -and having some pre-configured settings. In this regard, the local BAE will be ready to use in a local environment -without further configuration. - -As soon as the Logic Proxy component of the BAE is healthy, the marketplace page can be accessed in the 8004 of the -host machine. The login can be done through the pre-configured Keyrock IDP using the initial test credentials: :: - - Username: admin@test.com - Password: admin - -New users can be created directly in the Keyrock instance available in the port 8080 of the host machine. - -The configuration of the BAE can be updated using environment variables by updating the .env file or the -environment files included in envs/ directory. For details on the different configuration options please -refer to the - -:doc:`configuration-guide` - -Data storage -============ - -The different images used as part of the Business API Ecosystem provide several volumes. Following -it is described the different options available in each image. - -The **biz-ecosystem-logic-proxy** image defines 2 volumes. In particular: - -* */business-ecosystem-logic-proxy/themes*: This volume includes the different themes that can be used to customize the portal -* */business-ecosystem-logic-proxy/static*: This volume includes the static files ready to be rendered including the selected theme and js files - -Additionally, the **biz-ecosystem-logic-proxy** image defines two environment variables intended to optimize the production deployment of the BAE Logic proxy: - -* *NODE_ENV*: Specifies whether the system is in *development* or in *production* (default: development) -* *COLLECT*: Specifies if the container should execute the collect static command to generate static files or use the existing on start up (default: True) - -On the other hand, the **biz-ecosystem-charging-backend** image defines 4 volumes. In particular: - -* */business-ecosystem-charging-backend/src/media/bills*: This directory contains the PDF invoices generated by the Business Ecosystem Charging Backend -* */business-ecosystem-charging-backend/src/media/assets*: This directory contains the different digital assets uploaded by sellers to the Business Ecosystem Charging Backend -* */business-ecosystem-charging-backend/src/plugins*: This directory is used for providing asset plugins (see section *Installing Asset Plugins*) -* */business-ecosystem-charging-backend/src/wstore/asset_manager/resource_plugins/plugins*: This directory includes the code of the plugins already installed - - -Installing Asset Plugins -======================== - -As you may know, the Business API Ecosystem is able to sell different types of digital assets -by loading asset plugins in its Charging Backend. In this context, it is possible to install -asset plugins in the current Docker image as follows: - -1) Copy the plugin file into the host directory of the volume */business-ecosystem-charging-backend/src/plugins* - -2) Access the running container: :: - - docker exec -i -t your-container bash - - -3) Go to the installation directory :: - - cd /business-ecosystem-charging-backend/src - - -4) Load the plugin :: - - python3 manage.py loadplugin ./plugins/pluginfile.zip - - -5) Restart the docker image :: - - docker compose restart bae-charging - -------------------- -Manual Installation -------------------- - -Requirements -============ - -As described in the GEri overview, the Business API Ecosystem is not a single software, but a set of projects that -work together for providing business capabilities. In this regard, this section contains the basic dependencies of -the different components that made up the Business API Ecosystem. - -TM Forum APIs and RSS requirements ----------------------------------- - -* Java 8 -* Glassfish 4.1 -* MySQL 5.7 - -Charging Backend requirements ------------------------------ - -* Python 3.9 -* MongoDB 4.4+ -* wkhtmltopdf - -Logic Proxy requirements ------------------------- - -* NodeJS 16+ (Including NPM) -* Elasticsearch 7.5+ - - -Installation -============ - - -Installing TM Forum APIs ------------------------- - -The different reference implementations of the TM Forum APIs used in the Business API Ecosystem are available in GitHub: - -* `Catalog Management API `__ -* `Product Ordering Management API `__ -* `Product Inventory Management API `__ -* `Party Management API `__ -* `Customer Management API `__ -* `Billing Management API `__ -* `Usage Management API `__ - -The installation for all of them is similar. The first step is cloning the repository and moving to the correct release :: - - $ git clone https://github.com/FIWARE-TMForum/DSPRODUCTCATALOG2.git - $ cd DSPRODUCTCATALOG2 - -Once the software has been downloaded, it is needed to create the connection to the database. To do that, the first step -is editing the *src/main/resources/META-INF/persistence.xml* to have something similar to the following: :: - - - - - jdbc/pcatv2 - false - - - - - - - -Note that you should provide in the tag *jta-data-source* the name you want for your database connection resource, taking into account -that it must be unique for each API. - -The next step is creating the database for you API. :: - - $ mysql-u -p "CREATE DATABASE IF NOT EXISTS " - -.. note:: - You have to provide your own credentials and the selected database name to the previous command. - -Once that the database has been created, the next step is creating the connection pool in Glassfish. To do that, you can -use the following command: :: - - $ asadmin create-jdbc-connection-pool --restype java.sql.Driver --driverclassname com.mysql.jdbc.Driver --property user=:password=:URL=jdbc:mysql://:/ - -.. note:: - You have to provide you own database credentials, the database host, the database port, the database name of the one created previously, and a name for your pool - -The last step for creating the database connection is creating the connection resource. To do that, execute the following command: :: - - $ asadmin create-jdbc-resource --connectionpoolid - -.. note:: - You have to provide the name of the pool you have previously created and a name for your resource, which has to be the same - as the included in the *jta-data-source* tag of the *persistence.xml* file of the API. - -When the database connection has been created, the next step is compiling the API sources with Maven :: - - $ mvn install - -Finally, the last step is deploying the generated war file in Glassfish :: - - $ asadmin deploy --contextroot --name target/ - -.. note:: - You have to provide the wanted context root for the API, a name for it, and the path to the war file - -Installing the RSS ------------------- - -The RSS sources can be found in `GitHub `__ - -The first step for installing the RSS component is downloading it and moving to the correct release :: - - $ git clone https://github.com/FIWARE-TMForum/business-ecosystem-rss.git - $ cd business-ecosystem-rss - $ git checkout v8.0.0 - -Then, the next step is coping, *database.properties* and *oauth.properties* files to its default location at */etc/default/rss* :: - - $ sudo mkdir /etc/default/rss - $ sudo chown : /etc/default/rss - $ cp properties/database.properties /etc/default/rss/database.properties - $ cp properties/oauth.properties /etc/default/rss/ouath.properties - -.. note:: - You have to include your user when changing *rss* directory owner - -Once the properties files have been copied, they should be edited in order to provide the correct configuration params: - -database.properties :: - - database.url=jdbc:mysql://localhost:3306/RSS - database.username=root - database.password=root - database.driverClassName=com.mysql.jdbc.Driver - -oauth.properties :: - - config.grantedRole=Provider - config.sellerRole=Seller - config.aggregatorRole=aggregator - -.. note:: - The different params included in the configuration file are explained in detail in the Configuration section - -Once the properties files have been edited, the next step is compiling the sources with Maven :: - - $ mvn install - -Finally, the last step is deploying the generated war file in Glassfish :: - - $ asadmin deploy --contextroot DSRevenueSharing --name DSRevenueSharing fiware-rss/target/DSRevenueSharing.war - -Installing the Charging Backend -------------------------------- - -The Charging Backend sources can be found in `GitHub `__ - -The first step for installing the charging backend component is downloading it and moving to the correct release :: - - $ git clone https://github.com/FIWARE-TMForum/business-ecosystem-charging-backend.git - $ cd business-ecosystem-charging-backend - -Once the code has been downloaded, it is recommended to create a virtualenv for installing python dependencies (This is not mandatory). :: - - $ virtualenv virtenv - $ source virtenv/bin/activate - -To install python dependecies use pip tool :: - - $ pip3 install -r requirements.txt - -If you are planning to run the tests or develop, you should install the development dependecies: :: - - $ pip3 install -r dev-requirements.txt - - -Installing the Logic Proxy --------------------------- - -The Logic Proxy sources can be found in `GitHub `__ - -The first step for installing the logic proxy component is downloading it and moving to the correct release :: - - $ git clone https://github.com/FIWARE-TMForum/business-ecosystem-logic-proxy.git - $ cd business-ecosystem-logic-proxy - -Once the code has been downloaded, Node dependencies can be installed with NPM :: - - $ npm install - - -Final steps -=========== - -Media and Indexes ------------------ - -The Business API Ecosystem, allows to upload some product attachments and assets to be sold. These assets are uploaded -by the Charging Backend that saves them in the file system, jointly with the generated PDF invoices. - -In this regard, the directories *src/media*, *src/media/bills*, and *src/media/assets* must exist within the Charging Backend directory, and must -be writable by the user executing the Charging Backend. :: - - $ mkdir src/media - $ mkdir src/media/bills - $ mkdir src/media/assets - $ chown -R : src/media - -Additionally, the Business API Ecosystem uses Elasticsearch indexes for efficiency and pagination. You can populate at any time the indexes -directory using the *fill_indexes.js* script provided with the Logic Proxy. :: - - $ node fill_indexes.js - -Running the Business API Ecosystem -================================== - -Running the APIs and the RSS ----------------------------- - -Both the TM Forum APIs and the RSS are deployed in Glassfish; in this regard, the only step for running them is starting -Glassfish :: - - $ asadmin start-domain - -Running the Charging Backend ----------------------------- - -The Charging Backend creates some objects and connections on startup; in this way, the Glassfish APIs must be up an running -before starting it. - -**Using Django runserver** - -The Charging Backend can be started using the *runserver* command provided with Django as follows :: - - $ python3 manage.py runserver 127.0.0.1: - -.. note:: - If you have created a virtualenv when installing the backend or used the installation script, you will need to activate the - virtualenv before starting the Charging Backend - -**Using Gunicorn** - -The Charging Backend can be deployed in production using Gunicorn. To do that execute the following command :: - - $ gunicorn wsgi:application --workers 1 --forwarded-allow-ips "*" --log-file - --bind 0.0.0.0:8006 --log-level INFO - - -Running the Logic Proxy ------------------------ - -The Logic Proxy can be started using Node as follows :: - - $ node server.js - ------------------------ -Sanity check Procedures ------------------------ - -The Sanity Check Procedures are the steps that a System Administrator will take to verify that an installation is ready -to be tested. This is therefore a preliminary set of tests to ensure that obvious or basic malfunctioning is fixed before -proceeding to unit tests, integration tests and user validation. - -End to End Testing -================== - -Please note that the following information is required before starting with the process: -* The host and port where the Proxy is running -* A valid IdM user with the *Seller* role - -To Check if the Business API Ecosystem is running, follow the next steps: - -1. Open a browser and enter to the Business API Ecosystem -2. Click on the *Sign In* Button - -.. image:: ./images/installation/sanity1.png - -3. Provide your credentials in the IdM page - -.. image:: ./images/installation/sanity2.png - -4. Go to the *Revenue Sharing* section - -.. image:: ./images/installation/sanity3.png - -5. Ensure that the default RS Model has been created - -.. image:: ./images/installation/sanity4.png - -6. Go to *My Stock* section - -.. image:: ./images/installation/sanity5.png - -7. Click on *New* for creating a new catalog - -.. image:: ./images/installation/sanity6.png - -8. Provide a name and a description and click on *Next*. Then click on *Create* - -.. image:: ./images/installation/sanity7.png -.. image:: ./images/installation/sanity8.png -.. image:: ./images/installation/sanity9.png - -9. Click on *Launched*, and then click on *Update* - -.. image:: ./images/installation/sanity10.png -.. image:: ./images/installation/sanity11.png - -10. Go to *Home*, and ensure the new catalog appears - -.. image:: ./images/installation/sanity12.png -.. image:: ./images/installation/sanity13.png diff --git a/doc/plugins-guide.md b/doc/plugins-guide.md new file mode 100644 index 0000000..4972075 --- /dev/null +++ b/doc/plugins-guide.md @@ -0,0 +1,521 @@ +# Plugins Guide + +Plugins extend the Business API Ecosystem with new types of services and resources. A plugin defines: + +- the **metadata** that providers fill in when they create a service or resource specification of that type; +- whether the specification needs an uploaded **file**, and which media types are accepted; +- Python **handlers** that the Charging Backend runs during the life cycle of specifications, products, offerings, and + purchased services or resources. Handlers can validate data, provision access for a buyer, react to renewals and + terminations, and collect usage information. + +Each installed plugin is published as a category in the Service Catalog (service plugins) or the Resource Catalog +(resource plugins). A specification uses a plugin by referencing that category in its **Service Type** or +**Resource Type** characteristic. + +This guide is divided into three parts: + +- [Developing plugins](#developing-plugins): the package structure, the `package.json` manifest, and the plugin class + and its handlers. +- [Managing plugins](#managing-plugins): installing, upgrading, downgrading, and removing plugins. +- [Plugin metadata in service and resource forms](#plugin-metadata-in-service-and-resource-forms): how providers see + and complete the information defined by a plugin. + +The examples use two plugins: *Managed API Access*, a service plugin that collects the details of an API, and +*Dataset Package*, a resource plugin that requires a data file. + +(developing-plugins)= +## Developing plugins + +### Package structure + +A plugin is distributed as a ZIP package with: + +- a `package.json` manifest at the root of the archive; +- the Python modules that implement the plugin. The manifest's `module` field identifies the main class. + +For example: + +```text +managed-api-access-1.1.zip +├── package.json +└── managed_api.py +``` + +The package is extracted into its own directory in the Charging Backend, so modules can be organized in subdirectories +and import each other using paths relative to the root of the package. Third-party Python dependencies are not +installed with the plugin; they must already be available in the Charging Backend environment. + +The Charging Backend rejects archives that do not contain a root `package.json`, that contain absolute paths or paths +outside the installation directory, or that exceed the configured limits: + +| Limit | Environment variable | Default | +| --- | --- | --- | +| Uploaded package size (web and API installation) | `BAE_CB_MAX_UPLOAD_SIZE` | 52428800 (50 MiB) | +| Total size of the extracted files | `BAE_CB_PLUGIN_EXPANDED_MAX_BYTES` | 104857600 (100 MiB) | +| Number of entries in the archive | `BAE_CB_PLUGIN_ARCHIVE_MAX_ENTRIES` | 1000 | + +### The `package.json` manifest + +| Field | Required | Description | +| --- | --- | --- | +| `name` | Yes | Name of the service or resource type, shown to providers. It can contain letters, digits, underscores, spaces, and hyphens. The plugin ID is derived from it in lowercase, with spaces replaced by hyphens; for example, `Managed API Access` becomes `managed-api-access`. | +| `type` | Yes | `service` or `resource`. A plugin's type cannot change in later versions. | +| `author` | Yes | Author of the plugin. | +| `version` | Yes | Version made of numbers separated by dots, such as `1`, `1.1`, or `2.0.3`. | +| `module` | Yes | Main class, as `.` relative to the root of the package; for example, `managed_api.ManagedApiPlugin`. | +| `requires_file` | Yes | Boolean. When `true`, providers must upload a file when they create a specification of this type. | +| `media_types` | No | List of media types accepted for the file, such as `["application/zip", "text/csv"]`. An empty list accepts any type. | +| `form` | No | Metadata fields that providers fill in. See [Form fields](#form-fields). | +| `form_order` | No | List with the order in which the form fields are shown. If present, it must contain every key of `form`. | +| `pull_accounting` | No | Boolean, `false` by default. Set it to `true` when the Charging Backend must query the plugin for usage records. See [Usage accounting](#usage-accounting). | +| `overrides` | No | List of `NAME`, `VERSION`, or `OPEN`. The values are validated and stored for compatibility, but the current version does not use them. | + +The manifest of the *Managed API Access* example is: + +```json +{ + "name": "Managed API Access", + "type": "service", + "author": "Atlas Cloud Services", + "version": "1.1", + "module": "managed_api.ManagedApiPlugin", + "requires_file": false, + "media_types": [], + "pull_accounting": false, + "form_order": ["endpoint", "region", "auth_type", "usage_notes", "monitoring"], + "form": { + "endpoint": { + "type": "text", + "label": "API endpoint", + "placeholder": "https://api.example.eu/v1", + "mandatory": true + }, + "region": { + "type": "select", + "label": "Hosting region", + "mandatory": true, + "default": "eu-west", + "options": [ + {"text": "EU West", "value": "eu-west"}, + {"text": "EU Central", "value": "eu-central"} + ] + }, + "auth_type": { + "type": "select", + "label": "Authentication", + "mandatory": true, + "options": [ + {"text": "OAuth 2.0", "value": "oauth2"}, + {"text": "API key", "value": "api-key"} + ] + }, + "usage_notes": { + "type": "textarea", + "label": "Usage notes", + "placeholder": "Limits or conditions shown to the provider's operators" + }, + "monitoring": { + "type": "checkbox", + "label": "Enable monitoring", + "default": true + } + } +} +``` + +The *Dataset Package* example requires a file: + +```json +{ + "name": "Dataset Package", + "type": "resource", + "author": "Atlas Cloud Services", + "version": "1.0", + "module": "dataset.DatasetPlugin", + "requires_file": true, + "media_types": ["application/zip", "text/csv"], + "form_order": ["license", "records"], + "form": { + "license": { + "type": "select", + "label": "License", + "mandatory": true, + "options": [ + {"text": "CC BY 4.0", "value": "cc-by-4.0"}, + {"text": "Proprietary", "value": "proprietary"} + ] + }, + "records": { + "type": "text", + "label": "Number of records", + "placeholder": "e.g. 125000" + } + } +} +``` + +(form-fields)= +### Form fields + +Each key of `form` defines a field. The key is the characteristic name under which the value is stored in the +specification. It can contain letters, digits, underscores, spaces, and hyphens. The names `File`, `Service Type`, and +`Resource Type` are reserved. + +| Attribute | Field types | Description | +| --- | --- | --- | +| `type` | All | `text`, `textarea`, `select`, or `checkbox`. | +| `label` | All | Label shown in the form. The key is shown when no label is provided. | +| `mandatory` | All | Boolean. Providers must provide a value. | +| `default` | All | Initial value: a string, or a Boolean for `checkbox`. | +| `placeholder` | `text`, `textarea` | Hint shown in the empty field. | +| `options` | `select` | Required, nonempty list of `{"text": "...", "value": "..."}` entries. `text` is shown to the provider and `value` is stored. | + +When a specification is created or updated, the Charging Backend checks that: + +- every mandatory field is present; +- `checkbox` values are Booleans and the other values are strings; +- `select` values match one of the configured option values (case-insensitively); +- the `File` characteristic references a file uploaded by the same provider with one of the accepted media types, when + the plugin requires a file. + +### The plugin class + +The main class extends `ServicePlugin` for service plugins or `ResourcePlugin` for resource plugins: + +```python +from wstore.asset_manager.resource_plugins.plugin import ServicePlugin, ResourcePlugin +from wstore.asset_manager.resource_plugins.plugin_error import PluginError +``` + +All handlers are optional; the base classes implement them as no-ops. Override only the handlers your plugin needs. +The main class of the *Managed API Access* example validates the endpoint and records access changes: + +```python +from logging import getLogger +from urllib.parse import urlparse + +from wstore.asset_manager.resource_plugins.plugin import ServicePlugin +from wstore.asset_manager.resource_plugins.plugin_error import PluginError + +logger = getLogger("wstore.default_logger") + + +def _characteristic(service_spec, name): + for characteristic in service_spec.get("specCharacteristic", []): + if characteristic.get("name") == name: + values = characteristic.get("characteristicValueSpecification") or [{}] + return values[0].get("value") + return None + + +class ManagedApiPlugin(ServicePlugin): + def on_pre_service_spec_creation(self, provider, service_spec): + endpoint = _characteristic(service_spec, "endpoint") + if urlparse(str(endpoint)).scheme != "https": + raise PluginError("The API endpoint must be an https URL") + + on_pre_service_spec_update = on_pre_service_spec_creation + + def on_service_activation(self, provider, buyer, service, product, order, contract=None): + # Grant the buyer access to the API. Raise an exception if it fails, + # so that the product is not marked as active. + logger.info("Granting %s access to service %s", buyer.name, service["id"]) + + def on_service_termination(self, provider, buyer, service, product, order, contract=None): + logger.info("Revoking %s access to service %s", buyer.name, service["id"]) +``` + +To reject an operation, raise `PluginError` with a message for the provider. The Logic Proxy then rejects the +request with HTTP 422 and the message `Plugin Error: `; with the example above, creating a specification +with an `http://` endpoint fails with `Plugin Error: The API endpoint must be an https URL`. Other exceptions are +reported as server errors. + +### Handlers + +The Logic Proxy calls the Charging Backend when specifications, products, and offerings are written to the TM Forum +APIs, and the Charging Backend calls the handlers of the plugins involved. Handlers are only called for +specifications and instances whose type characteristic references an installed plugin. + +*Pre* handlers run before the write and can reject it. They run before the Charging Backend validates the form fields +and the file, so they receive the proposed document as submitted. *Post* handlers run after the TM Forum API has stored +the document and receive the stored document, including its `id`. An error in a post handler is reported, but it does +not undo the write. Neither phase is retried automatically. + +#### Specification handlers + +Service plugins implement the `service` variants and resource plugins the `resource` variants: + +| Handler | When it runs | +| --- | --- | +| `on_pre_service_spec_creation(provider, service_spec)`
`on_pre_resource_spec_creation(provider, resource_spec)` | Before a specification of the plugin's type is created. | +| `on_post_service_spec_creation(provider, service_spec)`
`on_post_resource_spec_creation(provider, resource_spec)` | After the specification is created. | +| `on_pre_service_spec_update(provider, service_spec)`
`on_pre_resource_spec_update(provider, resource_spec)` | Before a specification is updated, for example when it is edited or its status changes. | +| `on_post_service_spec_update(provider, service_spec)`
`on_post_resource_spec_update(provider, resource_spec)` | After the specification is updated. | + +The base classes also define `on_pre_*_spec_upgrade` and `on_post_*_spec_upgrade`. They are reserved for specification +version upgrades, which are not supported yet, and are not called. + +#### Product specification and offering handlers + +These handlers run for each service or resource specification of the plugin's type that is directly included in the +product specification. Both plugin classes use the same names; the second argument is the service or resource +specification. + +| Handler | When it runs | +| --- | --- | +| `on_pre_product_spec_creation(provider, spec, product_spec)` | Before a product specification is created. | +| `on_post_product_spec_creation(provider, spec, product_spec)` | After the product specification is created. | +| `on_pre_product_spec_update(provider, spec, product_spec)` | Before a product specification is updated. | +| `on_post_product_spec_update(provider, spec, product_spec)` | After the product specification is updated. | +| `on_pre_product_offering_creation(provider, spec, product_spec, product_offering)` | Before an offering is created, after its pricing has been validated. | +| `on_post_product_offering_creation(provider, spec, product_spec, product_offering)` | After the offering is created. | +| `on_pre_product_offering_update(provider, spec, product_spec, product_offering)` | Before an offering is updated, after its pricing has been validated. | +| `on_post_product_offering_update(provider, spec, product_spec, product_offering)` | After the offering is updated. | + +#### Purchased service and resource handlers + +These handlers run for the services and resources that realize a purchased product in the inventory: + +| Handler | When it runs | Effect of an error | +| --- | --- | --- | +| `on_service_activation(provider, buyer, service, product, order, contract=None)`
`on_resource_activation(provider, buyer, resource, product, order, contract=None)` | When an order with automatic procurement is completed, for new purchases (`add`) and for modifications (`modify`), before the product is set to active. | The product is not activated and the order item is not completed. Raise an exception when provisioning fails. | +| `on_service_renewal(provider, buyer, service, product, order, contract=None, *, customer_bill_id)`
`on_resource_renewal(...)` | When a recurring bill of the product is settled. | Logged; the bill is processed anyway. | +| `on_service_termination(provider, buyer, service, product, order, contract=None)`
`on_resource_termination(...)` | When the product is terminated, before the inventory is updated. | Logged; the termination continues. | +| `on_usage_refresh(provider, buyer, service, product, order, contract=None)` | When usage is collected for plugins with `pull_accounting`. See [Usage accounting](#usage-accounting). | The product is skipped in that billing run. | + +Activation handlers are not called for orders with manual procurement. They receive the updated product for both +purchases and modifications; check the `action` of the order item to distinguish them, and apply a modification to +the existing provisioning instead of creating it again. + +Renewal and termination notifications can be delivered more than once, for example when an operation is recovered. +Make handlers safe to repeat; renewal handlers can use `customer_bill_id` to detect a bill that was already processed. +Earlier successful handlers are not rolled back when a later one fails. + +#### Handler arguments + +| Argument | Content | +| --- | --- | +| `provider` | Organization model of the provider. In specification, product, and offering handlers, it is the organization of the user's current session. Useful fields are `name`, `actor_id` (party ID), `idp`, and `issuerDid`. | +| `buyer` | Organization model of the customer, with the same fields. | +| `service_spec`, `resource_spec`, `spec` | Service or resource specification document, in TM Forum JSON format. Form values are in `specCharacteristic` (services) or `resourceSpecCharacteristic` (resources). | +| `product_spec`, `product_offering` | Product specification and product offering documents, in TM Forum JSON format. | +| `service`, `resource` | Service or resource inventory instance that realizes the purchased product. | +| `product` | Inventory product document. | +| `order` | Product order document. In accounting handlers, it is the Charging Backend's local order. | +| `contract` | Charging Backend contract of the order item, when available; otherwise `None`. | +| `customer_bill_id` | ID of the settled CustomerBill that triggered the renewal. | + +#### Accessing the uploaded file + +For plugins with `requires_file`, the `File` characteristic contains the ID of a file uploaded to the Charging Backend. +A handler can read the stored file through the `Resource` model: + +```python +from bson import ObjectId +from wstore.asset_manager.models import Resource + +resource = Resource.objects.get(pk=ObjectId(file_id)) +path, media_type = resource.resource_path, resource.content_type +``` + +(usage-accounting)= +### Usage accounting + +Products with usage-based prices are charged with the usage records stored in the TM Forum Usage API. When a service +cannot push its usage, set `"pull_accounting": true` so that the Charging Backend queries the plugin. The plugin class +must then implement both methods below. If `pull_accounting` is `false`, the class must implement neither; otherwise, +the package is rejected. + +- `get_usage_specs()`: returns the metrics the plugin can measure, as a list of objects with `name` and `description`. + It is declarative: it does not create usage specifications. Providers create their own usage specifications and + link them to usage prices. +- `get_pending_accounting(instance, contract, order)`: returns the usage records not yet reported for a purchased + service or resource, as a list of `date`, `unit`, and `value` entries: + + ```python + [{"date": "2026-11-01T12:00:00Z", "unit": "api call", "value": 130}] + ``` + +For each record, `date` is an ISO 8601 date, `value` is a nonnegative number or numeric string, and `unit` must match +the unit of measure of a usage price of the purchased product. The usage specification of that price must declare a +characteristic with the same name. If several purchased usage specifications use the same unit, the record must also +include `usageSpecId`. The Charging Backend creates one usage document per record. + +Usage is collected: + +- every day by the `accounting_scheduler` command, which the Charging Backend schedules at midnight when it uses the + local billing engine (`BAE_CB_BILLING_ENGINE=local`); +- before a billing period of a usage price is billed; +- on demand, with a `POST /charging/api/orderManagement/accounting/refresh/` request with body + `{"productId": ""}`. + +Return only pending records: records returned twice are stored twice. Keep the default implementation of +`on_usage_refresh`, which calls `get_pending_accounting` and stores the records. + +### Example plugins + +The Charging Backend repository includes logging plugins in `examples/plugins` that implement every handler and log the +arguments they receive, together with a `build.py` script that creates their ZIP packages. They are a convenient +starting point and help check which handlers run for each operation. + +### Updating plugins from earlier versions + +The plugin interface replaced the former product-level asset plugins. Plugins written for earlier versions of the +Business API Ecosystem must be adapted and installed again: + +- Extend `ServicePlugin` or `ResourcePlugin` instead of `Plugin`, and add `type` and `requires_file` to the manifest. + The former `formats` field is no longer used. +- Move validation from `on_pre_product_spec_validation`, `on_post_product_spec_validation`, + `on_pre_product_offering_validation`, and `on_post_product_offering_validation` to the `*_creation` and `*_update` + handlers. +- Move the logic of `on_product_acquisition` and `on_product_suspension` to the activation and termination handlers. +- Implement `get_pending_accounting` with the new arguments; usage specifications are no longer created by plugins. + +(managing-plugins)= +## Managing plugins + +Plugins are managed in the Charging Backend. Only marketplace administrators can install and remove them. +Installing, upgrading, and removing a plugin takes effect immediately; the Charging Backend does not need to be +restarted. + +### From the web interface + +Marketplace administrators can install, upgrade, and remove plugins in **Administration → Plugins**. See +[Plugins](admin-guide.md#admin-plugins) in the Administrator Guide. + +### From the command line + +The Charging Backend provides management commands. Run them from the `src` directory of the Charging Backend, with the +Python environment where it is installed: + +| Command | Description | +| --- | --- | +| `python manage.py loadplugin ` | Installs a plugin, or upgrades it if the package has a newer version. Prints the plugin ID. | +| `python manage.py listplugins` | Lists the installed plugins with their name, type, and ID. | +| `python manage.py removeplugin ` | Removes a plugin. | +| `python manage.py downgradeplugin []` | Returns a plugin to a previously installed version. Without a version, it returns to the previous one. | +| `python manage.py syncplugincategories` | Creates the missing catalog categories of the installed plugins and prints the category of each one. | + +With the Docker image, copy the package into the container, or into the host directory mounted as +`/opt/business-ecosystem-charging-backend/src/plugins`, and run the command inside the container. The current image +installs the Charging Backend with `python3.9`: + +```console +$ docker cp managed-api-access-1.1.zip :/opt/business-ecosystem-charging-backend/src/plugins/ +$ docker exec -w /opt/business-ecosystem-charging-backend/src \ + python3.9 manage.py loadplugin plugins/managed-api-access-1.1.zip +Your plugin has been loaded with id: managed-api-access +$ docker exec -w /opt/business-ecosystem-charging-backend/src \ + python3.9 manage.py listplugins +Name: Managed API Access type: service id: managed-api-access +Name: Dataset Package type: resource id: dataset-package +``` + +Installed plugins are stored in `/opt/business-ecosystem-charging-backend/src/wstore/asset_manager/resource_plugins/plugins`. +Mount this directory as persistent storage, shared by all Charging Backend replicas. + +### From the API + +The web interface uses the following Charging Backend endpoints, available through the Logic Proxy: + +| Request | Description | +| --- | --- | +| `GET /charging/api/assetManagement/assetTypes` | Lists the installed plugins. Add `?type=service` or `?type=resource` to filter them. Available to any authenticated user. | +| `GET /charging/api/assetManagement/assetTypes/` | Returns a plugin's metadata, including its `categoryId`, `form`, `formOrder`, `requiresFile`, and `mediaTypes`. | +| `POST /charging/api/assetManagement/assetTypes/installJob` | Installs or upgrades a plugin. Send the ZIP package as the `file` part of a `multipart/form-data` request. Administrators only. | +| `DELETE /charging/api/assetManagement/assetTypes/` | Removes a plugin and returns HTTP 204. Administrators only. | + +### Versions, upgrades, and removal + +- Installing a package of an installed plugin upgrades it only if the package has a newer version; the same or an + older version is rejected. The plugin keeps its ID, type, and catalog category, so existing specifications keep + working with the new version. +- Previous versions are kept, so `downgradeplugin` can return to them. Downgrades are only available from the command + line. +- A plugin cannot be removed while service or resource specifications, or inventory instances, reference its category. + Removing a plugin deletes its category and its installed files; it does not remove usage specifications. +- Only one installation, upgrade, downgrade, or removal can run at a time, whether it is started from the web + interface, the API, or the command line. A concurrent request is rejected and can be retried later. +- If an installation or removal is interrupted, for example by a timeout, list the installed plugins before trying + again. + +(plugin-metadata-in-service-and-resource-forms)= +## Plugin metadata in service and resource forms + +Providers create service and resource specifications in **My Offerings → Services** or **Resources**. The installed +plugins of each type appear in the **Service type** or **Resource type** list of the **General Info** step. The default +option, **No service type** or **No resource type**, creates an ordinary specification that does not use a plugin. +Plugins without a catalog category are shown as unavailable and cannot be selected; run `syncplugincategories` to +create the missing categories. + +![General Info step of a new service specification with the Managed API Access service type selected](images/plugin/plugin-service-type.png) + +When a type is selected, the form adds a **Service details** or **Resource details** step between **General Info** and +**Configuration options**. The step shows the plugin's name and its fields, in the `form_order` order. Fields not +included in `form_order` are shown after the listed ones. + +![Service details step with the fields of the Managed API Access plugin, and a validation message on the mandatory API endpoint field](images/plugin/plugin-service-details-empty.png) + +The manifest attributes are shown as follows: + +| Manifest | Form | +| --- | --- | +| `label` | Field label. The field key is shown when there is no label. | +| `mandatory: true` | A red asterisk after the label. **Save and continue** stays disabled until all mandatory fields are completed, and an empty mandatory field shows *Enter a valid value for this field.* | +| `default` | Initial value of the field. In the example, **Hosting region** starts as *EU West* and **Enable monitoring** is checked. | +| `placeholder` | Hint in an empty text field, such as `https://api.example.eu/v1`. | +| `type: select` | A list with the `text` of each option, preceded by *Select an option*. | +| `type: checkbox` | A checkbox with the label next to it. | +| `type: textarea` | A multiline text field. | + +![Service details step completed](images/plugin/plugin-service-details.png) + +When the plugin requires a file, the details step starts with a **Service file** or **Resource file** field and lists +the accepted file types from `media_types`. The browser only offers files of those types. The file is uploaded to the +Charging Backend when the specification is saved. + +![Resource details step of the Dataset Package plugin with the Resource file field, the accepted types, and the plugin fields](images/plugin/plugin-resource-details.png) + +The **Configuration options** step does not show the plugin fields; it is used for the configurable characteristics of +the specification, as in an ordinary specification. + +![Configuration options step after completing the plugin details](images/plugin/plugin-service-config.png) + +When the specification is saved, the Logic Proxy calls the plugin's creation handlers and the Charging Backend +validates the values. If a handler raises `PluginError`, the specification is not created and the save fails with the +plugin's message. Once saved, the provider can keep it as a draft or validate it: + +![Dialog to save the specification as a draft or validate it](images/plugin/plugin-spec-save-dialog.png) + +### How the metadata is stored + +The plugin information is stored as characteristics of the specification: + +- **Service Type** or **Resource Type**, with the ID of the plugin's catalog category; +- **File**, with the ID of the uploaded file, when the plugin requires one; +- one characteristic per completed form field, named after the field key. Empty optional fields are not stored. + +For example, the service specification created above contains: + +```json +"specCharacteristic": [ + {"name": "Service Type", "characteristicValueSpecification": [{"value": "urn:ngsi-ld:service-category:8ef7dda5-956e-40ae-9060-714f4e0ea530"}]}, + {"name": "endpoint", "characteristicValueSpecification": [{"value": "https://api.atlas-cloud.eu/payments/v2"}]}, + {"name": "region", "characteristicValueSpecification": [{"value": "eu-west"}]}, + {"name": "auth_type", "characteristicValueSpecification": [{"value": "oauth2"}]}, + {"name": "usage_notes", "characteristicValueSpecification": [{"value": "Up to 50 requests per second per customer."}]}, + {"name": "monitoring", "characteristicValueSpecification": [{"value": true}]} +] +``` + +Resource specifications use `resourceSpecCharacteristic` and `resourceSpecCharacteristicValue` instead. + +When a provider edits a specification, the form loads the stored values. Changing or clearing the type replaces the +plugin characteristics; the other characteristics are kept. + +### Purchased services and resources + +When a product is purchased, the services and resources that realize it keep the plugin characteristics. In +**My Inventory**, the details page of such a service or resource includes a **Plugin information** tab. It shows the +plugin name as the type and each field with its `label` from the manifest. The uploaded file, if any, is shown +separately, and the remaining characteristics are listed in their own tab. diff --git a/doc/plugins-guide.rst b/doc/plugins-guide.rst deleted file mode 100644 index 814cd3f..0000000 --- a/doc/plugins-guide.rst +++ /dev/null @@ -1,625 +0,0 @@ -============= -Plugins Guide -============= - -This plugins guide covers the available plugins (defining digital asset types) for the Business API Ecosystem v7.8.0 - ------------------------- -Installing Asset Plugins ------------------------- - -The Business API Ecosystem is intended to support the monetization of different kind of digital assets. The different -kind of assets that may be wanted to be monetized will be heterogeneous and potentially very different between them. - -Additionally, for each type of asset different validations and activation mechanisms will be required. For example, if the -asset is a CKAN dataset, it will be required to validate that the provider is the owner of the dataset. Moreover, when a customer -acquires the dataset, it will be required to notify CKAN that a new user has access to it. - -The huge differences between the different types of assets that can be monetized in the Business API Ecosystem makes -impossible to include its validations and characteristics as part of the core software. For this reason, it has been created -a plugin based solution, where all the characteristics of an asset type are implemented in a plugin that can be loaded -in the Business API Ecosystem. - -To include an asset plugin execute the following command in the Charging Backend: :: - - $ ./manage.py loadplugin ckandataset.zip - -It is possible to list the existing plugins with the following command: :: - - $ ./manage.py listplugins - -To remove an asset plugin, execute the following command providing the plugin id given by the *listplugins* command :: - - $ ./manage.py removeplugin ckan-dataset - - -.. note:: - For specific details on how to create a plugin and its internal structure, have a look at the Business API Ecosystem Programmer Guide - -At the time of writing, the following plugins are available: - -* `Basic File `__: Allows the creation of products by providing files as digital assets. No validations or processing is done -* `Basic URL `__: Allows the creation of products by providing URLs as digital assets. No validations or processing is done -* `CKAN Dataset `__ : Allows the monetization of CKAN datasets -* `CKAN API Dataset `__ Allows the monetization of CKAN datasets whose resources are served by an external APIs (e.g NGSI Queries) secured with `API Umbrella `__. -* `Umbrella Service `__ Allows the monetization of services secured by API Umbrella with FIWARE IDM users and roles. -* `WireCloud Component `__: Allows the monetization of WireCloud components, including Widgets, operators, and mashups -* `Accountable Service `__ : Allows the monetization of services protected by the `Accounting Proxy `__, including Orion Context Broker queries - - ------------------ -Available Plugins ------------------ - -Basic File and Basic URL ------------------------- - -The *Basic File* and *Basic URL* plugins are available at `GitHub `__ -These plugins are intended to enable the creation of digital products in the Business API Ecosystem without the need -of specifying a particular type or validation process. In this regard, these plugins allow the publication of any file -or any URL as digital asset respectively, and can be used for the creation of simple file catalogs or for testing the -Business API Ecosystem. - -These plugins do not implement any event handler. - -CKAN Dataset and CKAN API Dataset ---------------------------------- - -The *CKAN Dataset* and *CKAN API Dataset* plugins are available in `GitHub `__. -These plugins define an asset type intended to manage and monetize datasets offered in a CKAN instance. In particular, -these plugins are able to validate the dataset, validate the rights of the seller creating a product specification to sell -the provided dataset, and manage the access to the dataset of those customers who acquire it. - -The difference between both plugins is the type of data included as a resource in the CKAN dataset. In particular, -*CKAN API Dataset* expects the data to be served by an external API secured with the FIWARE security framework. In this -regard, the *CKAN API Dataset* also validates the permissions of the seller in the data service and grants customers access to it -using the FIWARE IdM roles and permissions. - -Is important to notice that by default CKAN does not provide a mechanism to publish protected datasets or an API for -managing the access rights to the published datasets. In this regard, the CKAN instance to be monetized has to be extended -with the following CKAN plugins: - -* `ckanext-oauth2 `__: This extension allows to use an external OAuth2 Identity Manager - for managing CKAN users. In particular, this extension must be used, in this context, to authenticate users using the same - FIWARE IdM instance as the specific Business API Ecosystem instance, so both systems (CKAN and Business API Ecosystem) - share their users. -* `ckanext-privatedatasets `__: This extension allows to create - protected datasets in CKAN which can only be accessed by a set of users selected by the dataset owner. Moreover, this - extension exposes an API that can be used to add or remove authorized users from a dataset. - -In addition, if the `ckanext-storepublisher `__ plugin is installed -in CKAN, the *CKAN dataset* or *CKAN API Dataset* plugin must be installed in the Business API Ecosystem, since the aforementioned CKAN extension -uses the *CKAN Dataset* or *CKAN API Dataset* asset type (depending on the dataset resource) for creating product specifications. - -The *CKAN Dataset* plugin only allows to provide the asset with a URL that must match the dataset URL in CKAN. - -.. image:: ./images/plugin/ckan1.png - :align: center - -This plugin implements the following event handlers: - -* **on_pre_product_spec_validation**: In this handler the plugin validates that the provided URL is a valid CKAN dataset and - that the user creating the product specification is its owner. -* **on_product_acquisition**: In this handler the plugin uses the CKAN instance API in order to grant access to the user - who has acquired a dataset. -* **on_product_suspension**: In this handler the plugin uses the CKAN instance API in order to revoke access to a dataset - when a user has not paid or when the user cancels a subscription. - -On the other hand, the *CKAN API Dataset* also requires an *Acquisition role* to be provided. This role is the one that -will be granted to customers in the IdM in order to enable their access to the backend service, so the role must exist -and define a proper set of permissions for accessing the data. - -.. image:: ./images/plugin/ckan2.png - :align: center - :scale: 50% - -This plugins implements the following event handlers: - -* **on_pre_product_spec_validation**: In this handler the plugin validates that the provided URL is a valid CKAN dataset and - that the user creating the product specification is its owner. -* **on_post_product_spec_validation**: In this handler, the plugin validates that the API resources included in the CKAN - dataset are valid, the permissions of the seller to offer that services, and that the provided acquisition role exist and - is valid. -* **on_post_product_offering_validation**: In this handler the plugin validates that pricing models are supported when - creating a pay-per-use offering -* **on_product_acquisition**: In this handler the plugin uses the CKAN instance API in order to grant access to the user - who has acquired a dataset. -* **on_product_suspension**: In this handler the plugin uses the CKAN instance API in order to revoke access to a dataset - when a user has not paid or when the user cancels a subscription. -* **get_pending_accounting**: In this handler, the plugins retrieves pending accounting information when the access to the - data has been acquired under a pay-per-use pricing model. - - -In addition, the *CKAN API Dataset* requires some settings to be configured before being deployed. This settings are available -in the *setting.py* file, and are: - -* **UMBRELLA_SERVER**: Administration endpoint of the API Umbrella instanceused to sercure backend services -* **UMBRELLA_KEY**: API Key used for accessing to the API Umbrella instance used to secure the backend service -* **UMBRELLA_ADMIN_TOKEN**: Admin token used for accessing to the API Umbrella instance used to secure the backend service -* **KEYSTONE_USER**: Keystone user used for authenticate requests to the FIWARE IdM -* **KEYSTONE_PASSWORD**: Keystone password used for authenticate requests to the FIWARE IdM -* **KEYSTONE_HOST**: Host of the Keystone service of the FIWARE IdM used for authorizing customers -* **IS_LEGACY_IDM**: False if the FIWARE Idm is at least v7.0.0 -* **CKAN_TOKEN_TYPE**: Whether CKAN has to be accessed using X-Auth-Token or Authorization headers - -In addition, these settings can be configured using environment variables: - -* BAE_ASSET_UMBRELLA_SERVER -* BAE_ASSET_UMBRELLA_KEY -* BAE_ASSET_UMBRELLA_TOKEN -* BAE_ASSET_IDM_USER -* BAE_ASSET_IDM_PASSWORD -* BAE_ASSET_IDM_HOST -* BAE_ASSET_LEGACY_IDM -* BAE_ASSET_TOKEN_TYPE - -Umbrella Service ----------------- - -The *Umbrella Service* plugin is available in `GitHub `__. -This plugin deines an asset type intended to manage and monetize any HTTP service secured with the combination of a -FIWARE IDM for users and roles management and API Umbrella as PEP proxy. - -The Umbrella Service plugin allows to provide services in different ways using the options it defined in its metadata -form, which can be selected by sellers when registering the product. In particular: - -* **Authorization Method**: Whether user access to backend service is controlled using FIWARE IDM roles or API Umbrella native roles -* **Acquisition Role**: Role to be granted to customers -* **Access to sub-paths allowed**: If true, customers will be able to access to any sub-path of the monetized service -* **Additional query strings allowed**: If true, customers will be able to call the service with different query strings as the included in the asset URL -* **Admin API Key**: API key to be used by the BAE to access to the API Umbrella admin API -* **Admin Auth Token**: Admin token to be used by the BAE to access to the Umbrella admin API - -Moreover, this plugin support pay-per-use pricing supporting the *api call* unit. The accounting information is retrieved -from the API Umbrella logging API using the service details provided as metadata when the product is created. - -This plugin implements the following event handlers: - -* **on_post_product_spec_validation**: In this event handler the plugin validates all the provided information, including URL, Umbrella credentials and role. -* **on_post_product_offering_validation**: In this event handler the plugin validates that the provided procing model is supported by the plugin (Usage model) -* **on_product_acquisition**: In this event handler the plugin grants access to the customer using the provided role -* **on_product_suspension**: In this event handler the plugin revokes access to the customer removing the provided role -* **get_pending_accounting**: In this event handler the plugin accesses Umbrella API to retrieve the pending accounting information - -WireCloud Component -------------------- - -The *WireCloud Component* plugin is available in `GitHub `__. -This plugin defines an asset type intended to manage and monetize the different WireCloud components (Widgets, Operators, -and Mashups) in particular by enabling the creation of product specifications providing the WGT file of the specific -component. (For more details on the WireCloud platform see its documentation in `ReadTheDocs `__) - -The WireCloud component plugin allows to provide the WGT file in the two ways supported by the Business API Ecosystem, -that is, uploading the WGT file when creating the product and providing a URL where the platform can download the file. - -In addition, the plugin only allows the media type *Mashable application component*. Nevertheless, the plugin code uses the WGT -metainfo to determine the type of the WireCloud component (Widget, Operator, or Mashup) and overrides the media type with the -proper one understood by the WireCloud platform (*wirecloud/widget*, *wirecloud/operator* or *wirecloud/mashup*). - -.. image:: ./images/plugin/wirecloud1.png - :align: center - -.. image:: ./images/plugin/wirecloud2.png - :align: center - -This plugin implements the following event handlers: - -* **on_post_product_spec_validation**: In this handler the plugin validates the WGT file to ensure that it is a valid WireCloud Component -* **on_post_product_spec_attachment**: In this handler the plugin determines the media type of the WGT file and overrides the media type value in the specific product specification - - -Accountable Service -------------------- - -.. warning:: - This plugin is deprecated, and will not evolve. This plugin has been replaced by Umbrella Service Plugin - - -The *Accountable Service* plugin is available in `GitHub `__. -This plugin defines a generic asset type which is used jointly with the `Accounting Proxy `__ -in order to offer services under a pay-per-use model. In particular, this plugin is able to validate services URLs, -validate sellers permissions, generate API keys for the Accounting Proxy, validate offering pricing models, and manage -customers access rights to the offered services. - -Taking into account that this plugin is intended tyo work coordinately with an instance of the Accounting Proxy, all -the assets to be registered using the *Accountable Service* type must be registered in the proxy as described in the -Accounting Proxy section. - -The *Accountable Service* plugin only allows to provide the assets with a URL that must match the service one. - -.. image:: ./images/plugin/accounting1.png - :align: center - -This plugin implements the following event handlers: - -* **on_post_product_spec_validation**: In this event handler the plugin validates that the provided URL belongs to a valid - service registered in an instance of the Accounting Proxy, and that the user creating the product specification is its owner. - In addition, this handler generates an API key for the Accounting Proxy to be used when it feeds the Business API Ecosystem - with accounting information. -* **on_post_product_offering_validation**: In this event handler the plugin validates the pricing model of a product offering - where the service is going to be sold. Specifically, it validates that all the price plans which can be selected by a - customer are usage models and that the units (calls, seconds, mb, etc) are supported by the Accounting Proxy. -* **on_product_acquisition**: This event handler is used to grant access to a user who has acquired a service by sending - a notification to the proxy, including also the unit to be accounted (price plan selected). -* **on_product_suspension**: This event handler is used to in order to revoke access to a service when a user has not - paid or when the user cancels a subscription. - -Accounting Proxy -================ - -The *Accounting Proxy* can be found in `GitHub `__. This software -is a NodeJs server intended to manage services offered in the Business API Ecosystem. In particular, it is able to -authenticate users, authorize or deny users to access to a particular service depending on the acquisition, the URL, -or the HTTP method used, and account the usage made of the service so users can be charged on pay-per-use basis. - -Having this software deployed allows service owners to protect their services and offer them in the Business API Ecosystem -without the need of making any modification in the specific service. - -Installation -############ - -This software is a pure NodeJS server, to install basic dependencies execute the following command: :: - - $ npm install - -Configuration -+++++++++++++ - -All the Accounting Proxy configuration is saved in the *config.js* file in the root of the project. - -In order to have the accounting proxy running it is needed to fill the following information: - -* `config.accounting_proxy`: Basic information of the accounting deployment. - * `https`: set this variable to undefined to start the service over HTTP. - * `enabled`: set this option to true to start the service over HTTPS and activate the certificate validation for some administration requests (see *Proxy API*). - * `certFile`: path to the server certificate in PEM format. - * `keyFile`: path to the private key of the server. - * `caFile`: path to the CA file. - * `port`: port where the accounting proxy server is listening. -:: - - { - https: { - enabled: true, - certFile: 'ssl/server1.pem', - keyFile: 'ssl/server1.key', - caFile: 'ssl/fake_ca.pem' - }, - port: 9000 - } - - -* `config.database`: Database configuration used by the proxy. - * `type`: database type. Two possible options: `./db` (sqlite database) or `./db_Redis` (redis database). - * `name`: database name. If the database type select is redis, then this field selects the database number (0 to 14; 15 is reserved for testing). - * `redis_host`: redis database host. - * `redis_port`: redis database port. - -:: - - { - type: './db', - name: 'accountingDB.sqlite', - redis_host: 'localhost', - redis_port: 6379 - } - - -* `config.modules`: An array of supported accounting modules for accounting in different ways. Possible options are: - * `call`: the accounting is incremented in one unit each time the user send a request. - * `megabyte`: counts the response amount of data (in megabytes). - * `millisecond`: counts the request duration (in milliseconds). - -:: - - { - accounting: [ 'call', 'megabyte', 'millisecond'] - } - -Other accounting modules can be implemented and included to the proxy (see *Accounting modules*). - -* `config.usageAPI`: the information of the usage management API where the usage specifications and the accounting information will be sent. - *`host`: Business API Ecosystem host. - * `port`: Business API Ecosystem port. - * `path`: path of the usage management API. - * `schedule`: defines the daemon service schedule to notify the accounting information to the Business API Ecosystem. The format is similar to the cron tab format: "MINUTE HOUR DAY_OF_MONTH MONTH_OF_YEAR DAY_OF_WEEK YEAR (optional)". By the default, the usage notifications will be sent every day at 00:00. - -:: - - { - host: 'localhost', - port: 8080, - path: '/DSUsageManagement/api/usageManagement/v2', - schedule: '00 00 * * *' - } - -* `config.api.administration_paths`: configuration of the administration paths. Default accounting paths are: - -:: - - { - api: { - administration_paths: { - keys: '/accounting_proxy/keys', - units: '/accounting_proxy/units', - newBuy: '/accounting_proxy/newBuy', - checkURL: '/accounting_proxy/urls', - deleteBuy: '/accounting_proxy/deleteBuy' - } - } - } - -The Accounting Proxy can be used to proxy an Orion Context Broker, supporting the accounting of subscriptions. To do that, -the following configuration params are used: - -* `config.resources`: configuration of the resources accounted by the proxy. - * `contextBroker`: set this option to `true` if the resource accounted is an Orion Context Broker. Otherwise set this option to `false` (default value). - * `notification_port`: port where the accounting proxy is listening to subscription notifications from the Orion Context Broker (port 9002 by default). - -:: - - { - contextBroker: true, - notification_port: 9002 - } - -Administration -############## - -The Accounting Proxy is able to manage multiple services. In this regard, it has been provided a *cli* tool that can be -used by admins in order to register, delete, and manage its services. The available commands are: - -* `./cli addService [-c | --context-broker] [otherHttpMethods...]`: This command is used to register - a new service in the Accounting Proxy. It receives the following parameters - * *publicPath*: Path where the service will be made available to external users. There are two valid patterns for the - public path: (1) Providing a path with a single component (*/publicpath*) will make the Accounting Proxy accept requests - to sub-paths of the specified one (i.e having a public path */publicpath* requests to */publicpath/more/path* are accepted). - This pattern is typically used when you are offering the access to an API with multiple resources. (2) Providing a - complete path (*/this/is/the/final/resource/path?color=Blue&shape=rectangular*) will make the Accounting Proxy to - accept only requests to the exact registered path including query strings. This pattern is typically used when you are - offering a single URL, like a Context Broker query. - - * *url*: URL where your service is actually running and where requests to the proxy will be redirected. Note that in - this case all the URL is provided (including the host) since the accounting proxy allows the management of services - running in different servers. - - * *appId*: ID of the service given by the FIWARE IdM. This id is used in order to ensure that the access tokens provided - by users are valid for the accessed service - - * *HTTP methods*: List of HTTP methods that are allowed to access to the registered service - - * Options: - * `-c, --context-broker`: the service is an Orion Context broker service (`config.contextBroker` must be set to `true` in `config.js`). - -Following you can find two examples in order to clarify the options available for registering a service: :: - - $ ./cli addService /apacheapp http://localhost:5000/ 1111 GET PUT POST - -In this case, there is a service running in the port 5000 which is made available though the */apacheapp* path, allowing -only GET, PUT, and POST HTTP request. Supposing that the Accounting Proxy is running in the host *accounting.proxy.com* in the -port 8000, the following requests will be accepted by it: :: - - GET http://accounting.proxy.com:8000/apacheapp - GET http://accounting.proxy.com:8000/apacheapp/resource1/ - POST http://accounting.proxy.com:8000/apacheapp/resource1/resource2 -.. note:: - The Accounting Proxy does not care about the API or the semantics of the monitored service, so it may accept - a request to a URL which does not exists in the service, resulting in a usual 404 error given by the later - -Additionally, a complete path can be provided, as in the following example: :: - - $ ./cli addService /broker/v1/contextEntities/Room2/attributes/temperature http://localhost:1026/v1/contextEntities/Room2/attributes/temperature 1111 GET - -In this example, there is a Context Broker running in the port 1026 and a specific query is made available through the -Accounting proxy, so only the following request is accepted: :: - - GET http://accounting.proxy.com:8000/broker/v1/contextEntities/Room2/attributes/temperature - -.. note:: - For making the proxy transparent to final users is a good practice to use the same path in the external path and in - the URL when providing a complete path. Nevertheless, this is not mandatory, so it is possible to create an alias for - a query (i.e */room2/temperature* for the previous example) - - -* `./cli getService [-p ]`: This command is used to retrieve the URL, the application ID and the type - (Context Broker or not) of all registered services. - - * Options: - * `-p, --publicPath `: only displays the information of the specified service. - -* `./cli deleteService `: This command is used to delete the service associated with the public path. -* `./cli addAdmin `: This command is used to add a new administrator. -* `./cli deleteAdmin `: This command is used to delete the specified admin. -* `./cli bindAdmin `: This command is used to add the specified administrator to the service specified by the public path. -* `./cli unbindAdmin `: This command is used to delete the specified administrator for the specified service by its public path. -* `./cli getAdmins `: This command is used to display all the administrators for the specified service. - -To display a brief description of the *cli* tool you can use : `./cli -h` or `./cli --help`. In addition, to get -information for a specific command you can use: `./cli help [cmd]`. - -Authentication and Authorization -################################ - -The Accounting Proxy relies on the FIWARE IdM for authenticating users. To do that, the proxy expects that all the requests -include a header *Authorization: Bearer access_token* or *X-Auth-Token: access_token* with a valid access token given -by the IdM. - -Moreover, if the authentication process has succeed, the Accounting Proxy validates the permissions of the user to access -to specific service. To do that, it checks if the user has been registered as an admin of the service or if the user has -acquired the service. - -Is important to notice, that the Business API Ecosystem allows sellers to offer a service in different offerings with -different pricing models. In this regard, having just the access token is not enough to determine the accounting unit -(pricing model) that has to be used to account the usage of the service. It may happen, that a valid user has acquired -the access to a service in two different offerings with two different models (i.e calls and seconds), so the proxy -needs extra info to determine the unit to account (in this example calls or seconds). To deal with that problem, the -Accounting Proxy generates an API Key which identifies the service, the user, and the accounting unit, so including -it in a header *X-API-Key: api_key* when making requests, enables it to know what unit to account. - -.. note:: - The X-API-Key header is not intended to provide an extra level of security, but just to remove the possible incertitude - around the request - -Proxy API -######### - -The Accounting Proxy runs by default in the port 9000; nevertheless, this port can be configured as described in *Configuration* -section. In this regard, the different services configured though the administration *cli* tool can be accessed directly -in the root of the proxy using the public path defined for the service. - -In addition, the Accounting Proxy has an administration API which can be accessed though the reserved path */accounting_proxy*. -Following, you can find the different services exposed in the administration API: - -POST .../newBuy -+++++++++++++++ - -This service is used by the Business API Ecosystem to notify a new buy. If the accounting proxy has been started over -HTTPS, these requests should be signed with the Business API Ecosystem key; otherwise, they will be rejected. - -:: - - { - "orderId": "...", - "productId": "...", - "customer": "...", - "productSpecification": { - "url": "...", - "unit": "...", - "recordType": "..." - } - } - -* `orderId`: order identifier. -* `productId`: product identifier. -* `customer`: customer id. -* `url`: base url of the service. -* `unit`: accounting unit (`megabyte`, `call`, etc). -* `recordType`: type of accounting. - -POST .../deleteBuy -++++++++++++++++++ - -This service is used by the Business API Ecosystem to notify a terminated buy. If the accounting proxy has been started over HTTPS, these -requests should be signed with the Business API Ecosystem key; otherwise, they will be rejected. - -:: - - { - "orderId": "...", - "productId": "...", - "customer": "...", - "productSpecification": { - "url": "..." - } - } - -* `orderId`: order identifier. -* `productId`: product identifier. -* `customer`: customer id. -* `url`: base url of the service. - -POST .../urls -+++++++++++++ - -This service is used by the Business API Ecosystem to check if an URL is a valid registered service. This requests require -the "authorization" header with a valid access token from the IdM and the user must be an administrator of the service. -If the accounting proxy has been started over HTTPS, these requests should be signed with the Business API Ecosystem key cert; otherwise, -they will be rejected. - -:: - - { - "url": "..." - } - -GET .../keys -++++++++++++ - -Retrieve the user's API_KEYs in a json. This request require the "authorization" header with a valid access token from the IdM. - -:: - - [ - { - "apiKey": "...", - "productId": "...", - "orderId": "...", - "url": "..." - }, - { - "apiKey": "...", - "productId": "...", - "orderId": "...", - "url": "..." - } - ] - -GET .../units -+++++++++++++ - -Retrieve the supported accounting units by the accounting proxy in a JSON. This requests require the "authorization" -header with a valid access token from the IdM. - -:: - - { - "units": ["..."] - } - - -Accounting modules -################## - -By default, the Accounting Proxy includes three different modules for accounting. Nevertheless, it is possible to extend -the proxy with new modules by creating them in the *acc_modules* directory, those modules have to have the following structure: - -:: - - /** Accounting module for unit: XXXXXX */ - - var count = function (countInfo, callback) { - // Code to do the accounting goes here - // ..... - - return callback(error, amount); - } - - var getSpecification = function () { - return specification; - } - - -The function `count` receives two parameters: -* `countInfo`: object containing both, the request made by the user and the response returned by the service :: - - { - request: { // Request object used by the proxy to make the request to the service. - headers: { - - }, - body: { - - }, - ... - }, - response: { // Response object received from the service. - headers: { - - }, - body: { - - }, - elapsedTime: , // Response time - ... - } - } - -* `callback`: function, which is used to retrieve the accounting value or the error message. The callback expects 2 parameters: - * `error`: string with a description of the error if there is one. Otherwise, `null`. - * `amount`: number with the amount to be added to the current accounting. - -The function `getSpecification` should return a javascript object with the usage specification for the accounting unit -according to the TMF635 usage management API (`TMF635 usage Management API `__). - -Finally, add the name of the developed accounting module to the `config.modules` array in the `config.js` file (the -accounting module name is the name of the file, e.g. `megabyte` and `megabyte.js`) and restart the Accounting Proxy. diff --git a/doc/programmer-guide.rst b/doc/programmer-guide.rst deleted file mode 100644 index 3d4b4d1..0000000 --- a/doc/programmer-guide.rst +++ /dev/null @@ -1,331 +0,0 @@ -================ -Programmer Guide -================ - -Plugin Package -============== - -Business API Ecosystem plugins must be packaged in a zip. This file will contain all the sources of the plugin and a -configuration file called *package.json* in the root of the zip. This configuration file allows to specify some aspects -of the behaviour of the plugin and contains the following fields: - -* name: Name given to the resource type. This is the field that will be shown to providers -* author: Author of the plugin. -* formats: List that specify the different allowed formats for providing an asset of the given type. This list can contain the values "URL" and "FILE". -* module: This field is used to specify the main class of the Plugin. -* version: Current version of the plugin. -* media_types: List of allowed media types that can be selected when providing an asset of the given type -* pull_accounting (optional): This flag is used to indicate that the service defined by the plugin is not pushing accounting - information to the usage API of the Business API Ecosystem, but exposing an API that must be queried to retrieve this information. -* form (optional): This field is used to define a custom form that will be displayed for retrieving asset-specific meta data. - This field is defined as an object where keys are the name of the metadata property and values define the following information: - - * type: Type of the particular metadata property. Allowed values are *text*, *textarea*, *checkbox* and *select* mapping - the form input types to be displayed for retrieving the data. - * label: Label to be displayed jointly with the form input. - * default: Default value to be used if no value provided for the property - * placeholder (text and textarea): Placeholder to be included within the form input - * options (select): List of valid options when the input is a select. It includes *text* and *value* for each entry. - - -Following you can find an example of a *package.json* file: - -:: - - { - "name": "Test Resource", - "author": "fdelavega", - "formats": ["FILE"], - "module": "plugin.TestPlugin", - "version": "1.0", - "media_types": ["application/zip"], - "form": { - "auth_type": { - "type": "select", - "label": "Auth type", - "options": [{ - "text": "OAuth2", - "value": "oauth2" - }, { - "text": "API Key", - "value": "key" - }] - }, - "token_required": { - "type": "checkbox", - "label": "Token required?", - "default": true - }, - "auth_server": { - "type": "text", - "label": "Auth Server", - "placeholder": "https://authservice.com/auth" - } - } - } - -The source code of the plugin must be written in Python and must contain a main class that must be a child class of -the Plugin class defined in the Charging Backend of the Business API Ecosystem. Following you can find an example of a plugin main class. - -:: - - from wstore.asset_manager.resource_plugins.plugin import Plugin - - class TestPlugin(Plugin): - def on_pre_product_spec_validation(self, provider, asset_t, media_type, url): - pass - - def on_post_product_spec_validation(self, provider, asset): - pass - - def on_pre_product_spec_attachment(self, asset, asset_t, product_spec): - pass - - def on_post_product_spec_attachment(self, asset, asset_t, product_spec): - pass - - def on_pre_product_spec_upgrade(self, asset, asset_t, product_spec): - pass - - def on_post_product_spec_upgrade(self, asset, asset_t, product_spec): - pass - - def on_pre_product_offering_validation(self, asset, product_offering): - pass - - def on_post_product_offering_validation(self, asset, product_offering): - pass - - def on_product_acquisition(self, asset, contract, order): - pass - - def on_product_suspension(self, asset, contract, order): - pass - - def get_usage_specs(self): - return [] - - def get_pending_accounting(self, asset, contract, order): - return [], Date() - - -Implementing Event Handlers -=========================== - -It can be seen in the previous section that the main class of a plugin can implement some methods that are inherited from -the Charging Backend Plugin class. This methods can be used to implement handlers of the different events of the life cycle -of a product containing the asset. Concretely, the following events have been defined: - -* **on_pre_product_spec_validation**: This method is executed when creating a new digital product containing an asset of - the given type, before validating the product spec contents and saving the asset info in the database. This method can - be used for validating the asset format or the seller permissions to sell the asset. -* **on_post_product_spec_validation**: This method is executed when creating a new digital product containing an asset - of the given type, after validating the product spec and saving the asset info in the database. This method can be used - if the plugin require to know some specific info of the asset model -* **on_pre_product_spec_attachment**: This method is executed when creating a new digital product containing an asset of - the given type, after saving the product spec in the catalog API database but before attaching the product spec id to - the asset model. This method can be used if the plugin require to know the id in the catalog of the product spec -* **on_post_product_spec_attachment**: This method is executed when creating a new digital product containing an asset of - the given type, after saving the product spec in the catalog API database and after attaching the product spec id to the - asset model. This method can be used if the plugin require to know the id in the catalog of the product spec -* **on_pre_product_spec_upgrade**: This method is executed when a digital product is being upgraded (a new version of the - asset has been provided). This method can be used in order to validate the new digital asset before saving the upgrade -* **on_post_product_spec_upgrade**: This method is executed when a digital product have been upgraded. This method can be - used to send notifications or retrieve new information of the product specification. -* **on_pre_product_offering_validation**: This method is executed when creating a new product offering containing an asset - of the given type, before validating its pricing model. This method can be used to make extra validations on the pricing - model, for example check if the unit of an usage model is supported by the given asset -* **on_post_product_offering_validation**: This method is executed when creating a new product offering containing an - asset of the given type, after validating its pricing model. This method can be used to make extra validations on the - pricing model, for example check if the unit of an usage model is supported by the given asset -* **on_product_acquisition**: This method is called when a product containing an asset of the given type has been acquired. - This method can be used to activate the service for the customer and give him access rights. -* **on_product_suspension**: This method is called when a product containing an asset of the given type has been suspended - for a customer (e.g he has not paid). Tjis method can be used to suspend the service for the customer and remove his - access rights -* **get_usage_specs**: This method must be implemented when the flag *pull_accounting* is set to true and must return the list - of usage specifications the service is able to monitor. For each usage specification a *name* and a *description* must be - provided (e.g name: API Call, description: Number of calls made to...) -* **get_pending_accounting**: This method must be implemented when the flag *pull_accounting* is set to true. This method - must implement the client able to access to the service the plugin is defining in order to retrieve pending accounting - information for a giving contract. It must return the list of pending accounting including: - - * *date*: Timestamp of the accounting record - * *unit*: Monitored unit - * *value*: Actual usage made by the customer - -As can be seen in the Plugin example, the different handler methods receive some parameters with relevant information and -objects. In particular: - -on_pre_product_spec_validation ------------------------------- - -* **provider**: User object containing the user who is creating the product specification (The User object is described later) -* **asset_t**: String containing the asset type, it must be equal to the one defined in package.json -* **media_type**: String containing the media type of the asset included in the product being created -* **url**: String containing the url of the asset included in the product being created - - -on_post_product_spec_validation -------------------------------- - -* **provider**: User object containing the user who is creating the product specification (The User object is described later) -* **asset**: Asset object with the recently created asset (The Asset object is described later) - -on_pre_product_spec_attachment ------------------------------- - -* **asset**: Asset object where the created product specification id is going to be attached -* **asset_t**: String containing the asset type, it must be equal to the one defined in package.json -* **product_spec**: JSON with the raw product specification information that is going to be used for the attachment. (The structure of this JSON object can be found in the Open Api documentation) - - -on_post_product_spec_attachment -------------------------------- - -* **asset**: Asset object where the created product specification id has been attached -* **asset_t**: String containing the asset type, it must be equal to the one defined in package.json -* **product_spec**: JSON with the raw product specification information that has been used for the attachment. (The structure of this JSON object can be found in the Open Api documentation) - -on_pre_product_spec_upgrade ---------------------------- - -* **asset**: Asset object that have been upgraded -* **asset_t**: String containing the asset type, it must be equal to the one defined in package.json -* **product_spec**: JSON with the raw product specification information that is going to be used for the upgrade. (The structure of this JSON object can be found in the Open Api documentation) - - -on_post_product_spec_upgrade ----------------------------- - -* **asset**: Asset object that have been upgraded -* **asset_t**: String containing the asset type, it must be equal to the one defined in package.json -* **product_spec**: JSON with the raw product specification information that has been used for the upgrade. (The structure of this JSON object can be found in the Open Api documentation) - - -on_pre_product_offering_validation ----------------------------------- - -* **asset**: Asset object included in the offering being created -* **product_offering**: JSON with the raw product offering information that is going to be validated. (The structure of this JSON object can be found in the Open Api documentation) - - -on_post_product_offering_validation ------------------------------------ - -* **asset**: Asset object included in the offering being created -* **product_offering**: JSON with the raw product offering information that has been validated. (The structure of this JSON object can be found in the Open Api documentation) - -on_product_acquisition ----------------------- - -* **asset**: Asset object that has been acquired -* **contract**: Contract object including the information of the acquired offering which contains the asset. (The Contract object is described later) -* **order**: Order object including the information of the order where the asset was acquired. (The Order object is described later) - -on_product_suspension ---------------------- - -* **asset**: Asset object that has been suspended -* **contract**: Contract object including the information of the acquired offering which contains the asset -* **order**: Order object including the information of the order where the asset was acquired - -get_pending_accounting ----------------------- - -* **asset**: Asset object whose usage information has to be retrieved -* **contract**: Contract object including the information of the acquired offering which contains the asset -* **order**: Order object including the information of the order where the asset was acquired - -Handler Objects ---------------- - -Following you can find the information regarding the different objects used in plugin handlers - -* **User**: Django model object with the following fields - * **username**: Username of the user - * **email**: Email of the user - * **complete_name**: Complete name of the user - -* **Asset**: Django model object with the following fields - * **product_id**: Id of the product specification which includes the asset - * **version**: Version of the product specification which includes the asset - * **provider**: User object of the user that created the asset - * **content_type**: media type of the asset - * **download_link**: URL of the asset if it is a service in an external server - * **resource_path**: Path to the asset file if it is uploaded in the server - * **resource_type**: Type of the asset as defined in the package.json file of the related plug-in - * **is_public**: If true the asset can be downloaded by any user without the need of acquiring it - * **meta_info**: JSON with any related information. This field is useful to include specific info from the plugin code - -Additionally, it includes the following methods: - -* **get_url**: Returns the URL where the asset can be accessed -* **get_uri**: Returns the url where the asset info can be accessed - - -* **Contract**: Django model with the following fields - * **item_id**: Id of the order item which generated the current contract - * **offering**: Offering object with the information of the offering acquired in the current contract (The offering object is described later) - * **product_id**: Id of the inventory product created as a result if the acquisition of the specified offering - * **pricing_model**: JSON with the pricing model that is used in the current contract for charging the customer who acquired the included offering - * **last_charge**: Datetime object with the date and time of the last charge to the customer - * **charges**: List of Charge objects contaning the info of the different times the customer has been charged in the context of the current contract - * **correlation_number**: Next expected correlation number for usage documents. This field is only used when the pricing model is usage - * **last_usage**: Datetime object with the date and time of the last usage document received. This field is only used when the pricing model is usage - * **revenue_class**: Product class of the involved offering for revenue sharing - * **terminated**: Specified whether the contract has been terminated (the customer has no longer access to the acquired asset) - -* **Offering**: Django model with the following fields - * **off_id**: Id of the product offering - * **name**: Name of the offering - * **version**: Version of the offering - * **description**: Description of the offering - * **asset**: Asset offered in the offering - -* **Charge** Django model with the following fields - * **date**: Datetime object with the date and time of the charge - * **cost**: Total amount charged - * **duty_free**: Amount charged without taxes - * **currency**: Currency of the charge - * **concept**: Concept of the charge (initial, renovation, usage) - * **invoice**: Path to the PDF file containing the invoice of the charge - -* **Order**: Django model with the following fields - * **order_id**: Id of the product order - * **customer**: User object of the customer of the order - * **date**: Datetime object with the date and time of the order creation - * **tax_address**: JSON with the billing address used by the customer in the order - * **contracts**: List of Conctract objects, one for earch offering acquired in the order - -Additionally, it includes the following methods: - -* **get_item_contract**: Returns a contract given an item_id -* **get_product_contract**: Returns a contract given a product_id - -Managing Plugins -================ - -Once the plugin has been packaged in a zip file, the Charging Backend of the Business API Ecosystem offers some management -command that can be used to manage the plugins. - -When a new plugin is registered, The Business API Ecosystem automatically generates an id for the plugin that is used for -managing it. To register a new plugin the following command is used: - -:: - - python manage.py loadplugin TestPlugin.zip - - -It is also possible to list the existing plugins in order to retrieve the generated ids: - -:: - - python manage.py listplugins - - -To remove a plugin it is needed to provide the plugin id. This can be done using the following command: - -:: - - python manage.py removeplugin test-plugin diff --git a/doc/requirements.txt b/doc/requirements.txt index 6c5d5d4..02116c7 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1 +1,2 @@ sphinx-rtd-theme +myst-parser diff --git a/doc/user-guide.md b/doc/user-guide.md new file mode 100644 index 0000000..8bc6fa1 --- /dev/null +++ b/doc/user-guide.md @@ -0,0 +1,956 @@ +# User Guide + +This guide explains how to use the Business API Ecosystem marketplace with its default **BAE theme** to discover services, +purchase and manage products, and publish offers as a provider. Instructions and screenshots use the BAE +interface and its English labels. The screenshots show sample organizations and offers, such as the provider +*Atlas Cloud Services* and the customer *Northwind Logistics*. + +Access to workspaces and actions depends on your permissions and the features enabled by the marketplace operator. + +(admin)= +(manage-categories)= +(manage-idps)= +Marketplace administration is covered in the separate [Administrator Guide](admin-guide.md). + +| Task | Where to go | +| --- | --- | +| Update personal or organization information | User menu → **Profile** → **General**. | +| Maintain billing details | **Profile** → **Billing addresses**. | +| Discover services | **Browse** → **Services**. | +| Browse provider catalogues | **Browse** → **Providers catalogues**. | +| Complete a purchase | Cart icon or user menu → **My shopping cart**. | +| Review purchases, sales, and invoices | User menu → **Product Orders**. | +| Manage acquired products and subscriptions | User menu → **My inventory**. | +| Publish specifications and product offers | User menu → **My Offerings**. | +| Negotiate a tailored offer | User menu → **Quotes**. | +| Invite providers to respond to a request | User menu → **Tenders**. | +| View marketplace reports | User menu → **Analytics**. | + +## Getting started + +You can browse public offers and provider pages before signing in. Select **Login** to authenticate using the method +provided by your marketplace. Follow the identity provider's instructions or, for credential-based login, complete the +wallet verification shown in the redirected page or QR-code window. + +After login, the header shows the initials of the active account. Open this menu to access your profile, orders, +inventory, and other workspaces. The initial session represents your organization. Check the organization shown in the +menu before creating offers, submitting requests, or ordering products: those operations use the active session. + +On small screens, open the main menu to access the navigation and account options. Use the appearance selector to +choose **Light**, **Dark**, or **System** as the display mode. + +![User menu of an organization session](images/user/ug-01-user-menu.png) + +## Using Organizations + +An organization has its own profile, billing addresses, specifications, offers, orders, and inventory. Work in the +organization session when acting on its behalf. Your permissions within that organization determine the actions available. + +To change session when **Change session** is available: + +1. Open the user menu in the header. +2. Select **Change session**. +3. Choose the organization to represent, or choose your own username to use your personal session. +4. Check the name in the user menu before continuing. + +The profile and workspace lists reload for the selected session. Choose the session before preparing an order or editing +a specification or offer. + +Marketplace administrators access Administration through their personal session. First switch to your own username, +then reopen the user menu and select **Administration**. The [Administrator Guide](admin-guide.md) explains that workflow. + +![Change session menu listing an organization and the personal username](images/user/ug-02-change-session.png) + +## Profile Configuration + +Open the user menu and select **Profile**. The **General** section displays the profile of the active person or organization. +The profile workspace also provides **Billing addresses**, **Revenue sharing**, **Payment dashboard**, and **VC Issuer**. + +### Personal information + +In a personal session, **General** displays account information and an editable personal profile. The user ID, email, +and access token come from the authenticated account. + +Fill in **Name** and **Lastname**, which are required, and optionally provide: + +- Treatment, gender, marital status, and nationality. +- Birth date, city of birth, and country of birth. + +Select **Update** to save the profile. + +![Personal profile with account information and editable fields](images/user/ug-03-personal-profile.png) + +### Organization information and contacts + +In an organization session, **General** displays the organization profile. Organization administrators can edit it. + +| Field | Information to provide | +| --- | --- | +| Name | Organization name; required. | +| Website | Organization website. | +| Country | Select the organization's country; required. | +| Description | Public organization description, with Markdown formatting and a preview. | +| Organization logo | Upload a logo or enter its image URL. Use a square logo with a transparent background. | + +Where dataspace integration is enabled, the profile also includes **Contract Management Address**, +**Contract Management Client ID**, and **Contract Management Scopes**. They connect the organization with the +contract management service of its data space connector. Use the connection details supplied by the operator of your +connector; enter multiple scopes separated by commas. See the [Data Space Integration Guide](dataspace-guide.md). + +The **Contact information** table contains the organization's public contacts. To add one: + +1. Under **Add a new contact medium**, choose **Email**, **Postal Address**, or **Phone Number**. +2. Enter a **Title** identifying the contact, such as “Sales” or “Technical support.” +3. Supply the email address, postal address, or phone number. For a phone, select the country prefix. +4. Select **Save** to add the contact to the table. +5. Select **Update** to save the organization profile, including the contact changes. + +Use the row actions to edit or remove a contact, then save the profile with **Update**. Organization details and contacts +are used on public provider pages and when preparing compliance requests. + +![Organization profile general information](images/user/ug-04-org-profile.png) + +![Organization contact information table and contact medium form](images/user/ug-04-org-contacts.png) + +### Billing addresses + +Open **Profile** → **Billing addresses** to maintain the addresses used at checkout. Organization administrators maintain +the addresses of their organization. + +To create an address, complete **Add billing address**: + +| Field | Required information | +| --- | --- | +| Title | A name that helps you recognize the address. | +| Country | Select a country. | +| City | City or town. | +| State / Province | State, province, or region. | +| ZIP / Postal Code | Postal code. | +| Street Address | Street and building details. | +| Email | Billing contact's email address. | +| Phone number | Billing contact's number, with the country prefix selected separately. | + +You can also choose a **Phone Type**, such as Office or Mobile. Select **Add billing address** to save. +To edit an existing entry, use its edit action, change the fields, and select **Update billing address**. + +These addresses are also available in checkout and when submitting subscription changes. + +![Billing address list](images/user/ug-05-billing-addresses.png) + +![Add billing address form](images/user/ug-05-billing-address-form.png) + +### Revenue sharing and external account services + +Select **Profile** → **Revenue sharing** to view the provider's revenue-sharing information. The report presents the +sections, values, and links supplied for the active account. + +**Payment dashboard** opens the connected payment provider's portal. Use it to manage the payment services associated +with your account. **VC Issuer** opens the configured credential issuer for credential-related tasks. + +![Provider revenue sharing information](images/user/ug-06-revenue-sharing.png) + +## Customer + +### List Available Offerings + +Open **Browse** → **Services** to discover offers. From **Home**, you can also select **Browse services**, enter keywords +in the home page's search box, or select **View Services** on a category card to open its offers. + +On the results page: + +1. Select a category from the heading's dropdown, or choose **All Categories**. +2. Enter keywords in the search box and select **Search**, where keyword search is available. +3. Use the filter buttons above the results to select relevant values. Available filters and their labels are defined by + the marketplace; examples include delivery model, compliance level, sector, and procurement type. +4. Narrow the category selection using the **Filters** sidebar or **Categories** panel. +5. Use **Clear all** to reset filters, and the grid/list controls to change the presentation. +6. Select **Load more** to display further results, then open an offer to review it. + +The selected values are reflected in the filter controls. Filters can support multiple values, depending on their setup. + +Open **Browse** → **Providers catalogues** to browse published catalogues. Use the search box to find a catalogue, +choose grid or list view, and open a catalogue card. Its page shows the provider's description, country, support contacts, +and the catalogue's services. Use **Browse services**, the category selector, and the service filters to explore its offers. + +![Service search results with category selector and grid/list controls](images/user/ug-07-search.png) + +![Providers catalogues list](images/user/ug-08-catalogues.png) + +![Provider catalogue page with support contacts](images/user/ug-08-catalogue-page.png) + +### Offering details + +Open an offer to review its overview and provider. The details page groups information into three tabs: + +| Tab | Information available | +| --- | --- | +| Overview | Product description, how it works, key features, business benefits, use cases, FAQs, and product attachments. | +| Pricing | Available price plans, configuration options, and usage metrics. | +| Compliance | Certification level, compliance evidence, terms and conditions, downloadable terms documents, and SLA information where provided. | + +The page also identifies the offer version, last update, product, and owner. Use **Read more** or **Read all** where shown +to expand longer descriptions, and select attachment actions to open supporting documents. + +Sign in to acquire an offer. **Add to cart** opens the configuration and pricing drawer. For tailored offers, use +**Create quote** to send the provider your requirements; see [Quotes](#quotes). + +![Offer details Overview tab](images/user/ug-09-offer-overview.png) + +![Offer details Pricing tab](images/user/ug-09-offer-pricing.png) + +![Offer details Compliance tab](images/user/ug-09-offer-compliance.png) + +### Create Order + +First select the organization or personal session that will make the purchase and ensure it has a billing address. + +To add an offer to the cart: + +1. Open the offer and select **Add to cart**. +2. Choose a price plan. A free offer is identified as free. +3. Set the configuration options shown for the plan. Depending on the option, select a value, use a range control, or + turn a Boolean switch on or off. Optional options can be enabled or disabled. +4. For a plan with a configuration profile, review the predefined values. +5. Where usage metrics are shown, enter sample usage values to simulate the price. These values provide an estimate; + charges for usage depend on the service usage actually recorded. +6. Review the displayed charges and accept the terms and conditions when the acceptance checkbox is shown. +7. Select **Add to cart**. You can use **Undo** in the confirmation message to remove the item just added. + +A plan can include several charges, such as a one-time setup charge and a recurring subscription. Review each component +and its charging period. + +![Purchase drawer with price plan and configuration options](images/user/ug-10-purchase-drawer.png) + +![Terms acceptance and calculated charges in the purchase drawer](images/user/ug-10-purchase-drawer-terms.png) + +![Shopping cart](images/user/ug-10-cart.png) + +Open the header's cart icon to review the cart, or choose **My shopping cart** from the user menu to open checkout. +Remove any unwanted items before submitting the order. + +At checkout: + +1. Review the **Contact Person** details for the session. +2. Select a **Billing Address**. Use **Add** to create another address; the form is displayed directly if none exists. +3. Optionally enter an **Order Note** for the provider. +4. Review **Your Order**, including the selected offers and charges. +5. Select **Checkout**. +6. Complete the payment-provider flow if the marketplace redirects you for payment, then return to the marketplace. + +The subsequent fulfillment follows the procurement mode set by the provider. Track the request in **Product Orders** +and the acquired products in **My inventory**. + +![Checkout with contact, billing address, order note and order summary](images/user/ug-11-checkout.png) + +### Manage Requested Orders + +Open **Product Orders** from the user menu and select **Product Orders** → **As Customer**. + +Use **Filter by action** to select acquisition (**Add**), configuration change (**Modify**), or termination (**Delete**) +orders. Use **Filter by status** to narrow the list to Acknowledged, In Progress, Partial, Completed, Failed, Pending, +or Cancelled orders. + +Each row identifies the order, state, billing address, and date. Open its details action to see the full order ID, +customer and billing information, and individual items. Item details include the selected price plan, action, and state. +An order can contain items at different stages; review the item states as well as the overall order state. + +Use the notes action to open **Order Notes**. Read the conversation, type a message, and select **Send** to add it to +the order. Notes include their author and date. + +![Customer product orders list with filters](images/user/ug-12-orders-customer.png) + +![Order details dialog](images/user/ug-12-order-details.png) + +### Invoices + +Open **Product Orders** → **Invoices** → **As Customer**. The list shows the invoice date, number, tax-inclusive amount, +and state. + +Use the download action to retrieve an invoice. Open its details to inspect **Applied Billing Rates**, including the +charge name, description, type, amount, related product, and covered period where present. + +![Customer invoices list](images/user/ug-13-invoices.png) + +![Applied billing rates of an invoice](images/user/ug-13-invoice-details.png) + +### Manage Acquired Products + +Open **My inventory** from the user menu. The workspace contains **Products**, **Services**, and **Resources**. + +In **Products**, filter by Created, Active, Suspended, or Terminated to find an acquisition, and use the grid/list +controls to change the presentation. Open the product name to review it: the **Overview** tab shows its description, +start date, billing account, and selected price plan; **Pricing** shows the plan and configuration; and +**Services & resources** lists the service and resource instances associated with the product. + +For an active product, use **Modify characteristics** to request a change: + +1. Open the product card's **Modify characteristics** action. +2. Review the current configuration and choose the new price plan and option values in the drawer. +3. Accept the terms and conditions, and select **Modify Characteristics**. +4. Select the billing address for the change and choose **Confirm changes**. +5. Complete payment if requested, then follow the **Modify** order in **Product Orders**. + +To end an active subscription, select **Unsubscribe**, confirm the subscription, and complete the billing-address +selection shown for the termination request. Track the resulting **Delete** order in **Product Orders**. + +In **Services** and **Resources**, filter the records by their available states and open a record's ID to inspect its +description and characteristics. These records describe the service or resource instances associated with acquisitions. + +![Product inventory with status tabs and product actions](images/user/ug-14-inventory.png) + +![Acquired product details](images/user/ug-14-product-details.png) + +![Unsubscribe confirmation](images/user/ug-14-unsubscribe-confirmation.png) + +![Modify characteristics drawer](images/user/ug-15-modify-characteristics.png) + +![Billing address selection to confirm the change](images/user/ug-15-billing-confirmation.png) + +## Seller + +### Seller workspace + +Open the user menu and select **My Offerings**. This workspace is available to accounts with provider permissions in +the active session. + +The sidebar separates the objects used to build and sell a service: + +| Section | Purpose | +| --- | --- | +| Product offers | Define how customers acquire a product, including categories, terms, prices, and procurement. | +| Specifications → Products | Describe the product, its presentation, configurable options, supporting specifications, and compliance evidence. | +| Specifications → Services | Define service specifications that can be linked to a product. | +| Specifications → Resources | Define resource specifications that can be linked to a product. | +| Pay per use metrics | Define the measurements available for usage-based pricing. | +| Catalogues | Manage your catalogues when catalogue management is enabled. | + +The sidebar shows counts for each type. Lists provide status tabs, row actions, last-update information, and **Load more** +when further records are available. + +A typical publication workflow is: + +1. Prepare and validate service and resource specifications if the product needs them. +2. Define and validate pay per use metrics if the offer will use usage-based pricing. +3. Create a product specification and validate it for use in offers. +4. Create a product offer, select its product specification, and complete its commercial details. +5. Preview the result and publish the offer from **Product offers**. + +Specification validation makes a specification available for use in the marketplace's forms. Compliance verification +submits evidence for assessment. Offer publication makes the commercial offer available to customers. + +![My offerings workspace with product offers](images/user/ug-16-workspace.png) + +![Product specifications list](images/user/ug-16-product-specs.png) + +### Manage Catalogs + +When **Catalogues** is available in the sidebar, create a catalogue before selecting it in a product offer: + +1. Open **Catalogues** and select **Add new catalogue**. +2. Enter a **Name**, up to 100 characters, and an optional Markdown **Description**. +3. Select **Next step** and review the summary. +4. Select **Create catalogue**. +5. Use the catalogue's actions menu to **Publish** it when ready. + +Use **Edit** to update the name and description, review the summary, and select **Update catalogue**. Publication is +managed through the list actions: **Publish**, **Unpublish**, and **Delete**, according to the catalogue's current state. +Unpublish a published catalogue before deleting it. + +When the marketplace uses automatic catalogue assignment, the offering workflow assigns your provider catalogue. + +![Catalogue list with the actions menu](images/user/ug-17-catalogues.png) + +![Catalogue summary before creation](images/user/ug-17-catalogue-summary.png) + +### Service and resource specifications + +Open **My Offerings** → **Services** or **Resources** and use the add-new-specification button. + +1. In **General Info**, provide a **Name**, up to 100 characters, and an optional **Description**. +2. If the marketplace has service or resource plugins installed, choose a **Service type** or **Resource type**, or + keep **No service type** / **No resource type**. See [Service and resource types](#service-and-resource-types). +3. Select **Save and continue**. If you selected a type, complete the **Service details** or **Resource details** step + and select **Save and continue** again. +4. In **Configuration options**, add any configurable parameters using the + [configuration-option editor](#configuration-options). +5. Complete the form and choose **Save as draft** or **Validate service specification** / **Validate resource specification**. + +Drafts let you return to the work later. Validated service and resource specifications can be selected in a product +specification. Use the list's **Draft**, **Validated**, and **Deleted** tabs and its **Edit**, **Validate**, and **Delete** +actions to manage them. + +![Service specification General Info](images/user/ug-18-service-spec-general.png) + +![Save as draft or validate dialog for a service specification](images/user/ug-18-service-spec-save-dialog.png) + +(service-and-resource-types)= +#### Service and resource types + +Marketplace administrators can install plugins that define types of services and resources, such as a managed API or +a dataset. When at least one plugin of the corresponding kind is installed, the specification form changes: + +- **General Info** shows a **Service type** or **Resource type** list with the installed types. The default option, + **No service type** or **No resource type**, creates an ordinary specification with the steps described above. + Types shown as *unavailable* cannot be selected yet. +- When you select a type, a new **Service details** or **Resource details** step appears between **General Info** and + **Configuration options**. It shows the name of the selected type and the information that the type requires. + +![General Info step with the Managed API Access service type selected](images/user/ug-18-service-type.png) + +In the details step: + +- Fields marked with a red asterisk are required. **Save and continue** stays disabled until they are completed. +- Fields can be text boxes, multiline text, lists of options, or checkboxes. Some fields have a default value or an + example of the expected format. +- Some types require a file. In that case, the step starts with a **Service file** or **Resource file** field that lists + the accepted file types. The file is uploaded when you save the specification. + +![Service details step of the Managed API Access type](images/user/ug-18-service-details.png) + +![Resource details step of the Dataset Package type, with the required file and its accepted types](images/user/ug-18-resource-details.png) + +When you save, the marketplace checks the information against the selected type, which can also apply its own rules. +If it is not valid, the specification is not saved and an error message explains the problem. + +The values you enter are stored in the specification and are kept by the services and resources that customers +purchase. In **My Inventory**, their details page shows them in a **Plugin information** tab. + +When you edit a specification, you can change its type or set it back to **No service type** / **No resource type**. +This replaces the information of the previous type; the configuration options are kept. + +Developers and administrators can find how types are defined and installed in the [Plugins Guide](plugins-guide.md). + +### Manage Product Specifications + +Open **My Offerings** → **Products** and select **Add new product specification**. The editor contains the following +steps; use **Save and continue** to advance and **Back** to return. + +| Step | Fields and actions | +| --- | --- | +| General Info | Required product name and product image; optional supporting attachments. | +| Product details | Required product description and How it works; optional key features, business benefits, and use cases. | +| Configuration options | Optional configurable parameters that can be used in pricing and acquisition. | +| Dataspace configuration | Connection and policy information when dataspace functionality is enabled. | +| Service specifications | Optional links to validated service specifications. | +| Resource specification | Optional links to validated resource specifications. | +| FAQs | Optional product questions and answers. | +| Compliance profile | Self-attestation and supporting compliance documents. | + +**General Info.** Enter a name of up to 100 characters and upload a product image. The image selector accepts SVG, PNG, +JPG, and GIF, with a displayed limit of 3 MB. You can replace or remove the selected image. Add optional PDF or Word +attachments with the supporting-document selector; its displayed limit is also 3 MB per file. + +**Product details.** Complete **Product description** and **How it works**, using the Markdown editor and preview. Each +editor displays a 2,000-character limit. These texts appear in the public offer's Overview tab. + +Use **Add key feature**, **Add business benefits**, and **Add use cases** to describe the product in more detail. Each +entry has a name and description; a key feature also has an icon. Save the entry, then use its row menu to edit or delete +it. These entries appear as distinct sections of the public product page. + +**Linked specifications.** Search for validated service and resource specifications, select the ones used by the product, +and remove selected entries with their remove controls. + +**FAQs.** Select **Add FAQ**, then enter the question and answer. A question can contain up to 200 characters and an +answer up to 2,000. Expand an entry to edit it, or remove it with its delete action. + +**Saving and validating.** Complete the form and select **Save and create product**, or **Save changes** when editing. In the +confirmation dialog, choose **Save as draft** to return later or **Validate product specification** to make it available +for offers. A draft requires the required general information and product details to be complete. + +To resume work, return to **Products**, choose **Draft** or **Validated**, and use **Edit** on the specification. +The list also provides **Validate** for drafts and a confirmed **Delete** action. + +When leaving a creation form with changes, the dialog offers continuing, discarding changes, or **Leave and save draft** +when the required information is complete. Confirm the save action before leaving the editor. + +![Product specification General Info with image](images/user/ug-19-general-info.png) + +![Key features and business benefits in Product details](images/user/ug-19-product-details-features.png) + +![Key feature dialog with icon selection](images/user/ug-19-key-feature.png) + +![Linking a validated service specification](images/user/ug-20-linked-specs.png) + +![FAQs step](images/user/ug-20-faqs.png) + +![Save as draft or validate dialog for a product specification](images/user/ug-20-save-dialog.png) + +### Configuration options + +Product, service, and resource specifications use the configuration-option editor. In a product specification, these +options determine what customers can configure and what providers can use to define standard or flexible pricing. + +Select **Add configuration option** and complete: + +| Field | What to provide | +| --- | --- | +| Name | Required option name, up to 100 characters. | +| Type | String, Number, Number range, or Boolean. | +| Description | Explanation of the option and its meaning. | +| Is this configuration optional? | Choose whether customers can disable the option. | +| Values | The permitted values or range, according to the type. | + +For **String**, enter each permitted choice and select **Add value**. For **Number**, supply a number and unit for each +choice. For **Number range**, provide **From**, **To**, and a unit, then add the range. For **Boolean**, set the default +value with the **Default value is true** control. + +Select **Save configuration option** to add it to the specification. Use the option's row menu to edit or delete it. + +For example, a product can define a “Storage” number range from 10 to 1,000 GB, a “Support” string option with Standard +and Premium values, and an optional backup feature. An offer can then use these options in a configuration profile or +price components. + +![Configuration option editor with a number range](images/user/ug-21-configuration-option.png) + +![Configuration options of a product specification](images/user/ug-21-configuration-options-list.png) + +### Compliance verification + +Use the product specification's **Compliance profile** step to provide evidence for the verification service: + +1. Select **Self attestation** to download the template. +2. Complete the document and upload it under **Upload self attestation**. +3. Add supporting compliance documents under **Additional attachments**, and wait for uploads to finish. +4. Save the specification. Open it again with **Edit** when preparing the verification request. +5. Select **Request validation** to review the evidence and organization information. +6. Check the organization name, VAT identifier, address, country, website, and email. Complete the organization profile + first if the dialog identifies missing information. +7. Select **Request Validation** in the dialog to submit the request. + +After assessment, the offer's **Compliance** tab displays the certification level and available evidence. The displayed +levels include No level, Baseline, Professional, and Professional+. + +![Compliance profile with self-attestation and additional attachments](images/user/ug-22-compliance-profile.png) + +![Request Validation dialog with evidence and organization information](images/user/ug-22-request-validation.png) + +### Dataspace configuration + +When the marketplace is integrated with a data space, product specifications include a **Dataspace configuration** +step, and DSP-compatible products and offers include additional settings. The +[Data Space Integration Guide](dataspace-guide.md) explains how the data space connector uses this information and +includes complete examples. + +**Credentials and policies.** In **Dataspace configuration**, select **Add dataspace configuration** to add the +information that controls access to the service. Enter a name and an optional description, choose the type, paste +its JSON value, and select **Add JSON** and **Save configuration option**: + +- **Credentials configuration**: the verifiable credential and claims that the customer's users need, for example an + `OperatorCredential` with the `OPERATOR` role. When an order is completed, the customer organization is registered + as a trusted issuer of that credential. +- **Authorization policy**: an ODRL policy that controls access to the service, registered when an order is completed. + +Without DSP, this step is optional. + +![Dataspace configuration dialog with a credentials configuration](images/user/ug-23-credentials-configuration.png) + +**DSP-compatible products.** Where DSP integration is enabled, **General Info** includes the **DSP compatible** +option. Select it when the service is offered through the Dataspace Protocol, so that other connectors can find it in +your connector's catalog, negotiate a contract, and start a transfer. The **Dataspace configuration** step then +becomes required and includes a **DSP configuration** section: + +- Add at least one endpoint where the service can be negotiated, with its **Name**, **Endpoint URL**, and + **Description**, and select **Add endpoint**. +- Enter the **Upstream address** of the service that serves the data, and choose the **Transfer type** + (`HttpData-PULL` or `HttpData-PUSH`). Optionally, enter a **Transfer path** to append to the endpoint returned to + the consumer. +- Complete **Target specification**, **Service configuration**, **Credentials config**, and **Policy config** with + valid JSON. + +![DSP compatible option in General Info](images/user/ug-23-dsp-compatible.png) + +![Dataspace configuration step of a DSP-compatible product](images/user/ug-23-dsp-configuration.png) + +**Contract definition of offers.** For offers based on a DSP-compatible product specification, a **Contract +definition** step appears after **Terms & Conditions**. Select **DSP contract definition** and provide: + +- **Access policy**: ODRL policy that controls who can see the offer in your connector's catalog. +- **Contract policy**: ODRL policy that controls who can negotiate a contract for the offer. + +![Contract definition step of a DSP offer](images/user/ug-23-contract-definition.png) + +### Pay per use metrics + +Open **My Offerings** → **Pay per use metrics** and select **New pay per use metric**. + +1. In **General Info**, enter a name that is unique for your provider and an optional Markdown description. +2. In **Metrics**, select **Create new metric**. Enter the metric's name and optional description, then select **Save metric**. +3. Add the other measurements needed by the service. At least one metric is required. +4. Review **Summary** and save the usage specification. +5. Return to the list and use **Validate** to make it available to usage-based price components. + +Use **Edit** to update a specification. The **Draft**, **Validated**, and **Deleted** tabs organize the list. Before deleting +a metric specification, remove its use from active offers; the confirmation dialog identifies offers that still use it. + +For example, define a usage specification for a storage service with a “Transferred GB” metric, then select that +specification and metric in the offer's usage price component. + +![Pay per use metrics list with the actions menu](images/user/ug-24-usage-list.png) + +![Metrics step of a pay per use metric](images/user/ug-24-usage-metrics.png) + +![Pay per use metric summary](images/user/ug-24-usage-summary.png) + +### Manage Product Offerings + +Open **My Offerings** → **Product offers** and select **New product offer**. First prepare a validated product +specification, which you will select in the offer. + +The offer editor uses **General Info**, **Category**, **Terms & Conditions**, **Price plans**, and **Procurement Mode**. +For DSP-enabled products, it also includes **Contract definition**. Use **Save and continue** and **Previous step** to +move between steps. The step indicators show progress and required information to complete. + +**General Info** contains: + +| Field | What to provide | +| --- | --- | +| Name | Required offer name, up to 100 characters. | +| Product Specifications | Select a validated product specification. | +| Catalogue | Select your catalogue when catalogue management is enabled. | +| Marketplace-specific selection | Complete any required additional selector configured by the marketplace. | +| Product overview | Optional short description, up to 300 characters. | + +The product specification supplies the detailed product presentation and configuration options. It remains associated +with the offer after creation. + +In **Category**, select a required root category and, where appropriate, its subcategory. Add up to five **Tags** to +help describe the offer: type a tag and press Enter. Each tag can contain up to 20 characters; remove a tag with its +remove control. Complete any additional fields presented for the marketplace's categories. + +In **Terms & Conditions**, write or paste the terms using the Markdown editor. You can also attach terms documents +with **Browse files**. The selector accepts PDF and Word documents and displays a 5 MB limit. Review the listed files +and remove any that should not be included. + +Continue with the [price plans](#price-plans) and [procurement settings](#procurement-and-external-billing). + +![Offer General Info](images/user/ug-25-offer-general.png) + +![Offer category, subcategory and tags](images/user/ug-25-offer-category.png) + +![Offer Terms & Conditions text and documents](images/user/ug-25-offer-terms.png) + +### Price plans + +In the offer's **Price plans** step, select how the service is priced: + +| Pricing option | Customer workflow | +| --- | --- | +| Free | Customers acquire the offer without a price charge. | +| Tailored pricing | Customers send their requirements and negotiate a proposal with the provider. | +| Online paid price | Customers select a priced plan and configure the offer for purchase. | + +For **Tailored pricing**, select **Add price plan**, enter a required name and an optional description, and select +**Save price plan**. Add at least one plan. The description can contain up to 300 characters and should explain the +scope of the tailored service. + +For **Online paid price**, select **Add price plan** and choose its type: + +- **Standard plan**: a plan with a predefined configuration profile. Choose the values included in this plan from the + product specification's configuration options. +- **Flex plan**: a plan whose options customers can configure. Price components can be linked to the selected values + or ranges. + +Standard plans are available for product specifications with configuration options. A Flex plan can also contain +charges that apply independently of a particular option. + +For an online paid plan: + +1. Enter a required **Name** and **Description**. The name can contain up to 100 characters and the description up to 300. +2. Review **Relevant Configuration Options**. Use **Choose Options** to control which options and values are available + in the plan. For a range, set its available lower and upper bounds within the specification's range. +3. For a Standard plan, use **Set configuration profile** to choose the included value for each option and save the profile. +4. Select the plan's **Currency**: EURO, US DOLLAR, or POUND. All its price components use that currency. +5. Add at least one [price component](#price-components-and-tiers). +6. Select **Save price plan** to return to the plan list. + +A predefined configuration profile and per-plan option restrictions are alternative ways to define the configuration. +Use the profile controls for a predefined configuration, or **Choose Options** to restrict the customer's choices. +Values already used by a price component remain available to that component. + +Use the plan's actions menu to **Edit** or **Delete** it. Save the offer after completing changes to its plans. + +![Price plans step with the pricing options](images/user/ug-26-price-plans-step.png) + +![Standard or Flex plan selection](images/user/ug-26-plan-type.png) + +![Price plans of an offer](images/user/ug-26-price-plans-list.png) + +![Paid price plan editor](images/user/ug-27-plan-editor.png) + +![Choose Options dialog](images/user/ug-27-choose-options.png) + +![Set configuration profile dialog of a Standard plan](images/user/ug-27-configuration-profile.png) + +### Price components and tiers + +Select **Add price component** inside an online paid plan. Enter a name, optional description, and non-negative +**Base price**, then select the **Price type**: + +| Price type | Additional settings | +| --- | --- | +| One time | A single charge. | +| Recurring | Select a Daily, Weekly, Monthly, or Yearly charging period. | +| Recurring-prepaid | Select the period for the prepaid recurring charge. | +| Usage | Select a validated **Usage specification** and one of its **Metric** values. | + +For a Flex plan, optionally link the component to a **Configuration option**. For an option with individual choices, +select the **Value** to which the component applies. For a numeric range, define its price tiers. + +To include a discount, enable **Include a discount**, enter its amount, and choose **Percentage (%)** or **Fixed amount**. +Provide the duration and duration unit. Review the final price where the form displays it. + +Select **Save price component**. Use the component's actions menu to edit or delete it. + +**Range-based tiers.** Select a range configuration option in a Flex component and add tiers in **Tier list**: + +1. Set the tier's **Min.** and **Max.** within the product option's range, using the fields or sliders. +2. Enter the **Price** and **Price type**. +3. Complete the recurring period or usage specification/metric if required by that type. +4. Optionally give the tier a name and description and include a discount. +5. Select **Save tier** and repeat for the remaining ranges. +6. Cover the complete configuration range with valid tiers, then select **Save price component**. + +The editor identifies uncovered ranges and invalid intervals. Review the tier table before saving the component and +then save the price plan. + +![Recurring price component with a discount](images/user/ug-28-price-component.png) + +![Tier form for a range configuration option](images/user/ug-29-tier-form.png) + +![Tier list covering the configuration range](images/user/ug-29-tiers.png) + +### Procurement and external billing + +In **Procurement Mode**, choose how the service will be processed: + +| Mode | Workflow | +| --- | --- | +| Manual | The provider manages payment and fulfillment manually. | +| Payment Automatic - Procurement Manual | Payment uses the connected payment service; the provider handles fulfillment. | +| Automatic | Payment and procurement use the automated service flow. | + +To use a mode with automatic payment, first connect a payment gateway through your payment-provider account. The form +provides **Check the payment gateway here** when the provider portal is available. You can also open **Profile** → +**Payment dashboard**. + +If the offer uses an external billing service, select **Set external billing** and enter its **External billing engine URL**. +Use the service endpoint supplied for that offer's billing integration. + +![Procurement modes](images/user/ug-30-procurement-modes.png) + +![Automatic procurement with an external billing engine](images/user/ug-30-procurement.png) + +### Preview, drafts, and publication + +Use **Preview** in the offer editor to inspect **Product details** and **Card preview**. Check the product presentation, +pricing information, categories, and compliance content before saving. + +On the final step, select **Create offer** or **Update offer**. Review the confirmation preview and select +**Confirm & publish** or **Confirm & update**, as shown. Use **Back to edit** to make further changes. + +Manage public availability from **Product offers**: + +| Tab | Available work | +| --- | --- | +| Draft | Complete or edit offers and publish those marked **Ready to be published**. | +| Published | Edit, duplicate, or unpublish an offer. | +| Retired | Review unpublished offers and publish them again when ready. | +| Deleted | Review archived offers. | + +To publish a saved offer, open its row's actions menu and select **Publish**. A complete offer includes its product, +category, and procurement details. Use **Edit** to finish an offer marked **Not completed**. + +Use **Unpublish** to withdraw a published offer from sale. **Duplicate** creates a draft based on a published offer; +review and edit it before publication. For draft or retired offers, use **Delete** and confirm the dialog to archive them. + +When leaving a new offer with changes, choose **Continue editing**, **Discard changes**, or **Leave and save draft**. +Saving a draft requires an offer name, selected product specification, and a catalogue where the catalogue selector is +required. Return through **Draft** to finish the offer. + +![Offer preview, Product details tab](images/user/ug-31-preview-details.png) + +![Offer preview, Card preview tab](images/user/ug-31-preview-card.png) + +![Confirm & publish dialog](images/user/ug-31-confirm-publish.png) + +![Product offers list with tabs and the actions menu of a published offer](images/user/ug-32-offers-actions.png) + +### Manage Received Orders + +Open **Product Orders** → **Product Orders** → **As Provider**. Filter by action or status and open an order's details +to review the customer, billing contact, and requested items. + +For order items handled through manual procurement, use the available item actions to progress fulfillment: + +1. Acknowledge a new item or cancel it. +2. Move an acknowledged item to **inProgress** when processing starts. +3. Complete an item in progress, or mark it **failed** when fulfillment fails. +4. Review and confirm the requested state change in the confirmation dialog. + +Use **Order Notes** to discuss requirements and progress with the customer. The order action identifies whether the +request acquires a product, changes its configuration, or terminates a subscription. + +Open **Product Orders** → **Invoices** → **As Provider** to review customer invoices. You can inspect their applied +billing rates, download an invoice, and edit its invoice number with the row's edit/save actions. + +![Provider product orders list](images/user/ug-33-orders-provider.png) + +![Provider order details with item actions](images/user/ug-33-order-details.png) + +![Order item state change confirmation](images/user/ug-33-confirm-action.png) + +![Order notes](images/user/ug-33-order-notes.png) + +## Quotes + +Quotes support services whose scope and price need to be agreed with the customer. When enabled, the user menu's +**Quotes** entry opens the **Tailored offerings Dashboard**, with **As Customer** and **As Provider** views. + +### Request a tailored offer + +1. Open a tailored offer's detail page and select **Create quote**. +2. In **Request Quote**, review the product and provider. +3. Enter **Message / Requirements**, with at least 10 characters, explaining the scope, configuration, quantities, or + questions the provider should consider. +4. Set the required **Request Date** for the quote. +5. Select **Send Request** and close the confirmation. +6. Open **Quotes** → **As Customer** to follow the request. + +Use **Filter by status** to find a request and **Refresh** to reload the dashboard. The rows identify the request date, +other party, product, and current status. + +![Request Quote form](images/user/ug-34-request-quote.png) + +![Tailored offerings dashboard, As Customer](images/user/ug-34-quotes-customer.png) + +### Negotiate and accept a proposal + +Open a request's **Details** to review the participants, request, dates, state, and attachments. The dialog explains the +current stage and available actions. Use **Chat** to exchange messages with the other party; messages remain associated +with the quote. + +The tailored-offer workflow is: + +1. The provider opens **Quotes** → **As Provider**, reviews the request, and sets an **Expected Date** for delivering + the proposal. +2. The provider selects **Accept Quote** and confirms to begin preparing the proposal. +3. The provider uploads the proposal as a PDF attachment, up to 10 MB. The submitted proposal becomes available to the customer. +4. The customer opens **Details**, downloads the proposal, and uses **Chat** to discuss it. +5. The customer selects **Accept Quote** and confirms when satisfied with the proposal. The available **Cancel Quote** + action can end the negotiation instead. +6. After acceptance, the provider uses **Create Offer** to prepare the agreed customer-specific offer. + +The dashboard describes the successive stages as request sent/received, request accepted, offering submitted, +and offering accepted. Use the state explanation in **Details** to see the next action for your role. + +![Tailored offerings dashboard, As Provider](images/user/ug-35-quotes-provider.png) + +![Quote accepted by the provider with expected date and PDF upload](images/user/ug-35-provider-accepted.png) + +![Proposal submitted to the customer](images/user/ug-35-proposal-uploaded.png) + +![Customer accepting the proposal](images/user/ug-35-customer-accept-action.png) + +![Quote chat](images/user/ug-35-chat.png) + +### Create the agreed customer-specific offer + +As the provider, open the accepted quote's **Details** and select **Create Offer**. The marketplace opens the +**Create product offer** workflow for the agreed product, with the steps **Party Info**, **Price Plans**, +**Procurement Mode**, and **Summary**. + +1. In **Party Info**, select the customer organization the exclusive offer is for. Use the search box to find it. +2. In **Price plans**, choose **Free** or **Online paid price** for the agreed offer. For online pricing, add a plan + with its name and description, and define its price components and any configuration profile. +3. Select the **Procurement Mode** and any external billing connection. +4. Review the summary, which identifies the customer for the exclusive offer. +5. Select **Create product offer**. + +The customer can then acquire the agreed offer through the marketplace's order process. + +The customer-specific pricing editor uses drawers for the plan, its configuration profile, and its price components. +Use **Add Tier Pricing** for range-based pricing, then save the plan before advancing to procurement. The pricing type +is shared by the plans in this offer; choose it before adding plans. + +![Create Offer action of an accepted quote](images/user/ug-36-create-offer-action.png) + +![Party Info step of the customer-specific offer](images/user/ug-36-party.png) + +![Summary of the exclusive offer for the customer](images/user/ug-36-summary.png) + +## Tenders + +Tenders let a customer send a common request to several providers and compare their proposals. When enabled, open +**Tenders** from the user menu. The dashboard provides **As Buyer** and **As Provider** views. + +### Create and submit a tender + +In **As Buyer**, select **Create Tender**: + +1. Enter the required **Tender Title** and select **Save**. +2. Set **Tender Start Date** and **Tender End Date**. Use the date fields or picker; the end date must follow the start date. +3. Upload the required **PDF Attachment** describing the request. The limit is 10 MB. +4. Select **Next: Select Providers**. +5. Narrow the provider candidates using **All Categories**, **Compliance Levels**, **Addressable Sectors**, **Country**, + and **Integration Framework**. Use **Clear all** to reset these filters. +6. Select the providers to invite and choose **Save Providers List**. +7. Review **Already Invited Providers**. Add other providers or remove invitations as needed before submission. +8. Select **Submit Tender** and confirm **Finalize** to notify the invited providers. + +Saving the title creates a tender you can continue preparing. Before submission, use **Edit** on the dashboard to +complete the tender, replace its request document, or adjust its provider list. + +![Tender title, dates and PDF request](images/user/ug-37-create-tender.png) + +![Provider selection with filters](images/user/ug-38-select-providers.png) + +![Already invited providers](images/user/ug-38-invited-providers.png) + +![Finalize tender confirmation](images/user/ug-38-submit-confirm.png) + +### Follow responses and select an offer + +In **As Buyer**, the dashboard shows the tender title, status, start and end dates, and request attachment. Expand a +submitted tender to see **Related Provider Quotes**, with each provider's state, attachments, chat, and details. + +The tender's status progresses through **Not Yet Submitted**, **Invites Sent, Waiting Acceptance**, **Tender Started**, +and **Tender Closed**. Check its dates and current status before expecting provider proposals or selecting a response. + +Use **Broadcast** on an expanded tender, or **Broadcast Message** in its details, to send the same message to all invited +providers. Use a provider quote's **Chat** for an individual conversation. + +As an invited provider: + +1. Open **Tenders** → **As Provider** and select **Details** on the request. +2. Review the customer request PDF and tender dates. +3. Set the expected proposal date when requested, then use **Accept Invite** to participate, or **Cancel Quote** to decline. +4. When the tender is open for proposals, upload the response PDF using the attachment control in **Details**. +5. Follow the request's state and use **Chat** for clarifications with the customer. + +After the tender closes, the buyer can review the proposals, open the chosen provider quote, and select **Accept Quote**. +Confirming the selection accepts that proposal and rejects the other provider offers in the tender. The selected provider +can then use **Create Offer** to prepare the customer-specific offer. + +Use **Cancel Tender** in the tender's details to cancel the tender and its related requests; review the confirmation +before proceeding. + +![Buyer tender dashboard with related provider quotes](images/user/ug-39-tender-expanded.png) + +![Provider tenders dashboard](images/user/ug-39-tenders-provider.png) + +![Tender invitation details with Accept Invite](images/user/ug-39-provider-invite-actions.png) + +## Analytics and support + +When **Analytics** is available in the user menu, open it to view the **Analytics Dashboard**. Its **Business Insights** +tab presents the configured marketplace business dashboard, and **Usage Monitor** presents platform usage monitoring. +Use each dashboard's own controls to explore its data. **Open Superset** opens the reporting service in a separate tab +where available. A tab shows **No dashboard configured** until the operator configures its dashboard; see the +[Administrator Guide](admin-guide.md). + +![Analytics dashboard with Business Insights and Usage Monitor tabs](images/user/ug-40-analytics.png) + +Select **Blog** in the header to read published articles. Open an article to read its full content. + +For questions about a service, open the provider's page from the offer details or its catalogue. Use the provider's +**Support & Contact** information to contact the organization. diff --git a/doc/user-guide.rst b/doc/user-guide.rst deleted file mode 100644 index 5d76972..0000000 --- a/doc/user-guide.rst +++ /dev/null @@ -1,985 +0,0 @@ -========== -User Guide -========== - -This user guide contains a description of the different tasks that can be performed in the Business API Ecosystem using -its web interface. This section is organized so the actions related to a particular user role are grouped together. - -Using Organizations -=================== - -The Business API Ecosystem supports organizations as defined by the FIWARE IdM. These organizations -can use the system as if they were users, being possible to create organizations catalogs and offerings or acquire them. - -To use the platform on behalf an organization the user belongs, it is needed to change the platform context. To do that, -it is used the *Switch Session* option of the user menu. - -.. image:: ./images/user/org.png - :align: center - :scale: 50% - -Profile Configuration -===================== - -All the users of the system can configure their profile, so they can configure their personal information as well as their -billing addresses and contact mediums. - -To configure the user profile, the first step is opening the user *Settings* located in the user menu. - -.. image:: ./images/user/profile1.png - :align: center - -In the displayed view, it can be seen that some information related to the account is already included (*Username*, *Email*, *Access token*). -This information is the one provided by the IdM after the login process. - -The profile to be updated depends on whether the user is acting on behalf an organization or himself. In both cases, to -update the profile, fill in the required information and click on *Update*. - -For users, personal information is provided. - -.. image:: ./images/user/profile2.png - :align: center - -.. note:: - Only the *First name* and *Last name* fields are mandatory - -For organizations, general organization info is provided. - -.. image:: ./images/user/profileOrg.png - :align: center - :scale: 50% - -Once you have created your profile, you can include contact mediums by going to the *Contact mediums* section. - -.. image:: ./images/user/profile3.png - :align: center - -In the *Contact Medium* section, there are two different tabs. On the one hand, the *Shipping addresses* tab, where you -can register the shipping addresses you will be able to use when creating orders and purchasing products. - -To create a shipping address, fill in the fields and click on *Create* - -.. image:: ./images/user/profile4.png - :align: center - -Once created, you can edit the address by clicking on the *Edit* button of the specific address, and changing the -wanted fields. - -.. image:: ./images/user/profile5.png - :align: center - -.. image:: ./images/user/profile6.png - :align: center - -On the other hand, if you have the *Seller* role you can create *Business Addresses*, which can be used by your customers -in order to allow them to contact you. - -.. image:: ./images/user/profile7.png - :align: center - -In the *Business Addresses* tab you can create, different kind of contact mediums, including emails, phones, and addresses. -To create a contact medium, fill in the fields and click on *Create* - -.. image:: ./images/user/profile8.png - :align: center - -.. image:: ./images/user/profile9.png - :align: center - -.. image:: ./images/user/profile10.png - :align: center - -You can *Edit* or *Remove* the contact medium by clicking on the corresponding button - -.. image:: ./images/user/profile11.png - :align: center - -Admin -===== - -If the external IDPs feature is enabled, admins should login in the system with the local IDPs by directly accessing -to the login URL in the browser: :: - - https://[marketurl]/login - -If the external IDP is disabled, the login button will use the local IDP. - -If the user of the Business API Ecosystem is an admin, he will be able to access the *Administration* section of the -web portal. This section is located in the user menu. - -.. image:: ./images/user/cat1.png - :align: center - -Manage Categories ------------------ - -Admin users are authorized to create the system categories that can be used by *Sellers* to categorize their catalogs, -products, and offerings. - -To create categories, go to the *Administration* section, and click on *New* - -.. image:: ./images/user/cat2.png - :align: center - -Then, provide a name and an optional description for the category. Once the information has been included, click on *Next*, and then on *Create* - -.. image:: ./images/user/cat3.png - :align: center - -.. image:: ./images/user/cat4.png - :align: center - -Categories in the Business API Ecosystem can be nested, so you can choose a parent category if you want while creating. - -.. image:: ./images/user/cat5.png - :align: center - -Existing categories can be updated. To edit a category click on the category name. - -.. image:: ./images/user/cat6.png - :align: center - -Then edit the corresponding fields and click on *Update*. - -.. image:: ./images/user/cat7.png - :align: center - -Manage IDPs ------------ - -If the external IDPs option is enabled, *admins* are authorized to register them using the *Administration* section. - -To list existing IDPs access to *IDPs*: - -.. image:: ./images/admin/idps1.png - :align: center - -.. image:: ./images/admin/idps2.png - :align: center - -To register a new IDP click in *New*. In the displayed form, fill the *IDP EORI* with the EORI given to the IDP -by the trust provider (i.e iShare). Provide a name and an optional description and fill *Server* with the URL -of the IDP. - -.. image:: ./images/admin/idps3.png - :align: center - -Seller -====== - -If the user of the Business API Ecosystem has the *Seller* role, he will be able to monetize his products by creating, -catalogs, product specifications and product offerings. All these objects are managed accessing *My Stock* section. - -.. image:: ./images/user/catalog1.png - :align: center - :scale: 50% - -Manage Catalogs ---------------- - -The *Catalogs* section is the one that is open by default when the seller accesses *My Stock* section. This section -contains the catalogs the seller has created. - -.. image:: ./images/user/catalog2.png - :align: center - :scale: 50% - -Additionally, it has been defined several mechanisms for searching and filtering the list of catalogs displayed. On the one -hand, it is possible to search catalogs by keyword using the search input provided in the menu bar. On the other hand, -it is possible to specify how catalog list should be sorted or filter the shown catalogs by status and the role you are -playing. To do that, click on *Filters*, choose the required parameters, and click on *Close*. - -.. image:: ./images/user/catalog8.png - :align: center - :scale: 50% - -.. image:: ./images/user/catalog9.png - :align: center - :scale: 50% - -To create a new catalog click on the *New* button. - -.. image:: ./images/user/catalog3.png - :align: center - :scale: 50% - -Then, provide a name and an optional description for the catalog. Once you have filled the fields, click on *Next*, and then on *Create* - -.. image:: ./images/user/catalog4.png - :align: center - -.. image:: ./images/user/catalog5.png - :align: center - -Sellers can also update their catalogs. To do that, click on the name of the catalog to open the update view. - -.. image:: ./images/user/catalog6.png - :align: center - :scale: 50% - -Then, update the fields you want to modify and click on *Update*. In this view, it is possible to change the *Status* of the -catalog. To start monetizing the catalog, and make it appear in the *Home* you have to change its status to *Launched* - -.. image:: ./images/user/catalog7.png - :align: center - -Manage Product Specifications ------------------------------ - -Product Specifications represent the product being offered, both digital and physical. To list your product specifications -go to *My Stock* section and click on *Product Specifications* - -.. image:: ./images/user/product1.png - :align: center - :scale: 50% - -In the same way as catalogs, product specifications can be searched by keyword, sorted, or filtered by status and whether -they are bundles or not. To filter or sort product specifications, click on *Filters*, choose the appropriate properties, and click on *Close* - -.. image:: ./images/user/product2.png - :align: center - :scale: 50% - -.. image:: ./images/user/product3.png - :align: center - :scale: 50% - -Additionally, it is possible to switch between the grid view and the tabular view using the provided buttons. - -.. image:: ./images/user/product4.png - :align: center - :scale: 50% - -.. image:: ./images/user/product5.png - :align: center - :scale: 50% - -To create a new product specification click on *New* - -.. image:: ./images/user/product6.png - :align: center - :scale: 50% - -In the displayed view, provide the general information of the product spec. including its name, version, and an optional -description. In addition, you have to include the product brand (Your brand), and an ID number which identifies the product -in your environment. Then, click on *Next*. - -.. image:: ./images/user/product7.png - :align: center - -In the next step, you can choose whether your product specification is a bundle or not. Product bundles are logical containers -that allow you to sell multiple products as if it were a single one. Once you have selected the right option click on *Next* - -.. image:: ./images/user/product8.png - :align: center - -If you have decided to create a bundle, you will be required to choose 2 or more product specs to be included in the bundle. - -.. image:: ./images/user/product9.png - :align: center - -In the next step you can choose if your product is a digital product. If this is the case, you will be required to provide -the asset. - -.. note:: - If you are creating a product bundle, you will not be allowed to provide a digital asset since the offered ones will - be the included in the bundled products - -For providing the asset, you have to choose between the available asset types, choose how to provide the asset between the -available options, provide the asset, and include its media type. - -.. image:: ./images/user/product10.png - :align: center - -.. image:: ./images/user/product11.png - :align: center - -The next step in the creation of a product is including its characteristics. For including a new characteristic click on -*New Characteristic* - -.. image:: ./images/user/product12.png - :align: center - -In the form, include the name, the type (string or number) and an optional description. Then create the values of the -characteristic by filling the *Create a value* input and clicking on *+*. - -.. image:: ./images/user/product13.png - :align: center - -Once you have included all the characteristic info, save it clicking on *Create* - -.. image:: ./images/user/product14.png - :align: center - -Once you have included all the required characteristics click on *Next* - -.. image:: ./images/user/product15.png - :align: center - -In the next step you can include a picture for your product spec. You have two options, providing an URL pointing to the -picture or directly uploading it. In addition, it is possible to include multiple file attachments -to the product spec, such as images, PDF documentation, etc. Once provided click *Next* - -.. image:: ./images/user/product16.png - :align: center - -.. image:: ./images/user/product17.png - :align: center - -In the last step, you can specify relationships of the product you are creating with other of your product specs. - -.. image:: ./images/user/product18.png - :align: center - -Once done click on *Next* and then on *Create* - -.. image:: ./images/user/product19.png - :align: center - -Sellers can update their products. To do that click on the product specification to be updated. - -.. image:: ./images/user/product20.png - :align: center - :scale: 50% - -Update the required values and click on *Update*. Note that for start selling an offering that includes the product specification -you will be required to change its status to *Launched* - -.. image:: ./images/user/product21.png - :align: center - :scale: 50% - -.. note:: - For digital products it is not allowed to update the version using this form. Instead it is required to follow the - process for upgrading the product version. - -The basic information of the product specification is not the only information that can be updated, but it is also possible -to update the *Attachments* and the *Relationships* by clicking of the related tab. - -.. image:: ./images/user/product22.png - :align: center - :scale: 50% - -.. image:: ./images/user/product23.png - :align: center - :scale: 50% - -The displayed details form can be used for digital products specifications in order to provide new versions of the digital assets -being offered. This can be done by clicking on *Upgrade*. - -.. image:: ./images/user/product24.png - :align: center - :scale: 50% - -In the displayed form, it is required to include a new version for the product specification and to provide the new digital -asset to be offered. - -.. image:: ./images/user/product25.png - :align: center - :scale: 50% - -.. note:: - All the customers who have acquired an offering including the current product specification will be able to access to - the new version of the digital asset. - -Manage Product Offerings ------------------------- - -Product Offerings are the entities that contain the pricing models and revenue sharing info used to monetize a product specification. -To list your product offerings, go to *My Stock* section and click on *Offerings* - -.. image:: ./images/user/offering1.png - :align: center - :scale: 50% - -The existing product offerings can be searched by keyword, sorted, or filtered by status and whether they are bundles or not. -To filter or sort product offerings, click on *Filters*, choose the appropriate properties, and click on *Close* - -.. image:: ./images/user/offering2.png - :align: center - :scale: 50% - -.. image:: ./images/user/offering3.png - :align: center - :scale: 50% - -Additionally, it is possible to switch between the grid view and the tabular view by clicking on the specific button. - -.. image:: ./images/user/offering4.png - :align: center - :scale: 50% - -.. image:: ./images/user/offering5.png - :align: center - :scale: 50% - -To create a new offering click on *New* - -.. image:: ./images/user/offering6.png - :align: center - :scale: 50% - -In the displayed form, include the basic info of the offering. Including, its name, version, an optional description, and -an optional set of places where the offering is available. Once the information has been provided click on *Next* - -.. image:: ./images/user/offering7.png - :align: center - -In the next step, you can choose whether your offering is a bundle or not. In this case, offering bundles are logical -containers that allow you to provide new pricing models when a set of offerings are acquired together. Once selected click -on *Next* - -.. image:: ./images/user/offering8.png - :align: center - -If you want to create a bundle you will be required to include at least two bundled offerings. - -.. image:: ./images/user/offering9.png - :align: center - -In the next step you have to select the product specification that is going to be monetized in the current offering. Once -selected click on *Next*. - -.. image:: ./images/user/offering10.png - :align: center - -.. note:: - If you are creating an offering bundle, you will not be allowed to include a product specification - -Then, you have to select the catalog where you want to publish you offering and click on *Next* - -.. image:: ./images/user/offering11.png - :align: center - -In the next step, you can optionally choose categories for you offering. Once done, click on *Next* - -.. image:: ./images/user/offering12.png - :align: center - -Next, it is possible to include the License or terms and conditions to be applied to the offering being created. -There are three different options for prividing such information: (1) For data, there is a set of standard open data -licenses that can be chosen, (2) providing custom terms and conditions using a wizzard, and (3) providing terms and -conditions providing free text. - -.. image:: ./images/user/offering12b.png - :align: center - -.. image:: ./images/user/offering12c.png - :align: center - -.. image:: ./images/user/offering12d.png - :align: center - -It is possible to include some SLA information attached to the offering in the step of the form. To do that, click -on *Define new metric* button. In the displayed form. choose a metric, provide its value and click on *Add metric*. - -.. image:: ./images/user/offering12e.png - :align: center - -Once all the metrics have been provided click on *Next* - -.. image:: ./images/user/offering12f.png - :align: center - -The next step is the most important for the offering. In the displayed form you can create different price plans for -you offering, which will be selectable by customers when acquiring the offering. If you do not include any price plan -the offering it is considered free. - -To include a new price plan the first step is clicking on *New Price Plan* - -.. image:: ./images/user/offering13.png - :align: center - -For creating the price plan, you have to provide a name, and an optional description. Then, you have to choose the type -of price plan between the provided options. - -The available types are: *one time* for payments that are made once when purchasing the offering, *recurring* for charges -that are made periodically (e.g a monthly payment), and *usage* for charges that are calculated applying the pricing model -to the actual usage made of the acquired service. - -If you choose *one time*, you have to provide the price and the currency. - -.. image:: ./images/user/offering14.png - :align: center - -If you choose *recurring*, you have to provide the price, the currency, and the period between charges. - -.. image:: ./images/user/offering15.png - :align: center - -If you choose usage, you have to provide the unit to be accounted, the currency, and the price per unit - -.. image:: ./images/user/offering16.png - :align: center - -In addition to the basic pricing models it is possible to include price alterations using the *Price Alteration* -section. In this regard, it is possible to provide two types of alterations: (1) Price components, enable to extend -the model with a complementary pricing (e.g an initial or recurring fixed payment in a usage model). (2) fees and discounts, -which are applied to the original model when some condition is satisfied (e.g a 2% discount when more that 10k calls has been made) - -.. image:: ./images/user/offering16b.png - :align: center - -.. image:: ./images/user/offering16c.png - :align: center - -You can update or remove plans by clicking on the corresponding action button. - -.. image:: ./images/user/offering17.png - :align: center - -Once you have created you pricing model click on *Next* - -.. image:: ./images/user/offering18.png - :align: center - -In the last step of the process, you have to choose the revenue sharing model to be applied to you offering between the -available ones. Once done, click on *Next* and then on *Create*. - -.. image:: ./images/user/offering19.png - :align: center - -.. image:: ./images/user/offering20.png - :align: center - -Sellers can also edit their offerings. To do that click on the offering to be updated. - -.. image:: ./images/user/offering21.png - :align: center - :scale: 50% - -In the displayed form, change the fields you want to edit and click on *Update*. Note that for start selling you offering -you have to update its status to *Launched* - -.. image:: ./images/user/offering22.png - :align: center - :scale: 50% - -It is also possible to update the *Price Plans* and *Categories* of the offering by accessing to the related tab. - -.. image:: ./images/user/offering23.png - :align: center - :scale: 50% - -.. image:: ./images/user/offering24.png - :align: center - :scale: 50% - - -Manage Revenue Sharing Models ------------------------------ - -Revenue Sharing Models specify how the revenues generated by an offering or set of offerings must be distributed between -the owner of the Business API Ecosystem instance, the provider of the offering, and the related stakeholders involved. - -To manage RS models go to the *Revenue Sharing* section. - -.. image:: ./images/user/revenue1.png - :align: center - -In this view, you can see the revenue sharing models you have available. By default it will appear the default RS model -which establishes the revenue distribution between you and the Business API Ecosystem instance owner. - -.. image:: ./images/user/revenue2.png - :align: center - -You can create a new RS model clicking on *New* - -.. image:: ./images/user/revenue3.png - :align: center - -In the first step of the process you have to provide a product class, which identifies the RS model, and the percentage -you want to receive. The platform percentage is fixed and cannot be modified. Once provided click on *Next* - -.. image:: ./images/user/revenue4.png - :align: center - -In the next step, you can optionally add more stakeholders to the RS model. To do that click on *New Stakeholder* - -.. image:: ./images/user/revenue5.png - :align: center - -Then, select the Stakeholder between the available users, and provide its percentage. Finally, save it clicking on *Create* - -.. image:: ./images/user/revenue6.png - :align: center - -.. note:: - The total percentage (provider + platform + stakeholders) must be equal to 100 - -Finally, click on *Next* and then on *Create* - -.. image:: ./images/user/revenue7.png - :align: center - -.. image:: ./images/user/revenue8.png - :align: center - -Sellers can also update their RS model. To do that click on the RS model to be updated. - -.. image:: ./images/user/revenue9.png - :align: center - -Then, update the required fields (including the stakeholders if you want), and click on *Save Changes* - -.. image:: ./images/user/revenue10.png - :align: center - -Manage Transactions -------------------- - -Sellers can manage the transactions related to their products in order to know how much money their products are generating, -and to launch the revenue sharing process. To manage your seller transactions go to *Revenue Sharing* and click on *Transactions* - -.. image:: ./images/user/tran1.png - :align: center - -In the displayed view, you can see the transactions pending to be paid to you and your stakeholders. It is also possible -to display the transactions in tabular way - -.. image:: ./images/user/tran2.png - :align: center - -.. image:: ./images/user/tran3.png - :align: center - -These transactions are aggregated and paid by the Business API Ecosystem periodically once a month. Nevertheless, if you -need to be paid, you can force the revenue sharing calculus and payment of your pending transactions by manually generating -a revenue sharing report. - -To create a new report click on *New Report* - -.. image:: ./images/user/tran4.png - :align: center - -In the displayed modal, choose the product classes to be calculated and click on *Create* - -.. image:: ./images/user/tran5.png - :align: center - -This process will aggregate all the transactions with the selected product classes, calculate the amount to be paid to -each stakeholder using the related revenue sharing model, generate a revenue sharing report, -and pay the seller and the stakeholders using their PayPal account. - -You can see the generated reports clicking on *RS Reports* - -.. image:: ./images/user/tran6.png - :align: center - -.. image:: ./images/user/tran7.png - :align: center - -.. note:: - Sellers would need to have a PayPal account associated to the email of their FIWARE IdM account in order to be paid for - their products - -Manage Received Orders ----------------------- - -Sellers can manage the orders they have received in order to see the chosen characteristics, read customer notes, or -process the order in case it has been acquired a physical product. - -To view your received orders go to *My inventory* section, click on *Product orders*, and open the *Received* section. - -.. image:: ./images/user/provord1.png - :align: center - -.. image:: ./images/user/provord2.png - :align: center - -.. image:: ./images/user/provord3.png - :align: center - -You can view the details of a received order clicking on the order date - -.. image:: ./images/user/provord4.png - :align: center - -In the displayed view you can review the details of the order and the details of your products acquired by the customer, -including the chosen characteristics. - -Additionally, you can view the customer notes clicking on the *Notes* tab - -.. image:: ./images/user/provord5.png - :align: center - -You can also give a reply to customer notes including it in the text area and clicking on the send button - -.. image:: ./images/user/provord6.png - :align: center - -If the acquired product is not digital, the order needs to be processed manually by the seller, in the sense that the -seller will have to send the acquired product to the customer. To deal with this situation, the order details view allows -sellers to manually change the status of the order. - -To reject a received order you have to click in the *Reject* button located in the search or in the details view of the order. - -.. image:: ./images/user/provord7.png - :align: center - -.. image:: ./images/user/provord8.png - :align: center - -In case you accept the order and send the product to the customer, you have to put it as *inProgress* clicking on the *Sent* button - -.. image:: ./images/user/provord9.png - :align: center - -.. image:: ./images/user/provord10.png - :align: center - -Finally, when the product arrives at its destination, you have to put it as *Completed* clicking on the *Delivered* button - -.. image:: ./images/user/provord11.png - :align: center - -.. image:: ./images/user/provord12.png - :align: center - - -Customer -======== - -All of the users of the system have by default the *Customer* role. Customers are able to create orders for acquiring -offerings. - -List Available Offerings ------------------------- - -All the available (*Launched*) offerings appear in the *Home* page of the Business API Ecosystem, so they can be seen by -customers. - -.. image:: ./images/user/search1.png - :align: center - :scale: 50% - -Additionally, customers can select a specific catalog of offerings by clicking on it. - -.. image:: ./images/user/search2.png - :align: center - :scale: 50% - -.. image:: ./images/user/search3.png - :align: center - :scale: 50% - -Moreover, customers can filter the shown offerings by category using the categories dropdown and choosing the wanted one. - -.. image:: ./images/user/search4.png - :align: center - :scale: 50% - -Customers can also filter bundle or single offerings using the *Filters* modal as well as choosing its sorting. - -.. image:: ./images/user/search5.png - :align: center - :scale: 50% - -.. image:: ./images/user/search6.png - :align: center - :scale: 50% - -Finally, customers can search offerings by keyword using the provided search bar - -.. image:: ./images/user/search6b.png - :align: center - :scale: 50% - -Customers can open the details of an offering by clicking on it - -.. image:: ./images/user/search7.png - :align: center - :scale: 50% - -In the displayed view, it is shown the general info about the offering and its included product, the characteristics of -the product, the price plans of the offering, and the existing relationships. - -.. image:: ./images/user/search8.png - :align: center - :scale: 50% - -.. image:: ./images/user/search9.png - :align: center - :scale: 50% - -.. image:: ./images/user/search10.png - :align: center - :scale: 50% - -Create Order ------------- - -Customers can create orders for acquiring offerings. The different offerings to be included in an order are managed using -the *Shopping Cart*. - -To include an offering in the shopping cart there are two possibilities. You can click on the *Add to Cart* button located -in the offering panel when searching, or you can click on the *Add to Cart* button located in the offering details view. - -.. image:: ./images/user/order1.png - :align: center - :scale: 50% - -.. image:: ./images/user/order2.png - :align: center - :scale: 50% - -If the offering has configurable characteristics, multiple price plans or terms and conditions, a modal will be displayed where you can select -your preferred options - -.. image:: ./images/user/order3.png - :align: center - :scale: 50% - -.. image:: ./images/user/order4.png - :align: center - :scale: 50% - -.. image:: ./images/user/order4b.png - :align: center - :scale: 50% - -Once you have selected your preferences for the offering click on *Add to Cart* - -.. image:: ./images/user/order5.png - :align: center - :scale: 50% - -Once you have included all the offerings you want to acquire to the shopping cart, you can create the order clicking on -*Shopping Cart*, and then on *Checkout* - -.. image:: ./images/user/order6.png - :align: center - :scale: 50% - -In the displayed form, you can include an optional name, an optional description, or an optional note. Notes can include -any additional information you want to provide to the sellers of the acquired offerings. - -Then, you have to choose a priority for your order, and select one of your shipping addresses. - -Once you have provided all the required information you can start the order creation clicking on *Checkout* - -.. image:: ./images/user/order7.png - :align: center - -In the next step, you will be redirected to *PayPal* so you can pay for the offerings according to their pricing models - -.. image:: ./images/user/order8.png - :align: center - -Finally, you will see a confirmation page - -.. image:: ./images/user/order9.png - :align: center - -Manage Acquired Products ------------------------- - -The products you have acquired are located in *My Inventory*, there you can list them, check their status, or download -different assets. - -.. image:: ./images/user/inv1.png - :align: center - -In this view, it is possible to filter you products by its status. To do that click on *Filters*, select the related statuses, -and click on *Close* - -.. image:: ./images/user/inv2.png - :align: center - -.. image:: ./images/user/inv3.png - :align: center - -It is also possible to switch between the grid and tabular views using the related buttons - -.. image:: ./images/user/inv4.png - :align: center - -.. image:: ./images/user/inv5.png - :align: center - -You can manage a specific acquired product clicking on it - -.. image:: ./images/user/inv6.png - :align: center - -In the displayed view, you can see the general info of the acquired product, and the characteristics and pricing you have selected. - -.. image:: ./images/user/inv7.png - :align: center - -.. image:: ./images/user/inv8.png - :align: center - -.. image:: ./images/user/inv9.png - :align: center - -Additionally, you can see your charges related to the product accessing to the *Charges* tab - -.. image:: ./images/user/inv10.png - :align: center - -In this tab, you will find detailed information of the different charges and you will be able to download the related invoice -clicking on *Download Invoice* - -.. image:: ./images/user/inv11.png - :align: center - -Moreover, this product view allows to download the related assets when the product is digital. To do that click on *Download* - -.. image:: ./images/user/inv12.png - :align: center - -In case the chosen pricing model defines a recurring payment or a usage payment, you will be able to renew your product -clicking on *Renew*. After clicking, you will be redirected to PayPal to pay the related amount. - -.. image:: ./images/user/inv13.png - :align: center - -.. note:: - If you product has expired and you do not renew it, it will be suspended, which means you will not have access to the - acquired service until you pay - -If the acquired product has a usage based price plan, you will be able to see your current consumption accessing the *Usage* tab - -.. image:: ./images/user/inv14.png - :align: center - -Manage Requested Orders ------------------------ - -Customers can manage some aspects of the orders they have created. To see your requested orders, go to *My Inventory* and -click on *Product Orders* - -.. image:: ./images/user/custord1.png - :align: center - -In the displayed view, you can see the orders you have created, which can be filtered by its status. To do that, click on -*Filters*, select the wanted statuses, and click on *Close* - -.. image:: ./images/user/custord2.png - :align: center - -.. image:: ./images/user/custord3.png - :align: center - -For those orders that include offerings of non digital products, you will be able to cancel them if the seller has not yet started -the process. To do that, locate the order to be canceled and click on *Cancel* - -.. image:: ./images/user/custord4.png - :align: center - -Moreover, you can review the details of the order. To do that click on the date of the order. - -.. image:: ./images/user/custord5.png - :align: center - -In the displayed view, you can see all the details of the order, as well as the included products. In addition, you can -leave a note for the seller in the *Notes* tab - -.. image:: ./images/user/custord6.png - :align: center - -To leave a note, write it in the provided text area and click on the send button - -.. image:: ./images/user/custord7.png - :align: center diff --git a/docker/compose/.env.example b/docker/compose/.env.example new file mode 100644 index 0000000..cbe6122 --- /dev/null +++ b/docker/compose/.env.example @@ -0,0 +1,22 @@ +# Copy this file to .env and adapt the values. + +# Public URL of the marketplace, as used by the browser (no trailing slash) +BAE_PUBLIC_URL=http://proxy.docker:8004 +BAE_PORT=8004 + +# Public URL of the identity provider, as used by the browser and by the Logic Proxy +IDM_PUBLIC_URL=http://idm.docker:3000 +IDM_PORT=3000 +IDM_DB_PASSWORD=change-me +IDM_ADMIN_EMAIL=admin@example.org +IDM_ADMIN_PASSWORD=change-me + +# Credentials of the application registered in the identity provider +OAUTH2_CLIENT_ID= +OAUTH2_CLIENT_SECRET= +OIDC_KEY= + +# Component versions +PROXY_VERSION=12.0.0 +CHARGING_VERSION=12.0.0 +TMF_VERSION=2.2.1 diff --git a/docker/compose/docker-compose.yml b/docker/compose/docker-compose.yml index f89e047..3d549d4 100644 --- a/docker/compose/docker-compose.yml +++ b/docker/compose/docker-compose.yml @@ -1,204 +1,213 @@ -version: '3' +# Reference deployment of the Business API Ecosystem with Docker Compose. +# See doc/installation-administration-guide.md for its use. Set the values in .env (see .env.example). +name: bae + services: - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1 - environment: - - discovery.type=single-node - ports: - - "127.0.0.1:9200:9200" - networks: - main: - - mongo: - image: mongo:4.4 - restart: always - networks: - main: - volumes: - - ./mongo-data:/data/db - - mysql: - image: mysql:5.7 - restart: always - volumes: - - ./mysql-data:/var/lib/mysql - networks: - main: - environment: - - MYSQL_ROOT_PASSWORD=my-secret-pw - - MYSQL_DATABASE=RSS - - charging: - image: fiware/biz-ecosystem-charging-backend:v8.1.0 - links: - - mongo - depends_on: - - mongo - networks: - main: - aliases: - - charging.docker - ports: - - 8006:8006 - volumes: - - ./charging-bills:/business-ecosystem-charging-backend/src/media/bills - - ./charging-assets:/business-ecosystem-charging-backend/src/media/assets - - ./charging-plugins:/business-ecosystem-charging-backend/src/plugins - - ./charging-inst-plugins:/business-ecosystem-charging-backend/src/wstore/asset_manager/resource_plugins/plugins - environment: - - BAE_CB_PAYMENT_METHOD=None # paypal or None (testing mode payment disconected) - # - BAE_CB_PAYPAL_CLIENT_ID=client_id - # - BAE_CB_PAYPAL_CLIENT_SECRET=client_secret - - # ----- Database configuration ------ - - BAE_CB_MONGO_SERVER=mongo - - BAE_CB_MONGO_PORT=27017 - - BAE_CB_MONGO_DB=charging_db - # - BAE_CB_MONGO_USER=user - # - BAE_CB_MONGO_PASS=passwd - - # ----- Roles Configuration ----- - - BAE_LP_OAUTH2_ADMIN_ROLE=admin - - BAE_LP_OAUTH2_SELLER_ROLE=seller - - BAE_LP_OAUTH2_CUSTOMER_ROLE=customer - - # ----- Email configuration ------ - - BAE_CB_EMAIL=charging@email.com - # - BAE_CB_EMAIL_USER=user - # - BAE_CB_EMAIL_PASS=pass - # - BAE_CB_EMAIL_SMTP_SERVER=smtp.server.com - # - BAE_CB_EMAIL_SMTP_PORT=587 - - - BAE_CB_VERIFY_REQUESTS=True # Whether or not the BAE validates SSL certificates on requests to external components - - # ----- Site configuration ----- - - BAE_SERVICE_HOST=http://proxy.docker:8004/ # External URL used to access the BAE - - BAE_CB_LOCAL_SITE=http://charging.docker:8006/ # Local URL of the charging backend - - # ----- APIs Conection config ----- - - BAE_CB_CATALOG=http://apis.docker:8080/DSProductCatalog - - BAE_CB_INVENTORY=http://apis.docker:8080/DSProductInventory - - BAE_CB_ORDERING=http://apis.docker:8080/DSProductOrdering - - BAE_CB_BILLING=http://apis.docker:8080/DSBillingManagement - - BAE_CB_RSS=http://rss.docker:8080/DSRevenueSharing - - BAE_CB_USAGE=http://apis.docker:8080/DSUsageManagement - - BAE_CB_AUTHORIZE_SERVICE=http://proxy.docker:8004/authorizeService/apiKeys - - proxy: - image: fiware/biz-ecosystem-logic-proxy:v8.1.0 - links: - - mongo - - elasticsearch - depends_on: - - mongo - - elasticsearch - networks: - main: - aliases: - - proxy.docker - ports: - - 8004:8004 - volumes: - - ./proxy-themes:/business-ecosystem-logic-proxy/themes - - ./proxy-static:/business-ecosystem-logic-proxy/static - - ./proxy-locales:/business-ecosystem-logic-proxy/locales - environment: - - NODE_ENV=development # Deployment in development or in production - - COLLECT=True # Execute the collect static command on startup - - - BAE_LP_PORT=8004 # Port where the node service is going to run in the container - - BAE_LP_HOST=proxy.docker # Host where the node service if going to run in the container - # - BAE_SERVICE_HOST=https://store.lab.fiware.org/ # If provided, this URL specifies the actual URL that is used to access the BAE, when the component is proxied (e.g Apache) - # - BAE_LP_HTTPS_ENABLED=true # If provided specifies whether the service is running in HTTPS, default: false - # - BAE_LP_HTTPS_CERT=cert/cert.crt # Certificate for the SSL configuration (when HTTPS enabled is true) - # - BAE_LP_HTTPS_CA=cert/ca.crt # CA certificate for the SSL configuration (when HTTPS enabled is true) - # - BAE_LP_HTTPS_KEY=cert/key.key # Key sfile for the SSL configuration (when HTTPS enabled is true) - # - BAE_LP_HTTPS_PORT=443 # Port where the service runs when SSL is enabled (when HTTPS enabled is true) - - # ------ OAUTH2 Config ------ - - BAE_LP_OAUTH2_SERVER=http://idm.docker:3000 # URL of the FIWARE IDM used for user authentication - - BAE_LP_OAUTH2_CLIENT_ID=f0ab257d-7456-41e8-bb0a-002148ac0217 # OAuth2 Client ID of the BAE applicaiton - - BAE_LP_OAUTH2_CLIENT_SECRET=d5ea8cce-08ea-4cb2-8379-66bb35020cee # OAuth Client Secret of the BAE application - - BAE_LP_OAUTH2_CALLBACK=http://proxy.docker:8004/auth/fiware/callback # Callback URL for receiving the access tokens - - BAE_LP_OAUTH2_ADMIN_ROLE=admin # Role defined in the IDM client app for admins of the BAE - - BAE_LP_OAUTH2_SELLER_ROLE=seller # Role defined in the IDM client app for sellers of the BAE - - BAE_LP_OAUTH2_CUSTOMER_ROLE=customer # Role defined in the IDM client app for customers of the BAE - - BAE_LP_OAUTH2_ORG_ADMIN_ROLE=orgAdmin # Role defined in the IDM client app for organization admins of the BAE - - BAE_LP_OAUTH2_IS_LEGACY=false # Whether the used FIWARE IDM is version 6 or lower - - # - BAE_LP_THEME=theme # If provided custom theme to be used by the web site, it must be included in themes volume - - # ----- Mongo Config ------ - # - BAE_LP_MONGO_USER=user - # - BAE_LP_MONGO_PASS=pass - - BAE_LP_MONGO_SERVER=mongo - - BAE_LP_MONGO_PORT=27017 - - BAE_LP_MONGO_DB=belp - - - BAE_LP_REVENUE_MODEL=30 # Default market owner precentage for Revenue Sharing models - - BAE_LP_TAX_RATE=20 # Tax rate applied to offers in the marketplace - - # ----- Indexing engine ------- - - BAE_LP_INDEX_ENGINE=elasticsearch # Indexig engine: elasticsearch or local - - BAE_LP_INDEX_URL=elasticsearch:9200 # URL of elasticsearch - - BAE_LP_INDEX_API_VERSION=7 # API version of elasticsearch - - # ----- APIs Configuration ----- - # If provided, it supports configuring the contection to the different APIs managed by the logic proxy, by default - # apis.docker, charging.docker and rss.docker domains are configured - # - BAE_LP_ENDPOINT_CATALOG_PATH=DSProductCatalog - # - BAE_LP_ENDPOINT_CATALOG_PORT=8080 - # - BAE_LP_ENDPOINT_CATALOG_HOST=apis.docker - # - BAE_LP_ENDPOINT_CATALOG_SECURED=false - # ... - - apis: - image: fiware/biz-ecosystem-apis:v8.1.0 - restart: always - ports: - - 4848:4848 - - 8080:8080 - links: - - mysql - depends_on: - - mysql - networks: - main: - aliases: - - apis.docker - # volumes: - # - ./apis-conf:/etc/default/tmf/ # Used if not configured by environment - environment: - - BAE_SERVICE_HOST=http://proxy.docker:8004/ - - MYSQL_ROOT_PASSWORD=my-secret-pw - - MYSQL_HOST=mysql - - rss: - image: fiware/biz-ecosystem-rss:v8.0.0 - restart: always - ports: - - 9999:8080 - - 4444:4848 - - 1111:8181 - links: - - mysql - depends_on: - - mysql - networks: - main: - aliases: - - rss.docker - # volumes: - # - ./rss-conf:/etc/default/rss # Used if not configured by environment - environment: - - BAE_RSS_DATABASE_URL=jdbc:mysql://mysql:3306/RSS - - BAE_RSS_DATABASE_USERNAME=root - - BAE_RSS_DATABASE_PASSWORD=my-secret-pw - - BAE_RSS_DATABASE_DRIVERCLASSNAME=com.mysql.jdbc.Driver - - BAE_RSS_OAUTH_CONFIG_GRANTEDROLE=admin - - BAE_RSS_OAUTH_CONFIG_SELLERROLE=seller - - BAE_RSS_OAUTH_CONFIG_AGGREGATORROLE=Aggregator - -networks: - main: - external: true + # ----- Databases ----- + mongo: + image: mongo:6.0 + restart: unless-stopped + volumes: + - mongo-data:/data/db + + postgres: + image: postgis/postgis:16-3.4 + restart: unless-stopped + environment: + POSTGRES_USER: ngb + POSTGRES_PASSWORD: ngb + POSTGRES_DB: ngb + volumes: + - postgres-data:/var/lib/postgresql/data + + # ----- NGSI-LD broker and TM Forum APIs ----- + scorpio: + image: scorpiobroker/all-in-one-runner:java-6.0.1 + restart: unless-stopped + environment: + DBHOST: postgres + depends_on: + - postgres + + tmf: + image: quay.io/fiware/tmforum-all-in-one:${TMF_VERSION:-2.2.1} + restart: unless-stopped + environment: + MICRONAUT_SERVER_PORT: 8632 + MICRONAUT_ENVIRONMENTS: scorpio,in-memory + MICRONAUT_HTTP_SERVICES_NGSI_URL: http://scorpio:9090 + MICRONAUT_HTTP_SERVICES_NGSI_PATH: ngsi-ld/v1 + MICRONAUT_HTTP_SERVICES_NGSI_READ_TIMEOUT: 30s + GENERAL_SERVER_HOST: http://tmf:8632 + GENERAL_NGSILD_OR_QUERY_VALUE: "|" + GENERAL_NGSILD_OR_QUERY_KEY: "|" + GENERAL_INCLUDE_ATTRIBUTE_IN_LIST: "true" + GENERAL_ENCLOSE_QUERY: "true" + API_EXTENSION_ENABLED: "true" + depends_on: + - scorpio + + # ----- Identity provider (FIWARE Keyrock) ----- + idm-mysql: + image: mysql:5.7 + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: ${IDM_DB_PASSWORD} + volumes: + - idm-mysql-data:/var/lib/mysql + + idm: + image: fiware/idm:7.9.1 + restart: unless-stopped + ports: + - "${IDM_PORT:-3000}:3000" + networks: + default: + aliases: + - idm.docker + environment: + IDM_DB_HOST: idm-mysql + IDM_DB_USER: root + IDM_DB_PASS: ${IDM_DB_PASSWORD} + IDM_ADMIN_USER: admin + IDM_ADMIN_EMAIL: ${IDM_ADMIN_EMAIL} + IDM_ADMIN_PASS: ${IDM_ADMIN_PASSWORD} + depends_on: + - idm-mysql + + # ----- Business API Ecosystem ----- + charging: + image: fiware/biz-ecosystem-charging-backend:${CHARGING_VERSION:-12.0.0} + restart: unless-stopped + networks: + default: + aliases: + - charging.docker + volumes: + - charging-media:/opt/business-ecosystem-charging-backend/src/media + - charging-plugins:/opt/business-ecosystem-charging-backend/src/wstore/asset_manager/resource_plugins/plugins + environment: + BAE_CB_MONGO_SERVER: mongo + BAE_CB_MONGO_PORT: 27017 + BAE_CB_MONGO_DB: charging_db + + BAE_SERVICE_HOST: ${BAE_PUBLIC_URL}/ + BAE_CB_LOCAL_SITE: http://charging.docker:8006/ + BAE_CB_AUTHORIZE_SERVICE: http://proxy.docker:8004/authorizeService/apiKeys + + BAE_CB_CATALOG: http://tmf:8632/tmf-api/productCatalogManagement/v4 + BAE_CB_RESOURCE_CATALOG: http://tmf:8632/tmf-api/resourceCatalog/v4 + BAE_CB_SERVICE_CATALOG: http://tmf:8632/tmf-api/serviceCatalogManagement/v4 + BAE_CB_INVENTORY: http://tmf:8632/tmf-api/productInventory/v4 + BAE_CB_RESOURCE_INVENTORY: http://tmf:8632/tmf-api/resourceInventoryManagement/v4 + BAE_CB_SERVICE_INVENTORY: http://tmf:8632/tmf-api/serviceInventory/v4 + BAE_CB_PARTY: http://tmf:8632/tmf-api/party/v4 + BAE_CB_ORDERING: http://tmf:8632/tmf-api/productOrderingManagement/v4 + BAE_CB_BILLING: http://tmf:8632/tmf-api/accountManagement/v4 + BAE_CB_CUSTOMER_BILL: http://tmf:8632/tmf-api/customerBillManagement/v4 + BAE_CB_USAGE: http://tmf:8632/tmf-api/usageManagement/v4 + + BAE_LP_OAUTH2_ADMIN_ROLE: admin + BAE_LP_OAUTH2_SELLER_ROLE: seller + BAE_LP_OAUTH2_CUSTOMER_ROLE: customer + + BAE_CB_BILLING_ENGINE: local + BAE_CB_PAYMENT_METHOD: "None" + depends_on: + - mongo + - tmf + + proxy: + image: fiware/biz-ecosystem-logic-proxy:${PROXY_VERSION:-12.0.0} + restart: unless-stopped + ports: + - "${BAE_PORT:-8004}:8004" + networks: + default: + aliases: + - proxy.docker + environment: + NODE_ENV: production + COLLECT: "False" + BAE_LP_PORT: 8004 + BAE_LP_HOST: 0.0.0.0 + BAE_SERVICE_HOST: ${BAE_PUBLIC_URL}/ + BAE_LP_EXTERNAL_PORTAL: ${BAE_PUBLIC_URL} + BAE_LP_THEME: BAE + + BAE_LP_MONGO_SERVER: mongo + BAE_LP_MONGO_PORT: 27017 + BAE_LP_MONGO_DB: belp_db + + BAE_LP_OAUTH2_PROVIDER: fiware + BAE_LP_OAUTH2_SERVER: ${IDM_PUBLIC_URL} + BAE_LP_OAUTH2_CLIENT_ID: ${OAUTH2_CLIENT_ID} + BAE_LP_OAUTH2_CLIENT_SECRET: ${OAUTH2_CLIENT_SECRET} + BAE_LP_OAUTH2_CALLBACK: ${BAE_PUBLIC_URL}/auth/fiware/callback + BAE_LP_OIDC_KEY: ${OIDC_KEY} + BAE_LP_OAUTH2_ADMIN_ROLE: admin + BAE_LP_OAUTH2_SELLER_ROLE: seller + BAE_LP_OAUTH2_CUSTOMER_ROLE: customer + BAE_LP_OAUTH2_ORG_ADMIN_ROLE: orgAdmin + + BAE_LP_ENDPOINT_CATALOG_HOST: tmf + BAE_LP_ENDPOINT_CATALOG_PORT: 8632 + BAE_LP_ENDPOINT_CATALOG_PATH: /tmf-api/productCatalogManagement/v4 + BAE_LP_ENDPOINT_RESOURCE_HOST: tmf + BAE_LP_ENDPOINT_RESOURCE_PORT: 8632 + BAE_LP_ENDPOINT_RESOURCE_PATH: /tmf-api/resourceCatalog/v4 + BAE_LP_ENDPOINT_SERVICE_HOST: tmf + BAE_LP_ENDPOINT_SERVICE_PORT: 8632 + BAE_LP_ENDPOINT_SERVICE_PATH: /tmf-api/serviceCatalogManagement/v4 + BAE_LP_ENDPOINT_INVENTORY_HOST: tmf + BAE_LP_ENDPOINT_INVENTORY_PORT: 8632 + BAE_LP_ENDPOINT_INVENTORY_PATH: /tmf-api/productInventory/v4 + BAE_LP_ENDPOINT_RESOURCE_INVENTORY_HOST: tmf + BAE_LP_ENDPOINT_RESOURCE_INVENTORY_PORT: 8632 + BAE_LP_ENDPOINT_RESOURCE_INVENTORY_PATH: /tmf-api/resourceInventoryManagement/v4 + BAE_LP_ENDPOINT_SERVICE_INVENTORY_HOST: tmf + BAE_LP_ENDPOINT_SERVICE_INVENTORY_PORT: 8632 + BAE_LP_ENDPOINT_SERVICE_INVENTORY_PATH: /tmf-api/serviceInventory/v4 + BAE_LP_ENDPOINT_PARTY_HOST: tmf + BAE_LP_ENDPOINT_PARTY_PORT: 8632 + BAE_LP_ENDPOINT_PARTY_PATH: /tmf-api/party/v4 + BAE_LP_ENDPOINT_ORDERING_HOST: tmf + BAE_LP_ENDPOINT_ORDERING_PORT: 8632 + BAE_LP_ENDPOINT_ORDERING_PATH: /tmf-api/productOrderingManagement/v4 + BAE_LP_ENDPOINT_BILLING_HOST: tmf + BAE_LP_ENDPOINT_BILLING_PORT: 8632 + BAE_LP_ENDPOINT_BILLING_PATH: /tmf-api/accountManagement/v4 + BAE_LP_ENDPOINT_CUSTOMER_BILL_HOST: tmf + BAE_LP_ENDPOINT_CUSTOMER_BILL_PORT: 8632 + BAE_LP_ENDPOINT_CUSTOMER_BILL_PATH: /tmf-api/customerBillManagement/v4 + BAE_LP_ENDPOINT_USAGE_HOST: tmf + BAE_LP_ENDPOINT_USAGE_PORT: 8632 + BAE_LP_ENDPOINT_USAGE_PATH: /tmf-api/usageManagement/v4 + BAE_LP_ENDPOINT_CUSTOMER_HOST: tmf + BAE_LP_ENDPOINT_CUSTOMER_PORT: 8632 + BAE_LP_ENDPOINT_CUSTOMER_PATH: /tmf-api/customerManagement/v4 + BAE_LP_ENDPOINT_DOCUMENT_HOST: tmf + BAE_LP_ENDPOINT_DOCUMENT_PORT: 8632 + BAE_LP_ENDPOINT_DOCUMENT_PATH: /tmf-api/documentManagement/v4 + BAE_LP_ENDPOINT_CHARGING_HOST: charging.docker + BAE_LP_ENDPOINT_CHARGING_PORT: 8006 + BAE_LP_ENDPOINT_RSS_HOST: charging.docker + BAE_LP_ENDPOINT_RSS_PORT: 8006 + BAE_LP_BILLING_ENGINE_URL: http://charging.docker:8006/charging/api/orderManagement/orders/preview/ + + # Disabled until their services are deployed + BAE_LP_QUOTE_ENABLED: "false" + BAE_LP_TENDERING_ENABLED: "false" + BAE_LP_ANALYTICS_ENABLED: "false" + BAE_LP_SEARCH_URL: "" + depends_on: + - mongo + - tmf + - charging + +volumes: + mongo-data: + postgres-data: + idm-mysql-data: + charging-media: + charging-plugins: diff --git a/scripts/sync-stack-versions.py b/scripts/sync-stack-versions.py new file mode 100755 index 0000000..33d8dd5 --- /dev/null +++ b/scripts/sync-stack-versions.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python3 +"""Propagate the component versions of the first entry of stack.yaml to the README, the documentation, and the +reference deployment files. + +Usage: python3 scripts/sync-stack-versions.py [--check] + +With --check, nothing is written and the script exits with status 1 if any file is out of date. +Only the Python standard library is used, so the script runs on any GitHub runner. +""" + +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +REQUIRED_KEYS = ("id", "front", "proxy", "charging", "apis") + +START = "" +END = "" + + +def read_first_stack(path): + """Read the scalar keys of the first item of the `stacks` list of a simple YAML file.""" + data = {} + in_stacks = False + item_indent = None + for raw in path.read_text().splitlines(): + line = raw.split(" #", 1)[0].rstrip() + if not line.strip() or line.lstrip().startswith("#"): + continue + if not in_stacks: + in_stacks = re.match(r"^stacks:\s*$", line) is not None + continue + item = re.match(r"^(\s*)-\s*(.*)$", line) + if item: + if item_indent is not None and len(item.group(1)) <= item_indent: + break + item_indent = len(item.group(1)) + line = " " * (item_indent + 2) + item.group(2) + if not item.group(2): + continue + if item_indent is None: + continue + pair = re.match(r"^\s*([A-Za-z0-9_-]+)\s*:\s*(.*)$", line) + if pair: + data[pair.group(1)] = pair.group(2).strip().strip('"').strip("'") + missing = [key for key in REQUIRED_KEYS if not data.get(key)] + if missing: + sys.exit("Missing keys in the first stack entry: " + ", ".join(missing)) + return data + + +def blocks(v): + """Generated content of the marked blocks, per file.""" + return { + "README.md": f"""### Component versions + +The following versions are generated automatically from the first entry in [`stack.yaml`](stack.yaml) (`stacks[0]`, id `{v['id']}`): + +| Component | Stack key | Version | +|---|---|---| +| Web frontend | `front` | `{v['front']}` | +| Business Ecosystem Logic Proxy | `proxy` | `{v['proxy']}` | +| Business Ecosystem Charging Backend | `charging` | `{v['charging']}` | +| TMForum APIs | `apis` | `{v['apis']}` | +""", + "doc/index.md": f"""This documentation describes the release `{v['id']}` of the Business API Ecosystem: the Logic Proxy {v['proxy']} +(with the BAE Frontend {v['front']}), the Charging Backend {v['charging']}, and the TM Forum APIs {v['apis']}. +""", + "doc/installation-administration-guide.md": f"""(component-versions)= +## Component versions + +This guide and the reference deployment files use the versions of the release `{v['id']}`, generated from the +project's [stack definition](https://github.com/FIWARE-TMForum/Business-API-Ecosystem/blob/master/stack.yaml): + +| Component | Version | Image | +| --- | --- | --- | +| Logic Proxy | {v['proxy']} | `fiware/biz-ecosystem-logic-proxy:{v['proxy']}` | +| BAE Frontend | {v['front']} | Included in the Logic Proxy image | +| Charging Backend | {v['charging']} | `fiware/biz-ecosystem-charging-backend:{v['charging']}` | +| TM Forum APIs | {v['apis']} | `quay.io/fiware/tmforum-all-in-one:{v['apis']}` | +""", + } + + +def replacements(v): + """Version references inside examples and deployment files: (file glob, pattern, replacement).""" + images = [ + (r"(fiware/biz-ecosystem-logic-proxy:)(\$\{PROXY_VERSION:-)?[0-9][0-9A-Za-z.-]*", v["proxy"]), + (r"(fiware/biz-ecosystem-charging-backend:)(\$\{CHARGING_VERSION:-)?[0-9][0-9A-Za-z.-]*", v["charging"]), + (r"(quay\.io/fiware/tmforum-all-in-one:)(\$\{TMF_VERSION:-)?[0-9][0-9A-Za-z.-]*", v["apis"]), + ] + rules = [] + for glob in ("doc/*.md", "docker/compose/docker-compose.yml"): + for pattern, version in images: + rules.append((glob, pattern, lambda m, version=version: m.group(1) + (m.group(2) or "") + version)) + for key, name in (("proxy", "PROXY_VERSION"), ("charging", "CHARGING_VERSION"), ("apis", "TMF_VERSION")): + rules.append(("docker/compose/.env.example", rf"^({name}=).*$", lambda m, key=key: m.group(1) + v[key])) + rules.append(("doc/*.md", rf'(tag: )"[^"]*"(\s*# stack: {key})', + lambda m, key=key: m.group(1) + f'"{v[key]}"' + m.group(2))) + return rules + + +def replace_block(text, content, name): + pattern = re.compile(rf"^{re.escape(START)}$\n.*?^{re.escape(END)}$", re.M | re.S) + if not pattern.search(text): + sys.exit(f"Missing {START} / {END} markers in {name}") + return pattern.sub(lambda _: f"{START}\n{content}{END}", text, count=1) + + +def main(): + check = "--check" in sys.argv[1:] + versions = read_first_stack(ROOT / "stack.yaml") + + updated = {} + + def current(path): + return updated.get(path, path.read_text()) + + for name, content in blocks(versions).items(): + path = ROOT / name + updated[path] = replace_block(current(path), content, name) + + for glob, pattern, repl in replacements(versions): + for path in sorted(ROOT.glob(glob)): + updated[path] = re.sub(pattern, repl, current(path), flags=re.M) + + changed = [path for path, text in updated.items() if text != path.read_text()] + for path in changed: + print(("Out of date: " if check else "Updated: ") + str(path.relative_to(ROOT))) + if not check: + path.write_text(updated[path]) + if check and changed: + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/stack.yaml b/stack.yaml index 2264400..64fca11 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,7 +1,7 @@ stacks: - - id: 2026.10.20 - description: "New GUIs for provider forms and catalog pages" - front: 2.25.0 - proxy: 11.25.0 - charging: 11.9.1 - apis: 1.15.1 + - id: 2026.12.01 + description: "Plugin management, data space integration and TM Forum APIs 2.x" + front: 3.0.0 + proxy: 12.0.0 + charging: 12.0.0 + apis: 2.2.1