From 407389e7914cb5aad6b19bd1bd2ecba0273d2b8e Mon Sep 17 00:00:00 2001 From: Vojtech Knaisl Date: Thu, 4 Jun 2026 08:25:52 +0200 Subject: [PATCH 1/2] Fix openid on boostrap endpoint --- .../Api/Resource/Config/ClientConfigDTO.hs | 12 ++---------- .../Api/Resource/Config/ClientConfigJM.hs | 7 +------ .../Api/Resource/Config/ClientConfigSM.hs | 10 ++++------ .../Config/Client/ClientConfigMapper.hs | 19 +++++-------------- .../Config/Client/ClientConfigService.hs | 2 +- 5 files changed, 13 insertions(+), 37 deletions(-) diff --git a/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigDTO.hs b/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigDTO.hs index d4e8166ed..7428b751d 100644 --- a/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigDTO.hs +++ b/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigDTO.hs @@ -6,10 +6,10 @@ import qualified Data.UUID as U import GHC.Generics import Shared.Common.Model.Config.SimpleFeature -import Shared.OpenId.Model.OpenId.OpenIdClientStyle import Wizard.Model.Plugin.PluginList import Wizard.Model.Tenant.Config.TenantConfig import Wizard.Model.User.UserProfile +import WizardLib.Public.Model.OpenId.OpenIdClientSimple import WizardLib.Public.Model.Tenant.Config.TenantConfig data ClientConfigDTO @@ -46,15 +46,7 @@ data ClientConfigAuthDTO = ClientConfigAuthDTO deriving (Generic, Eq, Show) data ClientConfigAuthExternalDTO = ClientConfigAuthExternalDTO - { services :: [ClientConfigAuthExternalServiceDTO] - } - deriving (Generic, Eq, Show) - -data ClientConfigAuthExternalServiceDTO = ClientConfigAuthExternalServiceDTO - { uuid :: U.UUID - , name :: String - , url :: String - , style :: OpenIdClientStyle + { services :: [OpenIdClientSimple] } deriving (Generic, Eq, Show) diff --git a/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigJM.hs b/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigJM.hs index 969eecffd..fdb19fb33 100644 --- a/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigJM.hs +++ b/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigJM.hs @@ -9,6 +9,7 @@ import Wizard.Api.Resource.Config.ClientConfigDTO import Wizard.Api.Resource.Plugin.PluginListJM () import Wizard.Api.Resource.Tenant.Config.TenantConfigJM () import Wizard.Api.Resource.User.UserProfileJM () +import WizardLib.Public.Api.Resource.OpenId.Client.Definition.OpenIdClientSimpleJM () instance FromJSON ClientConfigDTO where parseJSON = genericParseJSON (jsonOptionsWithTypeField "type") @@ -28,12 +29,6 @@ instance FromJSON ClientConfigAuthExternalDTO where instance ToJSON ClientConfigAuthExternalDTO where toJSON = genericToJSON jsonOptions -instance FromJSON ClientConfigAuthExternalServiceDTO where - parseJSON = genericParseJSON jsonOptions - -instance ToJSON ClientConfigAuthExternalServiceDTO where - toJSON = genericToJSON jsonOptions - instance FromJSON ClientConfigRegistryDTO where parseJSON = genericParseJSON jsonOptions diff --git a/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigSM.hs b/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigSM.hs index c59b6a56a..6906d7411 100644 --- a/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigSM.hs +++ b/wizard-server/src/Wizard/Api/Resource/Config/ClientConfigSM.hs @@ -20,20 +20,18 @@ import Wizard.Model.Config.ServerConfig import qualified Wizard.Model.Config.ServerConfigDM as S import Wizard.Service.Config.Client.ClientConfigMapper import Wizard.Service.User.UserMapper +import WizardLib.Public.Api.Resource.OpenId.Client.Definition.OpenIdClientSimpleSM () import WizardLib.Public.Database.Migration.Development.OpenId.Data.OpenIdClients import qualified WizardLib.Public.Database.Migration.Development.Tenant.Data.TenantConfigs as STC instance ToSchema ClientConfigDTO where - declareNamedSchema = toSwaggerWithType "type" (toClientConfigDTO S.defaultConfig TC.defaultOrganization TC.defaultAuthentication [defaultOpenIdClient] TC.defaultPrivacyAndSupport TC.defaultDashboardAndLoginScreen STC.defaultLookAndFeel TC.defaultRegistry TC.defaultProject TC.defaultSubmission STC.defaultFeatures TC.defaultOwl (Just $ toUserProfile (toDTO userAlbert) [] M.empty) [] [plugin1List] M.empty defaultTenant) + declareNamedSchema = toSwaggerWithType "type" (toClientConfigDTO S.defaultConfig TC.defaultOrganization TC.defaultAuthentication [defaultOpenIdClientSimple] TC.defaultPrivacyAndSupport TC.defaultDashboardAndLoginScreen STC.defaultLookAndFeel TC.defaultRegistry TC.defaultProject TC.defaultSubmission STC.defaultFeatures TC.defaultOwl (Just $ toUserProfile (toDTO userAlbert) [] M.empty) [] [plugin1List] M.empty defaultTenant) instance ToSchema ClientConfigAuthDTO where - declareNamedSchema = toSwagger (toClientAuthDTO TC.defaultAuthentication [defaultOpenIdClient]) + declareNamedSchema = toSwagger (toClientAuthDTO TC.defaultAuthentication [defaultOpenIdClientSimple]) instance ToSchema ClientConfigAuthExternalDTO where - declareNamedSchema = toSwagger (toClientAuthExternalDTO [defaultOpenIdClient]) - -instance ToSchema ClientConfigAuthExternalServiceDTO where - declareNamedSchema = toSwagger (toClientAuthExternalServiceDTO defaultOpenIdClient) + declareNamedSchema = toSwagger (toClientAuthExternalDTO [defaultOpenIdClientSimple]) instance ToSchema ClientConfigRegistryDTO where declareNamedSchema = toSwagger (toClientConfigRegistryDTO S.defaultRegistry TC.defaultRegistry) diff --git a/wizard-server/src/Wizard/Service/Config/Client/ClientConfigMapper.hs b/wizard-server/src/Wizard/Service/Config/Client/ClientConfigMapper.hs index 75206e5b0..ba052d562 100644 --- a/wizard-server/src/Wizard/Service/Config/Client/ClientConfigMapper.hs +++ b/wizard-server/src/Wizard/Service/Config/Client/ClientConfigMapper.hs @@ -13,10 +13,10 @@ import Wizard.Model.Plugin.PluginList import Wizard.Model.Tenant.Config.TenantConfig import Wizard.Model.Tenant.Tenant import Wizard.Model.User.UserProfile -import WizardLib.Public.Model.OpenId.OpenIdClient +import WizardLib.Public.Model.OpenId.OpenIdClientSimple import WizardLib.Public.Model.Tenant.Config.TenantConfig -toClientConfigDTO :: ServerConfig -> TenantConfigOrganization -> TenantConfigAuthentication -> [OpenIdClient] -> TenantConfigPrivacyAndSupport -> TenantConfigDashboardAndLoginScreen -> TenantConfigLookAndFeel -> TenantConfigRegistry -> TenantConfigProject -> TenantConfigSubmission -> TenantConfigFeatures -> TenantConfigOwl -> Maybe UserProfile -> [String] -> [PluginList] -> M.Map U.UUID A.Value -> Tenant -> ClientConfigDTO +toClientConfigDTO :: ServerConfig -> TenantConfigOrganization -> TenantConfigAuthentication -> [OpenIdClientSimple] -> TenantConfigPrivacyAndSupport -> TenantConfigDashboardAndLoginScreen -> TenantConfigLookAndFeel -> TenantConfigRegistry -> TenantConfigProject -> TenantConfigSubmission -> TenantConfigFeatures -> TenantConfigOwl -> Maybe UserProfile -> [String] -> [PluginList] -> M.Map U.UUID A.Value -> Tenant -> ClientConfigDTO toClientConfigDTO serverConfig tcOrganization tcAuthentication openIdClients tcPrivacyAndSupport tcDashboardAndLoginScreen tcLookAndFeel tcRegistry tcProject tcSubmission tcFeatures tcOwl mUserProfile tours plugins pluginSettings tenant = ClientConfigDTO { user = mUserProfile @@ -64,7 +64,7 @@ toClientConfigDTO serverConfig tcOrganization tcAuthentication openIdClients tcP else [] } -toClientAuthDTO :: TenantConfigAuthentication -> [OpenIdClient] -> ClientConfigAuthDTO +toClientAuthDTO :: TenantConfigAuthentication -> [OpenIdClientSimple] -> ClientConfigAuthDTO toClientAuthDTO tcAuthentication openIdClients = ClientConfigAuthDTO { defaultRole = tcAuthentication.defaultRole @@ -72,19 +72,10 @@ toClientAuthDTO tcAuthentication openIdClients = , external = toClientAuthExternalDTO openIdClients } -toClientAuthExternalDTO :: [OpenIdClient] -> ClientConfigAuthExternalDTO +toClientAuthExternalDTO :: [OpenIdClientSimple] -> ClientConfigAuthExternalDTO toClientAuthExternalDTO openIdClients = ClientConfigAuthExternalDTO - { services = fmap toClientAuthExternalServiceDTO openIdClients - } - -toClientAuthExternalServiceDTO :: OpenIdClient -> ClientConfigAuthExternalServiceDTO -toClientAuthExternalServiceDTO openIdClient = - ClientConfigAuthExternalServiceDTO - { uuid = openIdClient.uuid - , name = openIdClient.name - , url = openIdClient.url - , style = openIdClient.style + { services = openIdClients } toClientConfigRegistryDTO :: ServerConfigRegistry -> TenantConfigRegistry -> ClientConfigRegistryDTO diff --git a/wizard-server/src/Wizard/Service/Config/Client/ClientConfigService.hs b/wizard-server/src/Wizard/Service/Config/Client/ClientConfigService.hs index e98fb40c4..b14ebd75e 100644 --- a/wizard-server/src/Wizard/Service/Config/Client/ClientConfigService.hs +++ b/wizard-server/src/Wizard/Service/Config/Client/ClientConfigService.hs @@ -90,7 +90,7 @@ getClientConfig mServerUrl mClientUrl = do Nothing -> return Nothing plugins <- findPlugins tenant.uuid pluginSettings <- findTenantPluginSettingValues tenant.uuid - openIdClients <- findOpenIdClientDefinitions + openIdClients <- findOpenIdClientDefinitionsSimpleByTenantUuid tenant.uuid tours <- case mCurrentUser of Just currentUser -> findUserToursByUserUuid currentUser.uuid From f36ee28f4ee77fc9917f4208b1a491bcf31a8519 Mon Sep 17 00:00:00 2001 From: Vojtech Knaisl Date: Thu, 4 Jun 2026 08:27:04 +0200 Subject: [PATCH 2/2] Release 4.31.1 --- registry-public/package.yaml | 2 +- registry-server/package.yaml | 2 +- registry-server/src/Registry/Api/Handler/Swagger/Api.hs | 2 +- shared-common/package.yaml | 2 +- wizard-public/package.yaml | 2 +- wizard-server/package.yaml | 2 +- wizard-server/src/Wizard/Api/Handler/Swagger/Api.hs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/registry-public/package.yaml b/registry-public/package.yaml index d972ca15d..606e7d78c 100644 --- a/registry-public/package.yaml +++ b/registry-public/package.yaml @@ -1,5 +1,5 @@ name: registry-public -version: '4.31.0' +version: '4.31.1' synopsis: Registry Public description: Registry Public category: Web diff --git a/registry-server/package.yaml b/registry-server/package.yaml index 82f094c75..e770914ca 100644 --- a/registry-server/package.yaml +++ b/registry-server/package.yaml @@ -1,5 +1,5 @@ name: registry-server -version: '4.31.0' +version: '4.31.1' synopsis: Engine Registry description: Engine Registry category: Web diff --git a/registry-server/src/Registry/Api/Handler/Swagger/Api.hs b/registry-server/src/Registry/Api/Handler/Swagger/Api.hs index 265cc4f26..c934e133f 100644 --- a/registry-server/src/Registry/Api/Handler/Swagger/Api.hs +++ b/registry-server/src/Registry/Api/Handler/Swagger/Api.hs @@ -41,7 +41,7 @@ swagger = s._swaggerInfo { _infoTitle = "Registry API" , _infoDescription = Just "API specification for Registry" - , _infoVersion = "4.31.0" + , _infoVersion = "4.31.1" , _infoLicense = Just $ License diff --git a/shared-common/package.yaml b/shared-common/package.yaml index 764427bbc..779f033bb 100644 --- a/shared-common/package.yaml +++ b/shared-common/package.yaml @@ -1,5 +1,5 @@ name: shared-common -version: '4.31.0' +version: '4.31.1' synopsis: Engine Shared description: Engine Shared category: Web diff --git a/wizard-public/package.yaml b/wizard-public/package.yaml index 07a2ca5a5..5294a1e54 100644 --- a/wizard-public/package.yaml +++ b/wizard-public/package.yaml @@ -1,5 +1,5 @@ name: wizard-public -version: '4.31.0' +version: '4.31.1' synopsis: Wizard Public description: Wizard Public category: Web diff --git a/wizard-server/package.yaml b/wizard-server/package.yaml index 90006e243..f44b6873a 100644 --- a/wizard-server/package.yaml +++ b/wizard-server/package.yaml @@ -1,5 +1,5 @@ name: wizard-server -version: '4.31.0' +version: '4.31.1' synopsis: Engine Wizard description: Engine Wizard category: Web diff --git a/wizard-server/src/Wizard/Api/Handler/Swagger/Api.hs b/wizard-server/src/Wizard/Api/Handler/Swagger/Api.hs index 3d9f32114..59bb01ad3 100644 --- a/wizard-server/src/Wizard/Api/Handler/Swagger/Api.hs +++ b/wizard-server/src/Wizard/Api/Handler/Swagger/Api.hs @@ -153,7 +153,7 @@ swagger = s._swaggerInfo { _infoTitle = "Wizard API" , _infoDescription = Just "API specification for Wizard" - , _infoVersion = "4.31.0" + , _infoVersion = "4.31.1" , _infoLicense = Just $ License