Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype RoleName = RoleName {}
- roleNameToTxt :: RoleName -> Text
- mkRoleName :: Text -> Maybe RoleName
- mkRoleNameSafe :: NonEmptyText -> RoleName
- adminRoleName :: RoleName
- newtype SessionVariable = SessionVariable {
- unSessionVariable :: CI Text
- sessionVariableToGraphQLName :: SessionVariable -> Maybe Name
- parseSessionVariable :: Text -> Parser SessionVariable
- sessionVariableToText :: SessionVariable -> Text
- mkSessionVariable :: Text -> SessionVariable
- type SessionVariableValue = Text
- newtype SessionVariables = SessionVariables {}
- filterSessionVariables :: (SessionVariable -> SessionVariableValue -> Bool) -> SessionVariables -> SessionVariables
- mkSessionVariablesText :: HashMap Text Text -> SessionVariables
- mkSessionVariablesHeaders :: [Header] -> SessionVariables
- sessionVariablesToHeaders :: SessionVariables -> [Header]
- getSessionVariables :: SessionVariables -> [Text]
- getSessionVariablesSet :: SessionVariables -> HashSet SessionVariable
- getSessionVariableValue :: SessionVariable -> SessionVariables -> Maybe SessionVariableValue
- data UserAdminSecret
- data BackendOnlyFieldAccess
- data UserInfo = UserInfo {}
- class Monad m => UserInfoM m where
- askUserInfo :: m UserInfo
- askCurRole :: UserInfoM m => m RoleName
- data UserRoleBuild
- mkUserInfo :: forall m. MonadError QErr m => UserRoleBuild -> UserAdminSecret -> SessionVariables -> m UserInfo
- maybeRoleFromSessionVariables :: SessionVariables -> Maybe RoleName
- adminUserInfo :: UserInfo
Documentation
Instances
roleNameToTxt :: RoleName -> Text Source #
mkRoleName :: Text -> Maybe RoleName Source #
newtype SessionVariable Source #
SessionVariable | |
|
Instances
sessionVariableToGraphQLName :: SessionVariable -> Maybe Name Source #
Converts a SessionVariable
value to a GraphQL name.
This will fail if the session variable contains characters that are not valid
for a graphql names. It is the caller's responsibility to decide what to do
in such a case.
parseSessionVariable :: Text -> Parser SessionVariable Source #
sessionVariableToText :: SessionVariable -> Text Source #
mkSessionVariable :: Text -> SessionVariable Source #
type SessionVariableValue = Text Source #
newtype SessionVariables Source #
Instances
filterSessionVariables :: (SessionVariable -> SessionVariableValue -> Bool) -> SessionVariables -> SessionVariables Source #
mkSessionVariablesText :: HashMap Text Text -> SessionVariables Source #
mkSessionVariablesHeaders :: [Header] -> SessionVariables Source #
sessionVariablesToHeaders :: SessionVariables -> [Header] Source #
getSessionVariables :: SessionVariables -> [Text] Source #
getSessionVariablesSet :: SessionVariables -> HashSet SessionVariable Source #
getSessionVariableValue :: SessionVariable -> SessionVariables -> Maybe SessionVariableValue Source #
data UserAdminSecret Source #
Represent the admin secret state; whether the secret is sent in the request or if actually authorization is not configured.
Instances
Eq UserAdminSecret Source # | |
Defined in Hasura.Session (==) :: UserAdminSecret -> UserAdminSecret -> Bool # (/=) :: UserAdminSecret -> UserAdminSecret -> Bool # | |
Show UserAdminSecret Source # | |
Defined in Hasura.Session showsPrec :: Int -> UserAdminSecret -> ShowS # show :: UserAdminSecret -> String # showList :: [UserAdminSecret] -> ShowS # |
data BackendOnlyFieldAccess Source #
Represents the 'X-Hasura-Use-Backend-Only-Permissions' session variable and request made with 'X-Hasura-Admin-Secret' if any auth configured. For more details see Note [Backend only permissions]
Instances
Eq BackendOnlyFieldAccess Source # | |
Defined in Hasura.Session | |
Show BackendOnlyFieldAccess Source # | |
Defined in Hasura.Session showsPrec :: Int -> BackendOnlyFieldAccess -> ShowS # show :: BackendOnlyFieldAccess -> String # showList :: [BackendOnlyFieldAccess] -> ShowS # | |
Generic BackendOnlyFieldAccess Source # | |
Defined in Hasura.Session type Rep BackendOnlyFieldAccess :: Type -> Type # | |
Hashable BackendOnlyFieldAccess Source # | |
Defined in Hasura.Session hashWithSalt :: Int -> BackendOnlyFieldAccess -> Int hash :: BackendOnlyFieldAccess -> Int | |
type Rep BackendOnlyFieldAccess Source # | |
Instances
Eq UserInfo Source # | |
Show UserInfo Source # | |
Generic UserInfo Source # | |
Hashable UserInfo Source # | |
Defined in Hasura.Session | |
type Rep UserInfo Source # | |
Defined in Hasura.Session type Rep UserInfo = D1 ('MetaData "UserInfo" "Hasura.Session" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "UserInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "_uiRole") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RoleName) :*: (S1 ('MetaSel ('Just "_uiSession") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SessionVariables) :*: S1 ('MetaSel ('Just "_uiBackendOnlyFieldAccess") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BackendOnlyFieldAccess)))) |
class Monad m => UserInfoM m where Source #
askUserInfo :: m UserInfo Source #
Instances
UserInfoM m => UserInfoM (TraceT m) Source # | |
Defined in Hasura.Session askUserInfo :: TraceT m UserInfo Source # | |
UserInfoM m => UserInfoM (MetadataT m) Source # | |
Defined in Hasura.RQL.Types.SchemaCache.Build askUserInfo :: MetadataT m UserInfo Source # | |
Monad m => UserInfoM (RunT m) Source # | |
Defined in Hasura.RQL.Types.Run askUserInfo :: RunT m UserInfo Source # | |
UserInfoM m => UserInfoM (CacheRWT m) Source # | |
Defined in Hasura.RQL.DDL.Schema.Cache askUserInfo :: CacheRWT m UserInfo Source # | |
UserInfoM m => UserInfoM (ExceptT r m) Source # | |
Defined in Hasura.Session askUserInfo :: ExceptT r m UserInfo Source # | |
UserInfoM m => UserInfoM (ReaderT r m) Source # | |
Defined in Hasura.Session askUserInfo :: ReaderT r m UserInfo Source # | |
UserInfoM m => UserInfoM (StateT s m) Source # | |
Defined in Hasura.Session askUserInfo :: StateT s m UserInfo Source # | |
UserInfoM m => UserInfoM (TableCacheRT b m) Source # | |
Defined in Hasura.RQL.Types.SchemaCache askUserInfo :: TableCacheRT b m UserInfo Source # |
askCurRole :: UserInfoM m => m RoleName Source #
data UserRoleBuild Source #
Represents how to build a role from the session variables
URBFromSessionVariables | Look for `x-hasura-role` session variable value and absence will raise an exception |
URBFromSessionVariablesFallback !RoleName | Look for `x-hasura-role` session variable value, if absent fall back to given role |
URBPreDetermined !RoleName | Use only the pre-determined role |
Instances
Eq UserRoleBuild Source # | |
Defined in Hasura.Session (==) :: UserRoleBuild -> UserRoleBuild -> Bool # (/=) :: UserRoleBuild -> UserRoleBuild -> Bool # | |
Show UserRoleBuild Source # | |
Defined in Hasura.Session showsPrec :: Int -> UserRoleBuild -> ShowS # show :: UserRoleBuild -> String # showList :: [UserRoleBuild] -> ShowS # |
mkUserInfo :: forall m. MonadError QErr m => UserRoleBuild -> UserAdminSecret -> SessionVariables -> m UserInfo Source #
Build UserInfo
from SessionVariables