Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data HandlerCtx
- data Handler m a
- data APIResp
- = JSONResp !(HttpResponse EncJSON)
- | RawResp !(HttpResponse ByteString)
- boolToText :: Bool -> Text
- isAdminSecretSet :: AuthMode -> Text
- mkGetHandler :: Handler m (HttpLogGraphQLInfo, APIResp) -> APIHandler m ()
- onlyAdmin :: (MonadError QErr m, MonadReader HandlerCtx m) => m ()
- class Monad m => MonadMetadataApiAuthorization m where
- authorizeV1QueryApi :: RQLQuery -> HandlerCtx -> m (Either QErr ())
- authorizeV1MetadataApi :: RQLMetadata -> HandlerCtx -> m (Either QErr ())
- authorizeV2QueryApi :: RQLQuery -> HandlerCtx -> m (Either QErr ())
- class Monad m => MonadConfigApiHandler m where
- runConfigApiHandler :: AppStateRef impl -> SpockCtxT () m ()
- mkSpockAction :: forall m a impl. (MonadIO m, MonadBaseControl IO m, HasAppEnv m, FromJSON a, UserAuthentication m, HttpLog m, HasResourceLimits m, MonadTrace m) => AppStateRef impl -> (Bool -> QErr -> Encoding) -> (QErr -> QErr) -> APIHandler m a -> ActionT m ()
- class Monad m => ConsoleRenderer m where
- type ConsoleType m :: Type
- renderConsole :: Text -> AuthMode -> TelemetryStatus -> Maybe Text -> Maybe Text -> ConsoleType m -> m (Either String Text)
- data CEConsoleType
- ceConsoleTypeIdentifier :: CEConsoleType -> String
- class Monad m => MonadVersionAPIWithExtraData m where
- getExtraDataForVersionAPI :: m [Pair]
- renderHtmlTemplate :: Template -> Value -> Either String Text
- configApiGetHandler :: forall m impl. (MonadIO m, MonadBaseControl IO m, HasAppEnv m, UserAuthentication m, HttpLog m, HasResourceLimits m, MonadTrace m) => AppStateRef impl -> SpockCtxT () m ()
- data HasuraApp = HasuraApp !Application !AsyncActionSubscriptionState !(IO ())
- mkWaiApp :: forall m impl. (MonadIO m, MonadFix m, MonadStateless IO m, Forall (Pure m), ConsoleRenderer m, MonadVersionAPIWithExtraData m, HttpLog m, HasAppEnv m, HasCacheStaticConfig m, HasFeatureFlagChecker m, UserAuthentication m, MonadMetadataApiAuthorization m, MonadGQLExecutionCheck m, MonadConfigApiHandler m, MonadQueryLog m, MonadExecutionLog m, MonadWSLog m, MonadTrace m, MonadExecuteQuery m, HasResourceLimits m, MonadMetadataStorage m, MonadResolveSource m, MonadQueryTags m, MonadEventLogCleanup m, ProvidesNetwork m, MonadGetPolicies m) => (AppStateRef impl -> SpockT m ()) -> AppStateRef impl -> ConsoleType m -> Store EmptyMetrics -> WSServerEnv impl -> m HasuraApp
- onlyWhenApiEnabled :: MonadIO m => (AppContext -> Bool) -> AppStateRef impl -> ActionCtxT ctx m b -> ActionCtxT ctx m b
Documentation
data HandlerCtx Source #
Instances
Monad m => MonadReader HandlerCtx (Handler m) Source # | |
Defined in Hasura.Server.App ask :: Handler m HandlerCtx # local :: (HandlerCtx -> HandlerCtx) -> Handler m a -> Handler m a # reader :: (HandlerCtx -> a) -> Handler m a # |
Instances
boolToText :: Bool -> Text Source #
isAdminSecretSet :: AuthMode -> Text Source #
mkGetHandler :: Handler m (HttpLogGraphQLInfo, APIResp) -> APIHandler m () Source #
onlyAdmin :: (MonadError QErr m, MonadReader HandlerCtx m) => m () Source #
class Monad m => MonadMetadataApiAuthorization m where Source #
Typeclass representing the metadata API authorization effect
authorizeV1QueryApi :: RQLQuery -> HandlerCtx -> m (Either QErr ()) Source #
authorizeV1MetadataApi :: RQLMetadata -> HandlerCtx -> m (Either QErr ()) Source #
authorizeV2QueryApi :: RQLQuery -> HandlerCtx -> m (Either QErr ()) Source #
Instances
class Monad m => MonadConfigApiHandler m where Source #
The config API (v1alpha1config) handler
runConfigApiHandler :: AppStateRef impl -> SpockCtxT () m () Source #
Instances
MonadConfigApiHandler AppM Source # | |
Defined in Hasura.App runConfigApiHandler :: AppStateRef impl -> SpockCtxT () AppM () Source # |
:: forall m a impl. (MonadIO m, MonadBaseControl IO m, HasAppEnv m, FromJSON a, UserAuthentication m, HttpLog m, HasResourceLimits m, MonadTrace m) | |
=> AppStateRef impl | |
-> (Bool -> QErr -> Encoding) |
|
-> (QErr -> QErr) |
|
-> APIHandler m a | |
-> ActionT m () |
class Monad m => ConsoleRenderer m where Source #
type ConsoleType m :: Type Source #
renderConsole :: Text -> AuthMode -> TelemetryStatus -> Maybe Text -> Maybe Text -> ConsoleType m -> m (Either String Text) Source #
Instances
ConsoleRenderer AppM Source # | |
Defined in Hasura.App type ConsoleType AppM Source # | |
ConsoleRenderer m => ConsoleRenderer (TraceT m) Source # | |
Defined in Hasura.Server.App type ConsoleType (TraceT m) Source # |
class Monad m => MonadVersionAPIWithExtraData m where Source #
getExtraDataForVersionAPI :: m [Pair] Source #
Instances
MonadVersionAPIWithExtraData AppM Source # | |
Defined in Hasura.App |
configApiGetHandler :: forall m impl. (MonadIO m, MonadBaseControl IO m, HasAppEnv m, UserAuthentication m, HttpLog m, HasResourceLimits m, MonadTrace m) => AppStateRef impl -> SpockCtxT () m () Source #
Default implementation of the MonadConfigApiHandler
mkWaiApp :: forall m impl. (MonadIO m, MonadFix m, MonadStateless IO m, Forall (Pure m), ConsoleRenderer m, MonadVersionAPIWithExtraData m, HttpLog m, HasAppEnv m, HasCacheStaticConfig m, HasFeatureFlagChecker m, UserAuthentication m, MonadMetadataApiAuthorization m, MonadGQLExecutionCheck m, MonadConfigApiHandler m, MonadQueryLog m, MonadExecutionLog m, MonadWSLog m, MonadTrace m, MonadExecuteQuery m, HasResourceLimits m, MonadMetadataStorage m, MonadResolveSource m, MonadQueryTags m, MonadEventLogCleanup m, ProvidesNetwork m, MonadGetPolicies m) => (AppStateRef impl -> SpockT m ()) -> AppStateRef impl -> ConsoleType m -> Store EmptyMetrics -> WSServerEnv impl -> m HasuraApp Source #
onlyWhenApiEnabled :: MonadIO m => (AppContext -> Bool) -> AppStateRef impl -> ActionCtxT ctx m b -> ActionCtxT ctx m b Source #