| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hasura.RQL.Types.Allowlist
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 #
Constructors
| DropCollectionFromAllowlist | |
Fields | |
Instances
| Eq DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods (==) :: DropCollectionFromAllowlist -> DropCollectionFromAllowlist -> Bool # (/=) :: DropCollectionFromAllowlist -> DropCollectionFromAllowlist -> Bool # | |
| Show DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods showsPrec :: Int -> DropCollectionFromAllowlist -> ShowS # show :: DropCollectionFromAllowlist -> String # showList :: [DropCollectionFromAllowlist] -> ShowS # | |
| FromJSON DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods parseJSON :: Value -> Parser DropCollectionFromAllowlist parseJSONList :: Value -> Parser [DropCollectionFromAllowlist] | |
| ToJSON DropCollectionFromAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods toJSON :: DropCollectionFromAllowlist -> Value toEncoding :: DropCollectionFromAllowlist -> Encoding toJSONList :: [DropCollectionFromAllowlist] -> Value toEncodingList :: [DropCollectionFromAllowlist] -> Encoding | |
data AllowlistScope Source #
Constructors
| AllowlistScopeGlobal | |
| AllowlistScopeRoles (NonEmpty RoleName) |
Instances
data AllowlistEntry Source #
Constructors
| AllowlistEntry | |
Fields | |
Instances
newtype UpdateScopeOfCollectionInAllowlist Source #
Wrap AllowlistEntry with a FromJSON instance that requires scope to be set.
Constructors
| UpdateScopeOfCollectionInAllowlist AllowlistEntry |
Instances
| FromJSON UpdateScopeOfCollectionInAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods 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.
Constructors
| NormalizedQuery | |
Fields
| |
Instances
| Eq NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods (==) :: NormalizedQuery -> NormalizedQuery -> Bool # (/=) :: NormalizedQuery -> NormalizedQuery -> Bool # | |
| Show NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods showsPrec :: Int -> NormalizedQuery -> ShowS # show :: NormalizedQuery -> String # showList :: [NormalizedQuery] -> ShowS # | |
| Hashable NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist | |
| ToJSON NormalizedQuery Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods 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.
Constructors
| InlinedAllowlist | |
Fields
| |
Instances
| Eq InlinedAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods (==) :: InlinedAllowlist -> InlinedAllowlist -> Bool # (/=) :: InlinedAllowlist -> InlinedAllowlist -> Bool # | |
| Show InlinedAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods showsPrec :: Int -> InlinedAllowlist -> ShowS # show :: InlinedAllowlist -> String # showList :: [InlinedAllowlist] -> ShowS # | |
| ToJSON InlinedAllowlist Source # | |
Defined in Hasura.RQL.Types.Allowlist Methods 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.
Constructors
| AllowlistModeGlobalOnly | |
| AllowlistModeFull |
allowlistAllowsQuery :: InlinedAllowlist -> AllowlistMode -> RoleName -> ExecutableDocument Name -> Bool Source #