Add additional validation for enterprise configuration inputs

This commit is contained in:
Thorsten Sommer 2025-06-02 20:20:48 +02:00
parent 650a27fed1
commit 68b202fbc0
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -54,6 +54,7 @@ public sealed class EnterpriseEnvironmentService(ILogger<EnterpriseEnvironmentSe
switch (enterpriseConfigServerUrl) switch (enterpriseConfigServerUrl)
{ {
case null when enterpriseConfigId == Guid.Empty: case null when enterpriseConfigId == Guid.Empty:
case not null when string.IsNullOrWhiteSpace(enterpriseConfigServerUrl) && enterpriseConfigId == Guid.Empty:
logger.LogInformation("AI Studio runs without an enterprise configuration."); logger.LogInformation("AI Studio runs without an enterprise configuration.");
break; break;
@ -61,7 +62,7 @@ public sealed class EnterpriseEnvironmentService(ILogger<EnterpriseEnvironmentSe
logger.LogWarning($"AI Studio runs with an enterprise configuration id ('{enterpriseConfigId}'), but the configuration server URL is not set."); logger.LogWarning($"AI Studio runs with an enterprise configuration id ('{enterpriseConfigId}'), but the configuration server URL is not set.");
break; break;
case not null when enterpriseConfigId == Guid.Empty: case not null when !string.IsNullOrWhiteSpace(enterpriseConfigServerUrl) && enterpriseConfigId == Guid.Empty:
logger.LogWarning($"AI Studio runs with an enterprise configuration server URL ('{enterpriseConfigServerUrl}'), but the configuration ID is not set."); logger.LogWarning($"AI Studio runs with an enterprise configuration server URL ('{enterpriseConfigServerUrl}'), but the configuration ID is not set.");
break; break;