Register in Data Publisher

Data Publisher provides a REST API to perform the module registration.

A NuGet package and a Spring Starter, which use this API, are also provided to simplify the registration process for .NET and Java modules respectively.

Nuget package for .Net modules

Currently only available in BCI

To perform the registration in Data Publisher, .NET modules can use the "Nexeed.DataPublisher.ModuleRegistrationClient" NuGet package to simplify the process.

To use it:

  • Include the Nexeed.DataPublisher.ModuleRegistrationClient in your project

  • Make sure you are using Bosch.Foundation.OpenId.Authentication.Client with named clients in your configuration.

Example:

"OIDC": {
    // Your OIDC configuration
    // ...
    "NamedHttpClients": {
    "DefaultTokenEndpoint": "https://foundation-4.devspace.bosch-nexeed.com/iam/access-management/v1/tenants/7311ea8c-5d48-43fe-acf9-980eedf24b6c/openid-connect/token",
    "Clients": {
        "datapublisher": {
        "ClientID": "1quv47ifb39pb1a0ve7x4xqekk", // "$(<myModule>_CLIENT_ID)"
        "ClientSecret": "20400c09-4f2c-4603-b77b-0502653f479d", // "$(<myModule>_CLIENT__SECRET)"
        "BaseAddress": "https://foundation-4.devspace.boschnexeed.com/datapublisher/", // '{{ include "utility-toolkit.moduleUrl" (list ."datapublisher") }}'
        "AuthenticationServerURL": "https://foundation-4.devspace.bosch-nexeed.com/iam/access-management/v1/tenants/7311ea8c-5d48-43fe-acf9-980eedf24b6c",
        "HttpsRequired": true,
        "Scopes": [ "aud:z3mq9fy35n416v8wsbmi52zl" ] // "aud:$(DATAPUBLISHER_CLIENT_ID)"
        }
    }
    }
}
json
  • Add the client to your serviceCollection by calling the following:

// Authenticated Clients: Bosch.Foundation.OpenId
builder.Services.AddAuthenticatedHttpClients(builder.Configuration);
builder.Services.AddRegistrationClient(builder.Configuration.GetSection(nameof(RegistrationClientSettings)));
csharp
  • The client needs to be configured. Its settings can be passed as typed settings (RegistrationClientSettings), as Action, or as a ConfigurationSection.

Example:

"RegistrationClientSettings": {
    "Name": "RegistrationDemoModule", // myModule
    "ApplicationId": "1quv47ifb39pb1a0ve7x4xqekk", // "$(<myModule>_CLIENT_ID)"
    "RootTenantId": "7311ea8c-5d48-43fe-acf9-980eedf24b6c", // "{{.Values.global.nexeedMacmaTenant0Id }}"
    "HttpClientName": "datapublisher", // MUST match the one in NamedHttpClients section
    "ActivationConfig": {
        "Mode": 1,
        "Url": "https://host.com:9090/api/v1/7311ea8c-5d48-43fe-acf9-980eedf24b6c/domain-events/activation", // '{{ include "utility-toolkit.moduleUrl" (list . "<myModule>") }}/api/v1/7311ea8c-5d48-43fe-acf9-980eedf24b6c/domainevents/activation'
        "ExchangeName": null
    },
    "DataTypes": [
    {
        "Name": "test_1",
        "Version": "1.0.0",
        "ExchangeName": "x.nexeed.ias.myModule.{tenantId}.entity-1.v1",
        "VHostName" : "/"
        "Schema": null // JSON schema
        "NameLocalization": {
            "de-DE": "test 1 de",
            "en-US": "test 1 en"
        }
    }
    ]
}
json

Spring Starter for Java modules

Currently only available in BCI

To perform the registration in Data Publisher, Java modules can use the "dpspringclient" Spring Starter to simplify the process.

To use it:

  • Add "dpspringclient" Spring Starter dependency to your project

  • Register your module with the relevant data - tenant id, module id (Multitenant Access Control public client id) and the module name with the list of data types - after startup by calling the following method:

dpSpringClient.registerModule( dpSpringClientProperties.getZeroTenantId(), moduleId, dpSpringClientModuleDto );
java