diff --git a/Documentation/OMC - Documentation.md b/Documentation/OMC - Documentation.md
index a25f97cd..cf7fec1a 100644
--- a/Documentation/OMC - Documentation.md
+++ b/Documentation/OMC - Documentation.md
@@ -1,6 +1,6 @@
# OMC Documentation
-v.1.6.6
+v.1.6.6.1
© 2024, Worth Systems.
@@ -36,7 +36,7 @@ OMC (Output Management Component) is a central point and the common hub of the c
| OMC_AUTHORIZATION_JWT_USERID | string | false | Cannot be missing and have null or empty value | The OMC JWT tokens are generated by OMC and authorized by Open services. New JWT token has to be generated manually, using OMC dedicated library, if the token validity expire (by default it is 60 minutes) |
| OMC_AUTHORIZATION_JWT_USERNAME | string | false | Cannot be missing and have null or empty value | The OMC JWT tokens are generated by OMC and authorized by Open services. New JWT token has to be generated manually, using OMC dedicated library, if the token validity expire (by default it is 60 minutes) |
| --- | --- | --- | --- | --- |
-| OMC_API_BASEURL | string | false | Cannot be missing and have null or empty value | The domain where your Notify API instance is listening (e.g.: "https://api.notifynl.nl") |
+| OMC_API_BASEURL_NOTIFYNL | string | false | Cannot be missing and have null or empty value | The domain where your Notify API instance is listening (e.g.: "https://api.notifynl.nl") |
| --- | --- | --- | --- | --- |
| USER_AUTHORIZATION_JWT_SECRET | string | true | Cannot be missing and have null or empty value | Internal implementation of Open services is regulating this. Better to use something longer as well. |
| USER_AUTHORIZATION_JWT_ISSUER | string | true | Cannot be missing and have null or empty value | Something identifying OpenZaak / OpenKlant / OpenNotificatie services (token is shared between of them) |
diff --git a/EventsHandler/Api/EventsHandler/Configuration/WebApiConfiguration.cs b/EventsHandler/Api/EventsHandler/Configuration/WebApiConfiguration.cs
index 87a80b8a..1d6d1870 100644
--- a/EventsHandler/Api/EventsHandler/Configuration/WebApiConfiguration.cs
+++ b/EventsHandler/Api/EventsHandler/Configuration/WebApiConfiguration.cs
@@ -133,21 +133,40 @@ public OmcComponent(ILoadersContext loadersContext, string parentName)
///
internal sealed record ApiComponent
{
- private readonly ILoadersContext _loadersContext;
- private readonly string _currentPath;
+ ///
+ internal BaseUrlComponent BaseUrl { get; }
///
/// Initializes a new instance of the class.
///
internal ApiComponent(ILoadersContext loadersContext, string parentPath)
{
- this._loadersContext = loadersContext;
- this._currentPath = loadersContext.GetPathWithNode(parentPath, nameof(API));
+ string currentPath = loadersContext.GetPathWithNode(parentPath, nameof(API));
+
+ this.BaseUrl = new BaseUrlComponent(loadersContext, currentPath);
}
+
+ ///
+ /// The "Base URL" part of the configuration.
+ ///
+ internal sealed record BaseUrlComponent
+ {
+ private readonly ILoadersContext _loadersContext;
+ private readonly string _currentPath;
- ///
- internal string BaseUrl()
- => GetValue(this._loadersContext, this._currentPath, nameof(BaseUrl));
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public BaseUrlComponent(ILoadersContext loadersContext, string parentPath)
+ {
+ this._loadersContext = loadersContext;
+ this._currentPath = loadersContext.GetPathWithNode(parentPath, nameof(BaseUrl));
+ }
+
+ ///
+ internal string NotifyNL()
+ => GetValue(this._loadersContext, this._currentPath, nameof(NotifyNL));
+ }
}
}
diff --git a/EventsHandler/Api/EventsHandler/Constants/DefaultValues.cs b/EventsHandler/Api/EventsHandler/Constants/DefaultValues.cs
index e141e200..bdb454c8 100644
--- a/EventsHandler/Api/EventsHandler/Constants/DefaultValues.cs
+++ b/EventsHandler/Api/EventsHandler/Constants/DefaultValues.cs
@@ -12,7 +12,7 @@ internal static class ApiController
{
internal const string Route = "[controller]";
- internal const string Version = "1.66";
+ internal const string Version = "1.661";
}
#endregion
diff --git a/EventsHandler/Api/EventsHandler/Controllers/TestController.cs b/EventsHandler/Api/EventsHandler/Controllers/TestController.cs
index e5049009..69c6c815 100644
--- a/EventsHandler/Api/EventsHandler/Controllers/TestController.cs
+++ b/EventsHandler/Api/EventsHandler/Controllers/TestController.cs
@@ -82,7 +82,7 @@ public async Task HealthCheckAsync()
try
{
// Health Check URL
- string healthCheckUrl = $"{this._configuration.OMC.API.BaseUrl()}/_status?simple=true";
+ string healthCheckUrl = $"{this._configuration.OMC.API.BaseUrl.NotifyNL()}/_status?simple=true";
// Request
using var httpClient = new HttpClient();
@@ -247,7 +247,7 @@ private async Task SendAsync(
{
// Initialize the .NET client of "NotifyNL" API service
var notifyClient = new NotificationClient( // TODO: Client to be resolved by IClientFactory (to be testable)
- this._configuration.OMC.API.BaseUrl(),
+ this._configuration.OMC.API.BaseUrl.NotifyNL(),
this._configuration.User.API.Key.NotifyNL());
// Determine template type
diff --git a/EventsHandler/Api/EventsHandler/Services/DataReceiving/Factories/NotificationClientFactory.cs b/EventsHandler/Api/EventsHandler/Services/DataReceiving/Factories/NotificationClientFactory.cs
index 841bcc56..cfd93b1d 100644
--- a/EventsHandler/Api/EventsHandler/Services/DataReceiving/Factories/NotificationClientFactory.cs
+++ b/EventsHandler/Api/EventsHandler/Services/DataReceiving/Factories/NotificationClientFactory.cs
@@ -31,8 +31,8 @@ INotifyClient IHttpClientFactory.GetHttpClient(string org
return new NotifyClientDecorator(
new NotificationClient(
- baseUrl: this._configuration.OMC.API.BaseUrl(), // The base URL to "Notify NL" API Service
- apiKey: this._configuration.User.API.Key.NotifyNL())); // 3rd party-specific "Notify NL" API Key
+ baseUrl: this._configuration.OMC.API.BaseUrl.NotifyNL(), // The base URL to "Notify NL" API Service
+ apiKey: this._configuration.User.API.Key.NotifyNL())); // 3rd party-specific "Notify NL" API Key
}
}
}
\ No newline at end of file
diff --git a/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Configuration/WepApiConfigurationTests.cs b/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Configuration/WepApiConfigurationTests.cs
index ecabc455..12fd6b4b 100644
--- a/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Configuration/WepApiConfigurationTests.cs
+++ b/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Configuration/WepApiConfigurationTests.cs
@@ -31,7 +31,7 @@ public void WebApiConfiguration_InEnvironmentMode_ForAllValidVariables_ReadsProp
Assert.That(notifyJwt.UserName(), Is.Not.Null.Or.Empty);
// API | BaseUrl
- Assert.That(configuration.OMC.API.BaseUrl(), Is.Not.Null.Or.Empty);
+ Assert.That(configuration.OMC.API.BaseUrl.NotifyNL(), Is.Not.Null.Or.Empty);
// Authorization | JWT | User
var userJwt = configuration.User.Authorization.JWT;
diff --git a/EventsHandler/Tests/Utilities/EventsHandler.Utilities/_TestHelpers/ConfigurationHandler.cs b/EventsHandler/Tests/Utilities/EventsHandler.Utilities/_TestHelpers/ConfigurationHandler.cs
index b6c5130b..a44a311f 100644
--- a/EventsHandler/Tests/Utilities/EventsHandler.Utilities/_TestHelpers/ConfigurationHandler.cs
+++ b/EventsHandler/Tests/Utilities/EventsHandler.Utilities/_TestHelpers/ConfigurationHandler.cs
@@ -54,7 +54,7 @@ internal static ILoadingService GetEnvironmentLoader(bool isValid = true)
{ "OMC_AUTHORIZATION_JWT_USERID", isValid ? testValue : string.Empty },
{ "OMC_AUTHORIZATION_JWT_USERNAME", isValid ? testValue : string.Empty },
- { "OMC_API_BASEURL", isValid ? "https://www.test.nl/" : string.Empty },
+ { "OMC_API_BASEURL_NOTIFYNL", isValid ? "https://www.test.nl/" : string.Empty },
{ "USER_AUTHORIZATION_JWT_SECRET", isValid ? testValue : string.Empty },
{ "USER_AUTHORIZATION_JWT_ISSUER", isValid ? testValue : string.Empty },
@@ -109,8 +109,9 @@ internal static ILoadingService GetEnvironmentLoader(bool isValid = true)
("OMC_AUTHORIZATION_JWT", "UserId", "OMC_AUTHORIZATION_JWT_USERID"),
("OMC_AUTHORIZATION_JWT", "UserName", "OMC_AUTHORIZATION_JWT_USERNAME"),
- ("OMC", "API", "OMC_API"),
- ("OMC_API", "BaseUrl", "OMC_API_BASEURL"),
+ ("OMC", "API", "OMC_API"),
+ ("OMC_API", "BaseUrl", "OMC_API_BASEURL"),
+ ("OMC_API_BASEURL", "NotifyNL", "OMC_API_BASEURL_NOTIFYNL"),
("USER_AUTHORIZATION", "JWT", "USER_AUTHORIZATION_JWT"),
("USER_AUTHORIZATION_JWT", "Secret", "USER_AUTHORIZATION_JWT_SECRET"),