Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion registry-public/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: registry-public
version: '4.31.0'
version: '4.31.1'
synopsis: Registry Public
description: Registry Public
category: Web
Expand Down
2 changes: 1 addition & 1 deletion registry-server/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: registry-server
version: '4.31.0'
version: '4.31.1'
synopsis: Engine Registry
description: Engine Registry
category: Web
Expand Down
2 changes: 1 addition & 1 deletion registry-server/src/Registry/Api/Handler/Swagger/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shared-common/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: shared-common
version: '4.31.0'
version: '4.31.1'
synopsis: Engine Shared
description: Engine Shared
category: Web
Expand Down
2 changes: 1 addition & 1 deletion wizard-public/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wizard-public
version: '4.31.0'
version: '4.31.1'
synopsis: Wizard Public
description: Wizard Public
category: Web
Expand Down
2 changes: 1 addition & 1 deletion wizard-server/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wizard-server
version: '4.31.0'
version: '4.31.1'
synopsis: Engine Wizard
description: Engine Wizard
category: Web
Expand Down
2 changes: 1 addition & 1 deletion wizard-server/src/Wizard/Api/Handler/Swagger/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions wizard-server/src/Wizard/Api/Resource/Config/ClientConfigDTO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

Expand Down
10 changes: 4 additions & 6 deletions wizard-server/src/Wizard/Api/Resource/Config/ClientConfigSM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,27 +64,18 @@ toClientConfigDTO serverConfig tcOrganization tcAuthentication openIdClients tcP
else []
}

toClientAuthDTO :: TenantConfigAuthentication -> [OpenIdClient] -> ClientConfigAuthDTO
toClientAuthDTO :: TenantConfigAuthentication -> [OpenIdClientSimple] -> ClientConfigAuthDTO
toClientAuthDTO tcAuthentication openIdClients =
ClientConfigAuthDTO
{ defaultRole = tcAuthentication.defaultRole
, internal = tcAuthentication.internal
, 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading