Fluent Commerce Logo
Docs
Sign In

commercetools connector - Credential/Secret Configuration

Essential knowledge

Author:

Fluent Commerce

Changed on:

31 Jan 2024

Overview

At this stage the only implementation available is AWS Secrets Manager by the `connect-sdk-core-aws` module.

Key points

  • Secret Configuration Template
  • Available Fluent Accounts
  • Fluent Retailer Credentials (Multiple allowed)
  • commercetools Credentials

Secret Configuration Template

The template below should be used to create secrets in localstack (an AWS emulator for development) before you can start the application. Without these secrets the application will not function properly. It is possible to use this with as many retailers as you wish but do not use multiple accounts - this is not yet supported.

1docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/<FC-CONNECTOR>/api/fluent/activeAccounts --secret-string "{\"accounts\":[{\"name\":\"<FLUENT-ACCOUNT>\", \"retailers\":[<FLUENT-RETAILER>,<FLUENT-RETAILER>]}]}" ;
2
3docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/<FC-CONNECTOR>/<FLUENT-ACCOUNT>/api/fluent-account/1 --secret-string "{\"retailer\":\"<FLUENT-RETAILER>\", \"userName\":\"<FLUENT-RETAILER-USERNAME>\", \"password\":\"<FLUENT-RETAILER-PASSWORD>\"}";
4

The SDK expects ALL secrets to be prefixed with `fc/connect/<FC-CONNECTOR>/`. The property FC-CONNECTOR value needs to match the configuration name found at `application-connector.yml` (example below).

1connector-name: commercetools
2

Available Fluent Accounts

When configuring an , it is required to specify the region where this has been provisioned. This is to allow the signature validation. Possible values are:

  • sydney
  • dublin
  • singapore
  • north_america
1docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/commercetools/api/fluent/activeAccounts --secret-string "{\"accounts\":[{\"name\":\"CNCTDEV\", \"region\":\"sydney\",\"retailers\":[1,34]}]}" ;
1{
2  "accounts": [
3    {
4      "name": "CNCTDEV",
5      "region":"sydney",
6      "retailers": [
7        1,
8        34,
9        67,
10        100
11      ]
12    }
13  ]
14}

Fluent Retailer Credentials (Multiple allowed)

These credentials allows the application to connect to Fluent with the Fluent credentials specified for each retailer. Note that if a retailer is not configured and a message is received for that missing retailer, then the application will not be capable of processing the request.

1docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/commercetools/CNCTDEV/api/fluent-account/1 --secret-string "{\"retailer\":\"1\", \"userName\":\"<THE_USERNAME>\", \"password\":\"<THE_PASSWORD>\"}";
2docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/commercetools/CNCTDEV/api/fluent-account/34 --secret-string "{\"retailer\":\"34\", \"userName\":\"<THE_USERNAME>\", \"password\":\"<THE_PASSWORD>\"}";
1 {
2    "retailer": "1",
3    "userName": "<FLUENT-RETAILER-USERNAME>",
4    "password": "<FLUENT-RETAILER-PASSWORD>"
5 }

commercetools Credentials

These credentials allow the application to communicate with commercetools.

1docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/commercetools/CNCTDEV/api/ct/fluent-ct-dev --secret-string "{\"clientId\" : \"<PROJECT_KEY>\", \"secret\" : \"<THE_SCRECT>\", \"website\" : \"api.australia-southeast1.gcp.commercetools.com\"}"


Fluent Commerce

Fluent Commerce