Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hasura.Server.Init.Config
Description
Types and classes related to configuration when the server is initialised
Synopsis
- data Option def = Option {
- _default :: def
- _envVar :: String
- _helpMessage :: String
- optionPP :: Option a -> (String, String)
- data HGEOptionsRaw impl = HGEOptionsRaw {}
- horDatabaseUrl :: Lens' (HGEOptionsRaw impl) (PostgresConnInfo (Maybe PostgresConnInfoRaw))
- horMetadataDbUrl :: Lens' (HGEOptionsRaw impl) (Maybe String)
- horCommand :: Lens' (HGEOptionsRaw impl) (HGECommand impl)
- data HGEOptions impl = HGEOptions {}
- hoCommand :: Lens' (HGEOptions impl) (HGECommand impl)
- data PostgresConnInfo a = PostgresConnInfo {
- _pciDatabaseConn :: a
- _pciRetries :: Maybe Int
- pciDatabaseConn :: Lens' (PostgresConnInfo a) a
- pciRetries :: Lens' (PostgresConnInfo a) (Maybe Int)
- data PostgresConnInfoRaw
- mkUrlConnInfo :: String -> PostgresConnInfoRaw
- _PGConnDatabaseUrl :: Prism' PostgresConnInfoRaw Template
- _PGConnDetails :: Prism' PostgresConnInfoRaw PostgresConnDetailsRaw
- rawConnDetailsToUrl :: PostgresConnDetailsRaw -> Template
- data PostgresConnDetailsRaw = PostgresConnDetailsRaw {
- connHost :: String
- connPort :: Int
- connUser :: String
- connPassword :: String
- connDatabase :: String
- connOptions :: Maybe String
- rawConnDetailsToUrlText :: PostgresConnDetailsRaw -> Text
- data HGECommand a
- _HCServe :: Prism' (HGECommand a) a
- data ServeOptionsRaw impl = ServeOptionsRaw {
- rsoPort :: Maybe Port
- rsoHost :: Maybe HostPreference
- rsoConnParams :: ConnParamsRaw
- rsoTxIso :: Maybe TxIsolation
- rsoAdminSecret :: Maybe AdminSecretHash
- rsoAuthHook :: AuthHookRaw
- rsoJwtSecret :: Maybe JWTConfig
- rsoUnAuthRole :: Maybe RoleName
- rsoCorsConfig :: Maybe CorsConfig
- rsoConsoleStatus :: ConsoleStatus
- rsoConsoleAssetsDir :: Maybe Text
- rsoConsoleSentryDsn :: Maybe Text
- rsoEnableTelemetry :: Maybe TelemetryStatus
- rsoWsReadCookie :: WsReadCookieStatus
- rsoStringifyNum :: StringifyNumbers
- rsoDangerousBooleanCollapse :: Maybe DangerouslyCollapseBooleans
- rsoEnabledAPIs :: Maybe (HashSet API)
- rsoMxRefetchInt :: Maybe RefetchInterval
- rsoMxBatchSize :: Maybe BatchSize
- rsoStreamingMxRefetchInt :: Maybe RefetchInterval
- rsoStreamingMxBatchSize :: Maybe BatchSize
- rsoEnableAllowList :: AllowListStatus
- rsoEnabledLogTypes :: Maybe (HashSet (EngineLogType impl))
- rsoLogLevel :: Maybe LogLevel
- rsoDevMode :: DevModeStatus
- rsoAdminInternalErrors :: Maybe AdminInternalErrorsStatus
- rsoEventsHttpPoolSize :: Maybe (Refined Positive Int)
- rsoEventsFetchInterval :: Maybe (Refined NonNegative Milliseconds)
- rsoAsyncActionsFetchInterval :: Maybe OptionalInterval
- rsoEnableRemoteSchemaPermissions :: RemoteSchemaPermissions
- rsoWebSocketCompression :: CompressionOptions
- rsoWebSocketKeepAlive :: Maybe KeepAliveDelay
- rsoInferFunctionPermissions :: Maybe InferFunctionPermissions
- rsoEnableMaintenanceMode :: MaintenanceMode ()
- rsoSchemaPollInterval :: Maybe OptionalInterval
- rsoExperimentalFeatures :: Maybe (HashSet ExperimentalFeature)
- rsoEventsFetchBatchSize :: Maybe (Refined NonNegative Int)
- rsoGracefulShutdownTimeout :: Maybe (Refined NonNegative Seconds)
- rsoWebSocketConnectionInitTimeout :: Maybe WSConnectionInitTimeout
- rsoEnableMetadataQueryLoggingEnv :: MetadataQueryLoggingMode
- rsoDefaultNamingConvention :: Maybe NamingCase
- rsoExtensionsSchema :: Maybe ExtensionsSchema
- rsoMetadataDefaults :: Maybe MetadataDefaults
- rsoApolloFederationStatus :: Maybe ApolloFederationStatus
- rsoCloseWebsocketsOnMetadataChangeStatus :: Maybe CloseWebsocketsOnMetadataChangeStatus
- rsoMaxTotalHeaderLength :: Maybe Int
- data ConsoleStatus
- isConsoleEnabled :: ConsoleStatus -> Bool
- data AdminInternalErrorsStatus
- isAdminInternalErrorsEnabled :: AdminInternalErrorsStatus -> Bool
- isWebSocketCompressionEnabled :: CompressionOptions -> Bool
- data AllowListStatus
- isAllowListEnabled :: AllowListStatus -> Bool
- data DevModeStatus
- isDevModeEnabled :: DevModeStatus -> Bool
- data TelemetryStatus
- isTelemetryEnabled :: TelemetryStatus -> Bool
- data WsReadCookieStatus
- isWsReadCookieEnabled :: WsReadCookieStatus -> Bool
- data Port
- mkPort :: Int -> Maybe Port
- unsafePort :: Int -> Port
- data API
- data AuthHookRaw = AuthHookRaw {}
- data OptionalInterval
- msToOptionalInterval :: Refined NonNegative Milliseconds -> OptionalInterval
- data ConnParamsRaw = ConnParamsRaw {}
- newtype KeepAliveDelay = KeepAliveDelay {}
- newtype WSConnectionInitTimeout = WSConnectionInitTimeout {}
- data ServeOptions impl = ServeOptions {
- soPort :: Port
- soHost :: HostPreference
- soConnParams :: ConnParams
- soTxIso :: TxIsolation
- soAdminSecret :: HashSet AdminSecretHash
- soAuthHook :: Maybe AuthHook
- soJwtSecret :: [JWTConfig]
- soUnAuthRole :: Maybe RoleName
- soCorsConfig :: CorsConfig
- soConsoleStatus :: ConsoleStatus
- soConsoleAssetsDir :: Maybe Text
- soConsoleSentryDsn :: Maybe Text
- soEnableTelemetry :: TelemetryStatus
- soStringifyNum :: StringifyNumbers
- soDangerousBooleanCollapse :: DangerouslyCollapseBooleans
- soEnabledAPIs :: HashSet API
- soLiveQueryOpts :: LiveQueriesOptions
- soStreamingQueryOpts :: StreamQueriesOptions
- soEnableAllowList :: AllowListStatus
- soEnabledLogTypes :: HashSet (EngineLogType impl)
- soLogLevel :: LogLevel
- soEventsHttpPoolSize :: Refined Positive Int
- soEventsFetchInterval :: Refined NonNegative Milliseconds
- soAsyncActionsFetchInterval :: OptionalInterval
- soEnableRemoteSchemaPermissions :: RemoteSchemaPermissions
- soConnectionOptions :: ConnectionOptions
- soWebSocketKeepAlive :: KeepAliveDelay
- soInferFunctionPermissions :: InferFunctionPermissions
- soEnableMaintenanceMode :: MaintenanceMode ()
- soSchemaPollInterval :: OptionalInterval
- soExperimentalFeatures :: HashSet ExperimentalFeature
- soEventsFetchBatchSize :: Refined NonNegative Int
- soDevMode :: DevModeStatus
- soAdminInternalErrors :: AdminInternalErrorsStatus
- soGracefulShutdownTimeout :: Refined NonNegative Seconds
- soWebSocketConnectionInitTimeout :: WSConnectionInitTimeout
- soEventingMode :: EventingMode
- soReadOnlyMode :: ReadOnlyMode
- soEnableMetadataQueryLogging :: MetadataQueryLoggingMode
- soDefaultNamingConvention :: NamingCase
- soExtensionsSchema :: ExtensionsSchema
- soMetadataDefaults :: MetadataDefaults
- soApolloFederationStatus :: ApolloFederationStatus
- soCloseWebsocketsOnMetadataChangeStatus :: CloseWebsocketsOnMetadataChangeStatus
- soMaxTotalHeaderLength :: Int
- data ResponseInternalErrorsConfig
- shouldIncludeInternal :: RoleName -> ResponseInternalErrorsConfig -> Bool
- data DowngradeOptions = DowngradeOptions {}
Documentation
The collected default value, env var, and help message for an option. If there should be no default value then use 'Option ()'.
data HGEOptionsRaw impl Source #
Raw HGE Options from the arg parser and the env.
Constructors
HGEOptionsRaw | |
Fields |
horDatabaseUrl :: Lens' (HGEOptionsRaw impl) (PostgresConnInfo (Maybe PostgresConnInfoRaw)) Source #
horMetadataDbUrl :: Lens' (HGEOptionsRaw impl) (Maybe String) Source #
horCommand :: Lens' (HGEOptionsRaw impl) (HGECommand impl) Source #
data HGEOptions impl Source #
The final processed HGE options.
Constructors
HGEOptions | |
Fields
|
hoCommand :: Lens' (HGEOptions impl) (HGECommand impl) Source #
data PostgresConnInfo a Source #
Postgres connection info tupled with a retry count.
In practice, the a
here is one of the following:
1. 'Maybe PostgresConnInfoRaw'
2. 'Maybe UrlConf'
3. 'Maybe Text'
4. 'Maybe DatabaseUrl' where DatabaseUrl
is an alias for Text
If it contains a 'Maybe PostgresConnInfoRaw' then you have not yet processed your arg parser results.
Constructors
PostgresConnInfo | |
Fields
|
Instances
pciDatabaseConn :: Lens' (PostgresConnInfo a) a Source #
pciRetries :: Lens' (PostgresConnInfo a) (Maybe Int) Source #
data PostgresConnInfoRaw Source #
Postgres Connection info in the form of a templated URI string or structured data.
Constructors
PGConnDatabaseUrl Template | |
PGConnDetails PostgresConnDetailsRaw |
Instances
Show PostgresConnInfoRaw Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> PostgresConnInfoRaw -> ShowS # show :: PostgresConnInfoRaw -> String # showList :: [PostgresConnInfoRaw] -> ShowS # | |
Eq PostgresConnInfoRaw Source # | |
Defined in Hasura.Server.Init.Config Methods (==) :: PostgresConnInfoRaw -> PostgresConnInfoRaw -> Bool # (/=) :: PostgresConnInfoRaw -> PostgresConnInfoRaw -> Bool # |
data PostgresConnDetailsRaw Source #
Structured Postgres connection information as provided by the arg parser or env vars.
Constructors
PostgresConnDetailsRaw | |
Fields
|
Instances
data HGECommand a Source #
The HGE Arg parser Command choices.
This is polymorphic so that we can pack either ServeOptionsRaw
or
ProServeOptionsRaw
in it.
Constructors
HCServe a | |
HCExport | |
HCClean | |
HCVersion | |
HCDowngrade !DowngradeOptions |
Instances
Show a => Show (HGECommand a) Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> HGECommand a -> ShowS # show :: HGECommand a -> String # showList :: [HGECommand a] -> ShowS # | |
Eq a => Eq (HGECommand a) Source # | |
Defined in Hasura.Server.Init.Config |
_HCServe :: Prism' (HGECommand a) a Source #
data ServeOptionsRaw impl Source #
The Serve Command options accumulated from the Arg and Env parsers.
NOTE: A Nothing
value indicates the absence of a particular
flag. Hence types such as 'Maybe (HashSet X)' or 'Maybe Bool'.
Constructors
data ConsoleStatus Source #
Whether or not to serve Console assets.
Constructors
ConsoleEnabled | |
ConsoleDisabled |
Instances
isConsoleEnabled :: ConsoleStatus -> Bool Source #
data AdminInternalErrorsStatus Source #
Whether or not internal errors will be sent in response to admin.
Instances
data AllowListStatus Source #
A representation of whether or not to enable the GraphQL Query AllowList.
See: https://hasura.io/docs/latest/security/allow-list/#enable-allow-list
Constructors
AllowListEnabled | |
AllowListDisabled |
Instances
data DevModeStatus Source #
A representation of whether or not to enable Hasura Dev Mode.
See: https://hasura.io/docs/latest/deployment/graphql-engine-flags/config-examples/#dev-mode
Constructors
DevModeEnabled | |
DevModeDisabled |
Instances
isDevModeEnabled :: DevModeStatus -> Bool Source #
data TelemetryStatus Source #
A representation of whether or not to enable telemetry that is isomorphic to Bool
.
Constructors
TelemetryEnabled | |
TelemetryDisabled |
Instances
data WsReadCookieStatus Source #
A representation of whether or not to read the websocket cookie
on initial handshake that is isomorphic to Bool
. See
wsReadCookieOption
for more details.
Constructors
WsReadCookieEnabled | |
WsReadCookieDisabled |
Instances
An Int
representing a Port number in the range 0 to 65536.
unsafePort :: Int -> Port Source #
Instances
FromJSON API Source # | |
ToJSON API Source # | |
Generic API Source # | |
Read API Source # | |
Show API Source # | |
Eq API Source # | |
Hashable API Source # | |
FromEnv (HashSet API) Source # | |
type Rep API Source # | |
Defined in Hasura.Server.Init.Config type Rep API = D1 ('MetaData "API" "Hasura.Server.Init.Config" "graphql-engine-1.0.0-inplace" 'False) ((C1 ('MetaCons "METADATA" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GRAPHQL" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PGDUMP" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "DEVELOPER" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CONFIG" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "METRICS" 'PrefixI 'False) (U1 :: Type -> Type)))) |
data AuthHookRaw Source #
Constructors
AuthHookRaw | |
Fields
|
data OptionalInterval Source #
Sleep time interval for recurring activities such as (@asyncActionsProcessor
)
Presently msToOptionalInterval
interprets `0` as Skip.
Constructors
Skip | No polling |
Interval (Refined NonNegative Milliseconds) | Interval time |
Instances
FromJSON OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config Methods parseJSON :: Value -> Parser OptionalInterval Source # parseJSONList :: Value -> Parser [OptionalInterval] Source # | |
ToJSON OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config Methods toJSON :: OptionalInterval -> Value Source # toEncoding :: OptionalInterval -> Encoding Source # toJSONList :: [OptionalInterval] -> Value Source # toEncodingList :: [OptionalInterval] -> Encoding Source # | |
Show OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> OptionalInterval -> ShowS # show :: OptionalInterval -> String # showList :: [OptionalInterval] -> ShowS # | |
Eq OptionalInterval Source # | |
Defined in Hasura.Server.Init.Config Methods (==) :: OptionalInterval -> OptionalInterval -> Bool # (/=) :: OptionalInterval -> OptionalInterval -> Bool # | |
FromEnv OptionalInterval Source # | |
Defined in Hasura.Server.Init.Env |
data ConnParamsRaw Source #
The Raw configuration data from the Arg and Env parsers needed to
construct a ConnParams
Constructors
ConnParamsRaw | |
Fields
|
Instances
Show ConnParamsRaw Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> ConnParamsRaw -> ShowS # show :: ConnParamsRaw -> String # showList :: [ConnParamsRaw] -> ShowS # | |
Eq ConnParamsRaw Source # | |
Defined in Hasura.Server.Init.Config Methods (==) :: ConnParamsRaw -> ConnParamsRaw -> Bool # (/=) :: ConnParamsRaw -> ConnParamsRaw -> Bool # |
newtype KeepAliveDelay Source #
Constructors
KeepAliveDelay | |
Fields |
Instances
FromJSON KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config Methods parseJSON :: Value -> Parser KeepAliveDelay Source # parseJSONList :: Value -> Parser [KeepAliveDelay] Source # | |
ToJSON KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config Methods toJSON :: KeepAliveDelay -> Value Source # toEncoding :: KeepAliveDelay -> Encoding Source # toJSONList :: [KeepAliveDelay] -> Value Source # toEncodingList :: [KeepAliveDelay] -> Encoding Source # | |
Show KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> KeepAliveDelay -> ShowS # show :: KeepAliveDelay -> String # showList :: [KeepAliveDelay] -> ShowS # | |
Eq KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Config Methods (==) :: KeepAliveDelay -> KeepAliveDelay -> Bool # (/=) :: KeepAliveDelay -> KeepAliveDelay -> Bool # | |
FromEnv KeepAliveDelay Source # | |
Defined in Hasura.Server.Init.Env |
newtype WSConnectionInitTimeout Source #
The timeout duration in Seconds
for a WebSocket connection.
Constructors
WSConnectionInitTimeout | |
Instances
data ServeOptions impl Source #
The final Serve Command options accummulated from the Arg Parser and the Environment, fully processed and ready to apply when running the server.
Constructors
data ResponseInternalErrorsConfig Source #
ResponseInternalErrorsConfig
represents the encoding of the
internal errors in the response to the client.
For more details, see this github comment: https://github.com/hasura/graphql-engine/issues/4031#issuecomment-609747705
Instances
Show ResponseInternalErrorsConfig Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> ResponseInternalErrorsConfig -> ShowS # show :: ResponseInternalErrorsConfig -> String # showList :: [ResponseInternalErrorsConfig] -> ShowS # | |
Eq ResponseInternalErrorsConfig Source # | |
Defined in Hasura.Server.Init.Config Methods (==) :: ResponseInternalErrorsConfig -> ResponseInternalErrorsConfig -> Bool # (/=) :: ResponseInternalErrorsConfig -> ResponseInternalErrorsConfig -> Bool # |
data DowngradeOptions Source #
The Downgrade Command options. These are only sourced from the
Arg Parser and are used directly in Migrate
.
Constructors
DowngradeOptions | |
Fields
|
Instances
Show DowngradeOptions Source # | |
Defined in Hasura.Server.Init.Config Methods showsPrec :: Int -> DowngradeOptions -> ShowS # show :: DowngradeOptions -> String # showList :: [DowngradeOptions] -> ShowS # | |
Eq DowngradeOptions Source # | |
Defined in Hasura.Server.Init.Config Methods (==) :: DowngradeOptions -> DowngradeOptions -> Bool # (/=) :: DowngradeOptions -> DowngradeOptions -> Bool # |
Note Experimental features:
The graphql-engine accepts a list of experimental features that can be enabled at the startup. Experimental features are a way to introduce new, but not stable features to our users in a manner in which they have the choice to enable or disable a certain feature(s).
The objective of an experimental feature should be that when the feature is disabled, the graphql-engine should work the same way as it worked before adding the said feature.
The experimental feature's flag is `--experimental-features` and the corresponding
environment variable is HASURA_GRAPHQL_EXPERIMENTAL_FEATURES
which expects a comma-seperated
value.
When an experimental feature is stable enough i.e. it's stable through multiple non-beta releases then we make the feature not experimental i.e. it will always be enabled. Note that when we do this we still have to support parsing of the experimental feature because users of the previous version will have it enabled and when they upgrade an error should not be thrown at the startup. For example:
The inherited roles was an experimental feature when introduced and it was enabled by
setting `--experimental-features` to inherited_roles
and then it was decided to make the inherited roles
a stable feature, so it was removed as an experimental feature but the code was modified such that
`--experimental-features inherited_roles` to not throw an error.
Note ReadOnly Mode:
This mode starts the server in a (database) read-only mode. That is, only read-only queries are allowed on users' database sources, and write queries throw a runtime error. The use-case is for failsafe operations. Metadata APIs are also disabled.
Following is the precise behaviour - 1. For any GraphQL API (relayhasura; httpwebsocket) - disable execution of mutations 2. Metadata API is disabled 3. v2query API - insert, delete, update, run_sql are disabled 4. v1query API - insert, delete, update, run_sql are disabled 5. No source catalog migrations are run 6. During build schema cache phase, building event triggers are disabled (as they create corresponding database triggers)