Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype DropCollectionFromAllowlist = DropCollectionFromAllowlist {}
- data AllowlistScope
- data AllowlistEntry = AllowlistEntry {}
- newtype UpdateScopeOfCollectionInAllowlist = UpdateScopeOfCollectionInAllowlist AllowlistEntry
- type MetadataAllowlist = InsOrdHashMap CollectionName AllowlistEntry
- metadataAllowlistInsert :: AllowlistEntry -> MetadataAllowlist -> Either Text MetadataAllowlist
- metadataAllowlistUpdateScope :: AllowlistEntry -> MetadataAllowlist -> Either Text MetadataAllowlist
- metadataAllowlistAllCollections :: MetadataAllowlist -> [CollectionName]
- newtype NormalizedQuery = NormalizedQuery {
- unNormalizedQuery :: ExecutableDocument Name
- normalizeQuery :: ExecutableDocument Name -> NormalizedQuery
- data InlinedAllowlist = InlinedAllowlist {
- iaGlobal :: HashSet NormalizedQuery
- iaPerRole :: HashMap RoleName (HashSet NormalizedQuery)
- inlineAllowlist :: QueryCollections -> MetadataAllowlist -> InlinedAllowlist
- data AllowlistMode
- allowlistAllowsQuery :: InlinedAllowlist -> AllowlistMode -> RoleName -> ExecutableDocument Name -> Bool
Documentation
newtype DropCollectionFromAllowlist Source #
Instances
Eq DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist | |
Show DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist showsPrec :: Int -> DropCollectionFromAllowlist -> ShowS # show :: DropCollectionFromAllowlist -> String # showList :: [DropCollectionFromAllowlist] -> ShowS # | |
FromJSON DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist parseJSON :: Value -> Parser DropCollectionFromAllowlist parseJSONList :: Value -> Parser [DropCollectionFromAllowlist] | |
ToJSON DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist toJSON :: DropCollectionFromAllowlist -> Value toEncoding :: DropCollectionFromAllowlist -> Encoding toJSONList :: [DropCollectionFromAllowlist] -> Value toEncodingList :: [DropCollectionFromAllowlist] -> Encoding |
data AllowlistScope Source #
Instances
data AllowlistEntry Source #
Instances
newtype UpdateScopeOfCollectionInAllowlist Source #
Wrap AllowlistEntry
with a FromJSON instance that requires scope
to be set.
Instances
FromJSON UpdateScopeOfCollectionInAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist parseJSON :: Value -> Parser UpdateScopeOfCollectionInAllowlist parseJSONList :: Value -> Parser [UpdateScopeOfCollectionInAllowlist] |
type MetadataAllowlist = InsOrdHashMap CollectionName AllowlistEntry Source #
metadataAllowlistInsert :: AllowlistEntry -> MetadataAllowlist -> Either Text MetadataAllowlist Source #
metadataAllowlistUpdateScope :: AllowlistEntry -> MetadataAllowlist -> Either Text MetadataAllowlist Source #
metadataAllowlistAllCollections :: MetadataAllowlist -> [CollectionName] Source #
Produce a list of all collections in the allowlist.
This is used in runDropCollection
to function to ensure that we don't delete
any collections which are referred to in the allowlist.
newtype NormalizedQuery Source #
A query stripped of typenames. A query is allowed if it occurs in an allowed query collection after normalization.
Compare docsgraphqlcoredeploymentallow-list.rst.
NormalizedQuery | |
|
Instances
Eq NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist (==) :: NormalizedQuery -> NormalizedQuery -> Bool # (/=) :: NormalizedQuery -> NormalizedQuery -> Bool # | |
Show NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist showsPrec :: Int -> NormalizedQuery -> ShowS # show :: NormalizedQuery -> String # showList :: [NormalizedQuery] -> ShowS # | |
Hashable NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist hashWithSalt :: Int -> NormalizedQuery -> Int hash :: NormalizedQuery -> Int | |
ToJSON NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist toJSON :: NormalizedQuery -> Value toEncoding :: NormalizedQuery -> Encoding toJSONList :: [NormalizedQuery] -> Value toEncodingList :: [NormalizedQuery] -> Encoding |
normalizeQuery :: ExecutableDocument Name -> NormalizedQuery Source #
Normalize query for comparison by stripping type names.
data InlinedAllowlist Source #
InlinedAllowlist is the data type with which the allowlist is represented in the schema cache, it contains a global and a per role allowlist and when allowlist is enabled in the graphql-engine, the incoming query for a non-admin role should either be in the global allowlist or in the given role's role based allowlist.
Essentially, it's a memoization of allowlistAllowsQuery
implemented
in terms of MetadataAllowlist
.
InlinedAllowlist | |
|
Instances
Eq InlinedAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist (==) :: InlinedAllowlist -> InlinedAllowlist -> Bool # (/=) :: InlinedAllowlist -> InlinedAllowlist -> Bool # | |
Show InlinedAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist showsPrec :: Int -> InlinedAllowlist -> ShowS # show :: InlinedAllowlist -> String # showList :: [InlinedAllowlist] -> ShowS # | |
ToJSON InlinedAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist toJSON :: InlinedAllowlist -> Value toEncoding :: InlinedAllowlist -> Encoding toJSONList :: [InlinedAllowlist] -> Value toEncodingList :: [InlinedAllowlist] -> Encoding |
data AllowlistMode Source #
The mode in which the allowlist functions. In global mode, collections with non-global scope are ignored.
allowlistAllowsQuery :: InlinedAllowlist -> AllowlistMode -> RoleName -> ExecutableDocument Name -> Bool Source #