| Copyright | (c) digitally induced GmbH 2020 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.FrameworkConfig.Types
Description
This module contains the core types for IHP's framework configuration. It's designed to be lightweight and avoid Template Haskell dependencies, allowing modules that only need the types to compile faster.
For the full configuration API including defaults, use FrameworkConfig.
Synopsis
- newtype AppHostname = AppHostname Text
- newtype AppPort = AppPort Int
- newtype BaseUrl = BaseUrl Text
- newtype RequestLoggerMiddleware = RequestLoggerMiddleware Middleware
- newtype SessionCookie = SessionCookie SetCookie
- newtype DatabaseUrl = DatabaseUrl ByteString
- type ConfigBuilder = StateT TMap IO ()
- newtype ExceptionTracker = ExceptionTracker {
- onException :: Maybe Request -> SomeException -> IO ()
- newtype IdeBaseUrl = IdeBaseUrl Text
- newtype RLSAuthenticatedRole = RLSAuthenticatedRole Text
- newtype AssetVersion = AssetVersion Text
- newtype CustomMiddleware = CustomMiddleware Middleware
- newtype DataSyncMaxSubscriptionsPerConnection = DataSyncMaxSubscriptionsPerConnection Int
- newtype DataSyncMaxTransactionsPerConnection = DataSyncMaxTransactionsPerConnection Int
- newtype Initializer = Initializer {
- onStartup :: (?context :: FrameworkConfig, ?modelContext :: ModelContext) => IO ()
- data FrameworkConfig = FrameworkConfig {
- appHostname :: !Text
- environment :: !Environment
- appPort :: !Int
- baseUrl :: !Text
- requestLoggerMiddleware :: !Middleware
- sessionCookie :: !SetCookie
- databaseUrl :: !ByteString
- cssFramework :: !CSSFramework
- logger :: !Logger
- exceptionTracker :: !ExceptionTracker
- appConfig :: !TMap
- corsResourcePolicy :: !(Maybe CorsResourcePolicy)
- parseRequestBodyOptions :: !ParseRequestBodyOptions
- ideBaseUrl :: Text
- rlsAuthenticatedRole :: !Text
- customMiddleware :: !CustomMiddleware
- initializers :: ![Initializer]
- type ConfigProvider context = HasField "frameworkConfig" context FrameworkConfig
Documentation
newtype AppHostname Source #
Constructors
| AppHostname Text |
Instances
| EnvVarReader AppPort Source # | |
Defined in IHP.FrameworkConfig Methods envStringToValue :: ByteString -> Either Text AppPort Source # | |
newtype RequestLoggerMiddleware Source #
Provides IHP with a middleware to log requests and responses.
By default this uses the RequestLogger middleware from wai-extra. Take a look at the wai-extra documentation when you want to customize the request logging.
Set requestLoggerMiddleware = application -> application to disable request logging.
Constructors
| RequestLoggerMiddleware Middleware |
newtype SessionCookie Source #
Provides the default settings for the session cookie.
- Max Age: 30 days
- Same Site Policy: Lax
- HttpOnly (no access through JS)
- secure, when baseUrl is a https url
Override this to set e.g. a custom max age or change the default same site policy.
Example: Set max age to 90 days > sessionCookie = defaultIHPSessionCookie { Cookie.setCookieMaxAge = Just (fromIntegral (60 * 60 * 24 * 90)) }
Constructors
| SessionCookie SetCookie |
newtype DatabaseUrl Source #
Constructors
| DatabaseUrl ByteString |
type ConfigBuilder = StateT TMap IO () Source #
newtype ExceptionTracker Source #
Interface for exception tracking services such as sentry
Constructors
| ExceptionTracker | |
Fields
| |
newtype IdeBaseUrl Source #
Typically "http://localhost:8001", Url where the IDE is running
Constructors
| IdeBaseUrl Text |
newtype RLSAuthenticatedRole Source #
Postgres role to be used for making queries with Row level security enabled
Constructors
| RLSAuthenticatedRole Text |
newtype AssetVersion Source #
Constructors
| AssetVersion Text |
newtype CustomMiddleware Source #
Constructors
| CustomMiddleware Middleware |
newtype DataSyncMaxSubscriptionsPerConnection Source #
Constructors
| DataSyncMaxSubscriptionsPerConnection Int |
newtype DataSyncMaxTransactionsPerConnection Source #
Constructors
| DataSyncMaxTransactionsPerConnection Int |
newtype Initializer Source #
Constructors
| Initializer | |
Fields
| |
data FrameworkConfig Source #
Constructors
| FrameworkConfig | |
Fields
| |
Instances
| HasField "frameworkConfig" FrameworkConfig FrameworkConfig Source # | |
Defined in IHP.FrameworkConfig.Types Methods | |
| HasField "frameworkConfig" ControllerContext FrameworkConfig Source # | Access frameworkConfig via the request vault |
Defined in IHP.Controller.Context Methods | |
| HasField "frameworkConfig" Request FrameworkConfig Source # | |
Defined in IHP.RequestVault Methods getField :: Request -> FrameworkConfig # | |
type ConfigProvider context = HasField "frameworkConfig" context FrameworkConfig Source #