mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
fcef6e5cb2
## Description This PR is in reference to #2449 (support IP blacklisting for multitenant) *RFC Update: Add support for IPv6 blocking* ### Solution and Design Using [http-client-restricted](https://hackage.haskell.org/package/http-client-restricted) package, we're creating the HTTP manager with restricting capabilities. The IPs can be supplied from the CLI arguments as `--ipv4BlocklistCidrs cidr1, cidr2...` or `--disableDefaultIPv4Blocklist` for a default IP list. The new manager will block all requests to the provided CIDRs. We are extracting the error message string to show the end-user that given IP is blocked from being set as a webhook. There are 2 ways to extract the error message "connection to IP address is blocked". Given below are the responses from event trigger to a blocked IP for these implementations: - 6d74fde316f61e246c861befcca5059d33972fa7 - We return the error message string as a HTTPErr(HOther) from `Hasura/Eventing/HTTP.hs`. ``` { "data": { "message": "blocked connection to private IP address " }, "version": "2", "type": "client_error" } ``` - 88e17456345cbb449a5ecd4877c84c9f319dbc25 - We case match on HTTPExceptionContent for InternaException in `Hasura/HTTP.hs` and extract the error message string from it. (this is implemented as it handles all the cases where pro engine makes webhook requests) ``` { "data": { "message": { "type": "http_exception", "message": "blocked connection to private IP address ", "request": { "secure": false, "path": "/webhook", "responseTimeout": "ResponseTimeoutMicro 60000000", "queryString": "", "method": "POST", "requestHeaders": { "Content-Type": "application/json", "X-B3-ParentSpanId": "5ae6573edb2a6b36", "X-B3-TraceId": "29ea7bd6de6ebb8f", "X-B3-SpanId": "303137d9f1d4f341", "User-Agent": "hasura-graphql-engine/cerebushttp-ip-blacklist-a793a0e41-dirty" }, "host": "139.59.90.109", "port": 8000 } } }, "version": "2", "type": "client_error" } ``` ### Steps to test and verify The restricted IPs can be used as webhooks in event triggers, and hasura will return an error message in reponse. ### Limitations, known bugs & workarounds - The `http-client-restricted` has a needlessly complex interface, and puts effort into implementing proxy support which we don't want, so we've inlined a stripped down version. - Performance constraint: As the blocking is checked for each request, if a long list of blocked CIDRs is supplied, iterating through all of them is not what we would prefer. Using trie is suggested to overcome this. (Added to RFC) - Calls to Lux endpoints are inconsistent: We use either the http manager from the ProServeCtx which is unrestricted, or the http manager from the ServeCtx which is restricted (the latter through the instances for MonadMetadataApiAuthorization and UserAuthentication). (The failure scenario here would be: cloud sets PRO_ENDPOINT to something that resolves to an internal address, and then restricted requests to those endpoints fail, causing auth to fail on user requests. This is about HTTP requests to lux auth endpoints.) ## Changelog - ✅ `CHANGELOG.md` is updated with user-facing content relevant to this PR. ## Affected components - ✅ Server - ✅ Tests PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3186 Co-authored-by: Robert <132113+robx@users.noreply.github.com> GitOrigin-RevId: 5bd2de2d028bc416b02c99e996c7bebce56fb1e7
1024 lines
37 KiB
Plaintext
1024 lines
37 KiB
Plaintext
cabal-version: 2.2
|
||
|
||
name: graphql-engine
|
||
version: 1.0.0
|
||
synopsis: GraphQL API over Postgres
|
||
homepage: https://www.hasura.io
|
||
license: Apache-2.0
|
||
author: Vamshi Surabhi
|
||
maintainer: vamshi@hasura.io
|
||
copyright: Hasura Inc.
|
||
category: Database
|
||
build-type: Simple
|
||
|
||
source-repository head
|
||
type: git
|
||
location: https://github.com/hasura/graphql-engine
|
||
|
||
flag developer
|
||
description: Enable support for development-only APIs
|
||
default: False
|
||
manual: True
|
||
|
||
flag profiling
|
||
description: Configures the project to be profiling-compatible
|
||
default: False
|
||
manual: True
|
||
|
||
-- A single flag to enable all optimization-related settings at once, for all
|
||
-- hasura code.
|
||
-- We share this flag name across our .cabal projects so we can switch it on or
|
||
-- off for all of them at the top level of our cabal.project(.*) files
|
||
flag optimize-hasura
|
||
description: Compile hasura code with appropriate optimizations
|
||
default: True
|
||
manual: False
|
||
|
||
common common-all
|
||
ghc-options:
|
||
-foptimal-applicative-do
|
||
-Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
|
||
-- This is just to keep compile-times in check and might be adjusted later (See mono #2610):
|
||
-fmax-simplifier-iterations=2
|
||
-- Insisting on export lists might help with compile times, and help to document modules:
|
||
-Wmissing-export-lists
|
||
|
||
if flag(developer)
|
||
cpp-options: -DDeveloperAPIs
|
||
if flag(profiling)
|
||
cpp-options: -DPROFILING
|
||
|
||
if flag(optimize-hasura)
|
||
ghc-options:
|
||
-- This is for performance, and works in combination with '-fspecialise-aggressively'
|
||
-- in the graphql-engine 'executable' stanza below, and in any other dependent
|
||
-- executables (See mono #2610):
|
||
-fexpose-all-unfoldings
|
||
-O2
|
||
else
|
||
-- we just want to build fast:
|
||
ghc-options: -O0
|
||
|
||
default-language: Haskell2010
|
||
default-extensions:
|
||
AllowAmbiguousTypes
|
||
BangPatterns
|
||
BlockArguments
|
||
ConstraintKinds
|
||
DataKinds
|
||
DefaultSignatures
|
||
DeriveDataTypeable
|
||
DeriveFoldable
|
||
DeriveFunctor
|
||
DeriveGeneric
|
||
DeriveLift
|
||
DeriveTraversable
|
||
DerivingVia
|
||
EmptyCase
|
||
ExistentialQuantification
|
||
FlexibleContexts
|
||
FlexibleInstances
|
||
FunctionalDependencies
|
||
GADTs
|
||
GeneralizedNewtypeDeriving
|
||
ImportQualifiedPost
|
||
InstanceSigs
|
||
LambdaCase
|
||
MultiParamTypeClasses
|
||
MultiWayIf
|
||
NamedFieldPuns
|
||
NoImplicitPrelude
|
||
OverloadedStrings
|
||
QuantifiedConstraints
|
||
QuasiQuotes
|
||
RankNTypes
|
||
RecordWildCards
|
||
RoleAnnotations
|
||
ScopedTypeVariables
|
||
StandaloneDeriving
|
||
StrictData
|
||
TemplateHaskell
|
||
TupleSections
|
||
TypeApplications
|
||
TypeFamilies
|
||
TypeFamilyDependencies
|
||
TypeOperators
|
||
|
||
common common-exe
|
||
ghc-options:
|
||
-threaded -rtsopts
|
||
-- `-I0` disables idle GC. We do this in application code now. See 'ourIdleGC' for details.
|
||
-- `-T` is required to collect the stats we use in 'ourIdleGC'.
|
||
--
|
||
-- `-qn2` limits the parallel GC to at most 2 capabilities. This came up in #3354/#3394, as the
|
||
-- parallel GC was causing significant performance overhead. Folks in #ghc on freenode advised
|
||
-- limiting the parallel GC to 2 or 3 capabilities as a very conservative choice, since more
|
||
-- than that is highly unlikely to ever be helpful. More benchmarking would be useful to know if
|
||
-- this is the right decision. It’s possible it would better to just turn it off completely.
|
||
--
|
||
-- `-kc8K` helps limit memory consumption in websockets (perhaps elsewhere) by making the
|
||
-- cost of a thread's first (and probably only) stack overflow less severe.
|
||
-- See:https://github.com/hasura/graphql-engine/issues/5190
|
||
--
|
||
-- `--disable-delayed-os-memory-return` seems to help lower reported residency, in particular
|
||
-- in situations where we seem to be dealing with haskell heap fragmentation. This is more a
|
||
-- workaround for limitations in monitoring tools than anything...
|
||
"-with-rtsopts=-N -I0 -T -qn2 -kc8K --disable-delayed-os-memory-return"
|
||
|
||
library
|
||
import: common-all
|
||
hs-source-dirs: src-lib
|
||
build-depends: Spock-core
|
||
, aeson
|
||
, aeson-casing
|
||
, attoparsec
|
||
, attoparsec-iso8601 >= 1.0
|
||
, base
|
||
, bytestring
|
||
, containers
|
||
, data-default
|
||
, deepseq
|
||
, dependent-map >=0.4 && <0.5
|
||
, dependent-sum
|
||
, either
|
||
, exceptions
|
||
, fast-logger
|
||
, hashable
|
||
, hashable-time
|
||
, http-client-tls
|
||
, http-conduit
|
||
, http-media
|
||
, http-types
|
||
, ip
|
||
, kan-extensions
|
||
, kriti-lang
|
||
, lifted-base
|
||
, monad-control
|
||
, monad-loops
|
||
, monad-validate
|
||
, mtl
|
||
, openapi3
|
||
, optparse-applicative
|
||
, optparse-generic
|
||
, parsec
|
||
, pg-client
|
||
, postgresql-binary
|
||
, postgresql-libpq
|
||
, pretty-simple
|
||
, process
|
||
, profunctors
|
||
, retry
|
||
, safe-exceptions
|
||
, scientific
|
||
, semialign
|
||
, some
|
||
, split
|
||
, template-haskell
|
||
, text
|
||
, text-builder >= 0.6
|
||
, these
|
||
, time >= 1.9
|
||
, transformers
|
||
, transformers-base
|
||
, unordered-containers >= 0.2.12
|
||
, url
|
||
, utf8-string
|
||
, validation
|
||
, vector
|
||
, vector-instances
|
||
, wai
|
||
, hashable-time
|
||
|
||
-- Encoder related
|
||
, uuid
|
||
, binary
|
||
, base16-bytestring
|
||
|
||
-- Logging related
|
||
, network
|
||
, network-bsd
|
||
, byteorder
|
||
|
||
-- for parsing RSA keys
|
||
, cryptonite
|
||
|
||
-- for jwt verification
|
||
, jose
|
||
, pem
|
||
, x509
|
||
, asn1-encoding
|
||
, asn1-types
|
||
|
||
-- Server related
|
||
, warp
|
||
, lens
|
||
|
||
-- GraphQL related
|
||
, graphql-parser >=0.2 && <0.3
|
||
|
||
-- URL parser related
|
||
, network-uri >=2.6.3.0 && <2.7
|
||
, uri-encode
|
||
|
||
-- String related
|
||
, case-insensitive
|
||
, text-conversions
|
||
|
||
-- Http client
|
||
, wreq
|
||
, http-client
|
||
|
||
-- ordered map
|
||
, insert-ordered-containers
|
||
|
||
-- Parsing SemVer
|
||
, semver
|
||
|
||
-- Templating
|
||
, mustache
|
||
, file-embed
|
||
, shakespeare >= 2.0.22
|
||
|
||
--
|
||
, data-has
|
||
-- for src-exec
|
||
, yaml
|
||
, template-haskell >= 2.11
|
||
|
||
-- websockets interface related
|
||
, websockets>=0.12
|
||
, stm
|
||
, stm-containers
|
||
, list-t
|
||
, async
|
||
, lifted-async
|
||
, immortal < 0.3
|
||
|
||
-- logging related
|
||
, base64-bytestring >= 1.0
|
||
, auto-update
|
||
|
||
-- regex related
|
||
, regex-tdfa >=1.3.1 && <1.4
|
||
|
||
-- pretty printer
|
||
, ansi-wl-pprint
|
||
|
||
-- for capturing various metrics
|
||
, ekg-core
|
||
, ekg-json
|
||
|
||
-- metrics for CI integration
|
||
, ci-info
|
||
|
||
-- serve static files
|
||
, filepath >= 1.4
|
||
, mime-types >= 0.1
|
||
|
||
-- for handling posix signals for graceful shutdown
|
||
, unix
|
||
-- HTTP compression
|
||
, zlib
|
||
|
||
-- caching
|
||
, psqueues >= 0.2
|
||
|
||
-- testing
|
||
, QuickCheck
|
||
, quickcheck-instances
|
||
|
||
, directory
|
||
|
||
, random
|
||
, mmorph
|
||
, http-api-data
|
||
, lens-aeson
|
||
|
||
, semigroups >= 0.19.1
|
||
|
||
-- scheduled triggers
|
||
, cron >= 0.6.2
|
||
-- needed for deriving via
|
||
, semigroups >= 0.19
|
||
|
||
-- mssql support
|
||
, odbc
|
||
, resource-pool
|
||
|
||
-- bigquery support
|
||
, memory
|
||
, x509-store
|
||
, connection
|
||
, tls
|
||
, x509-validation
|
||
, data-default-class
|
||
, x509-system
|
||
, tagged
|
||
-- mysql
|
||
, mysql
|
||
, mysql-simple
|
||
|
||
-- TODO(jkachmar): re-organize this before merging
|
||
-- dynamic backends stuff
|
||
, uri-bytestring
|
||
, witch
|
||
|
||
if !flag(profiling)
|
||
-- ghc-heap-view can't be built with profiling
|
||
build-depends: ghc-heap-view
|
||
|
||
exposed-modules: Control.Arrow.Extended
|
||
, Control.Arrow.Interpret
|
||
, Control.Arrow.Trans
|
||
, Control.Concurrent.Extended
|
||
, Control.Lens.Extended
|
||
, Control.Monad.Stateless
|
||
, Control.Monad.Trans.Managed
|
||
, Control.Monad.Unique
|
||
, Data.Aeson.Extended
|
||
, Data.Aeson.Ordered
|
||
, Data.Environment
|
||
, Data.HashMap.Strict.Extended
|
||
, Data.HashMap.Strict.InsOrd.Extended
|
||
, Data.List.Extended
|
||
, Data.Parser.CacheControl
|
||
, Data.Parser.Expires
|
||
, Data.Parser.JSONPath
|
||
, Data.Sequence.NonEmpty
|
||
, Data.SqlCommenter
|
||
, Data.TByteString
|
||
, Data.Text.Extended
|
||
, Data.Text.NonEmpty
|
||
, Data.Time.Clock.Units
|
||
, Data.URL.Template
|
||
, Database.MSSQL.Transaction
|
||
, Database.MSSQL.Pool
|
||
, GHC.AssertNF.CPP
|
||
, GHC.Stats.Extended
|
||
, Hasura.App
|
||
, Hasura.Metadata.Class
|
||
|
||
, Hasura.Base.Error
|
||
, Hasura.Base.Instances
|
||
|
||
, Hasura.Backends.BigQuery.Connection
|
||
, Hasura.Backends.BigQuery.Execute
|
||
, Hasura.Backends.BigQuery.DDL
|
||
, Hasura.Backends.BigQuery.DDL.BoolExp
|
||
, Hasura.Backends.BigQuery.DDL.RunSQL
|
||
, Hasura.Backends.BigQuery.DDL.Source
|
||
, Hasura.Backends.BigQuery.FromIr
|
||
, Hasura.Backends.BigQuery.Instances.API
|
||
, Hasura.Backends.BigQuery.Instances.Execute
|
||
, Hasura.Backends.BigQuery.Instances.Schema
|
||
, Hasura.Backends.BigQuery.Instances.Transport
|
||
, Hasura.Backends.BigQuery.Instances.Types
|
||
, Hasura.Backends.BigQuery.Instances.Metadata
|
||
, Hasura.Backends.BigQuery.Meta
|
||
, Hasura.Backends.BigQuery.Plan
|
||
, Hasura.Backends.BigQuery.Source
|
||
, Hasura.Backends.BigQuery.ToQuery
|
||
, Hasura.Backends.BigQuery.Types
|
||
|
||
, Hasura.Backends.MSSQL.Connection
|
||
, Hasura.Backends.MSSQL.DDL
|
||
, Hasura.Backends.MSSQL.DDL.BoolExp
|
||
, Hasura.Backends.MSSQL.DDL.RunSQL
|
||
, Hasura.Backends.MSSQL.DDL.Source
|
||
, Hasura.Backends.MSSQL.DDL.Source.Version
|
||
, Hasura.Backends.MSSQL.Execute.MutationResponse
|
||
, Hasura.Backends.MSSQL.Execute.Delete
|
||
, Hasura.Backends.MSSQL.Execute.Insert
|
||
, Hasura.Backends.MSSQL.Execute.Update
|
||
, Hasura.Backends.MSSQL.FromIr
|
||
, Hasura.Backends.MSSQL.Instances.API
|
||
, Hasura.Backends.MSSQL.Instances.Execute
|
||
, Hasura.Backends.MSSQL.Instances.Metadata
|
||
, Hasura.Backends.MSSQL.Instances.Schema
|
||
, Hasura.Backends.MSSQL.Instances.Transport
|
||
, Hasura.Backends.MSSQL.Instances.Types
|
||
, Hasura.Backends.MSSQL.Meta
|
||
, Hasura.Backends.MSSQL.Plan
|
||
, Hasura.Backends.MSSQL.Schema.IfMatched
|
||
, Hasura.Backends.MSSQL.SQL.Value
|
||
, Hasura.Backends.MSSQL.SQL.Error
|
||
, Hasura.Backends.MSSQL.ToQuery
|
||
, Hasura.Backends.MSSQL.Types
|
||
, Hasura.Backends.MSSQL.Types.Insert
|
||
, Hasura.Backends.MSSQL.Types.Instances
|
||
, Hasura.Backends.MSSQL.Types.Internal
|
||
, Hasura.Backends.MSSQL.Types.Update
|
||
|
||
, Hasura.Backends.Postgres.Connection
|
||
, Hasura.Backends.Postgres.DDL
|
||
, Hasura.Backends.Postgres.DDL.BoolExp
|
||
, Hasura.Backends.Postgres.DDL.ComputedField
|
||
, Hasura.Backends.Postgres.DDL.EventTrigger
|
||
, Hasura.Backends.Postgres.DDL.Function
|
||
, Hasura.Backends.Postgres.DDL.RunSQL
|
||
, Hasura.Backends.Postgres.DDL.Source
|
||
, Hasura.Backends.Postgres.DDL.Source.Version
|
||
, Hasura.Backends.Postgres.DDL.Table
|
||
, Hasura.Backends.Postgres.Execute.LiveQuery
|
||
, Hasura.Backends.Postgres.Execute.Insert
|
||
, Hasura.Backends.Postgres.Execute.Mutation
|
||
, Hasura.Backends.Postgres.Execute.Prepare
|
||
, Hasura.Backends.Postgres.Execute.Types
|
||
, Hasura.Backends.Postgres.Instances.API
|
||
, Hasura.Backends.Postgres.Instances.Execute
|
||
, Hasura.Backends.Postgres.Instances.Metadata
|
||
, Hasura.Backends.Postgres.Instances.Schema
|
||
, Hasura.Backends.Postgres.Instances.Transport
|
||
, Hasura.Backends.Postgres.Instances.Types
|
||
, Hasura.Backends.Postgres.Schema.OnConflict
|
||
, Hasura.Backends.Postgres.SQL.DML
|
||
, Hasura.Backends.Postgres.SQL.Error
|
||
, Hasura.Backends.Postgres.SQL.IdentifierUniqueness
|
||
, Hasura.Backends.Postgres.SQL.Types
|
||
, Hasura.Backends.Postgres.SQL.Value
|
||
, Hasura.Backends.Postgres.Translate.BoolExp
|
||
, Hasura.Backends.Postgres.Translate.Column
|
||
, Hasura.Backends.Postgres.Translate.Delete
|
||
, Hasura.Backends.Postgres.Translate.Insert
|
||
, Hasura.Backends.Postgres.Translate.Mutation
|
||
, Hasura.Backends.Postgres.Translate.Returning
|
||
, Hasura.Backends.Postgres.Translate.Select
|
||
, Hasura.Backends.Postgres.Translate.Types
|
||
, Hasura.Backends.Postgres.Translate.Update
|
||
, Hasura.Backends.Postgres.Types.BoolExp
|
||
, Hasura.Backends.Postgres.Types.CitusExtraTableMetadata
|
||
, Hasura.Backends.Postgres.Types.Column
|
||
, Hasura.Backends.Postgres.Types.Insert
|
||
, Hasura.Backends.Postgres.Types.Table
|
||
, Hasura.Backends.Postgres.Types.Update
|
||
|
||
, Hasura.Backends.MySQL.DataLoader.Execute
|
||
, Hasura.Backends.MySQL.DataLoader.Plan
|
||
, Hasura.Backends.MySQL.Types
|
||
, Hasura.Backends.MySQL.Types.Internal
|
||
, Hasura.Backends.MySQL.Types.Instances
|
||
, Hasura.Backends.MySQL.Plan
|
||
, Hasura.Backends.MySQL.FromIr
|
||
, Hasura.Backends.MySQL.Connection
|
||
, Hasura.Backends.MySQL.Meta
|
||
, Hasura.Backends.MySQL.Instances.Types
|
||
, Hasura.Backends.MySQL.Instances.Metadata
|
||
, Hasura.Backends.MySQL.Instances.Schema
|
||
, Hasura.Backends.MySQL.Instances.Execute
|
||
, Hasura.Backends.MySQL.Instances.Transport
|
||
, Hasura.Backends.MySQL.SQL
|
||
, Hasura.Backends.MySQL.ToQuery
|
||
, Hasura.Backends.MySQL.Instances.API
|
||
|
||
-- XXX(jkachmar): This needs to be renamed before we
|
||
-- stabilize it.
|
||
, Hasura.Experimental.Adapter.API
|
||
, Hasura.Experimental.Adapter.Backend
|
||
, Hasura.Experimental.Adapter.Execute
|
||
, Hasura.Experimental.Adapter.Metadata
|
||
, Hasura.Experimental.Adapter.Schema
|
||
, Hasura.Experimental.Adapter.Transport
|
||
, Hasura.Experimental.IR.Column
|
||
, Hasura.Experimental.IR.Expression
|
||
, Hasura.Experimental.IR.Function
|
||
, Hasura.Experimental.IR.Name
|
||
, Hasura.Experimental.IR.OrderBy
|
||
, Hasura.Experimental.IR.Query
|
||
, Hasura.Experimental.IR.Scalar.Type
|
||
, Hasura.Experimental.IR.Scalar.Value
|
||
, Hasura.Experimental.IR.Table
|
||
, Hasura.Experimental.Schema.Column
|
||
, Hasura.Experimental.Schema.Table
|
||
|
||
-- Exposed for benchmark:
|
||
, Hasura.Cache.Bounded
|
||
, Hasura.Logging
|
||
, Hasura.HTTP
|
||
, Hasura.Incremental
|
||
, Hasura.Server.App
|
||
, Hasura.Server.Auth
|
||
, Hasura.Server.Init
|
||
, Hasura.Server.Init.Config
|
||
, Hasura.Server.API.Backend
|
||
, Hasura.Server.API.Instances
|
||
, Hasura.Server.API.Metadata
|
||
, Hasura.Server.API.Query
|
||
, Hasura.Server.API.V2Query
|
||
, Hasura.Server.Utils
|
||
, Hasura.Server.Version
|
||
, Hasura.Server.Limits
|
||
, Hasura.Server.Logging
|
||
, Hasura.Server.Migrate
|
||
, Hasura.Server.Compression
|
||
, Hasura.Server.Types
|
||
, Hasura.Server.API.PGDump
|
||
, Hasura.Server.Rest
|
||
, Hasura.Server.OpenAPI
|
||
, Hasura.Prelude
|
||
|
||
, Hasura.EncJSON
|
||
, Hasura.GraphQL.Execute.Query
|
||
, Hasura.GraphQL.Logging
|
||
, Hasura.Incremental.Select
|
||
, Hasura.RQL.DML.Select
|
||
, Hasura.RQL.Types.Run
|
||
, Hasura.Session
|
||
|
||
, Hasura.Server.API.Config
|
||
, Hasura.Server.Telemetry
|
||
, Hasura.Server.Metrics
|
||
, Hasura.Server.Telemetry.Counters
|
||
, Hasura.Server.Auth.JWT
|
||
, Hasura.GC
|
||
, Hasura.Incremental.Internal.Cache
|
||
, Hasura.Incremental.Internal.Dependency
|
||
, Hasura.Incremental.Internal.Rule
|
||
, Hasura.Server.Auth.WebHook
|
||
, Hasura.Server.Middleware
|
||
, Hasura.Server.Cors
|
||
, Hasura.Server.CheckUpdates
|
||
, Hasura.Server.SchemaUpdate
|
||
, Hasura.Server.Migrate.Version
|
||
, Hasura.Server.Migrate.Internal
|
||
, Hasura.Server.Auth.JWT.Internal
|
||
, Hasura.Server.Auth.JWT.Logging
|
||
, Hasura.RQL.Types
|
||
, Hasura.RQL.Types.Action
|
||
, Hasura.RQL.Types.Allowlist
|
||
, Hasura.RQL.Types.ApiLimit
|
||
, Hasura.RQL.Types.Backend
|
||
, Hasura.RQL.Types.Column
|
||
, Hasura.RQL.Types.Common
|
||
, Hasura.RQL.Types.ComputedField
|
||
, Hasura.RQL.Types.CustomTypes
|
||
, Hasura.RQL.Types.Endpoint
|
||
, Hasura.RQL.Types.Endpoint.Trie
|
||
, Hasura.RQL.Types.EventTrigger
|
||
, Hasura.RQL.Types.Eventing
|
||
, Hasura.RQL.Types.Eventing.Backend
|
||
, Hasura.RQL.Types.GraphqlSchemaIntrospection
|
||
, Hasura.RQL.Types.Function
|
||
, Hasura.RQL.Types.Instances
|
||
, Hasura.RQL.Types.Metadata
|
||
, Hasura.RQL.Types.Metadata.Backend
|
||
, Hasura.RQL.Types.Metadata.Instances
|
||
, Hasura.RQL.Types.Metadata.Object
|
||
, Hasura.RQL.Types.Network
|
||
, Hasura.RQL.Types.Permission
|
||
, Hasura.RQL.Types.QueryCollection
|
||
, Hasura.RQL.Types.QueryTags
|
||
, Hasura.RQL.Types.Relationships.Local
|
||
, Hasura.RQL.Types.Relationships.Remote
|
||
, Hasura.RQL.Types.Relationships.ToSchema
|
||
, Hasura.RQL.Types.Relationships.ToSource
|
||
, Hasura.RQL.Types.RemoteSchema
|
||
, Hasura.RQL.Types.ResultCustomization
|
||
, Hasura.RQL.Types.ScheduledTrigger
|
||
, Hasura.RQL.Types.SchemaCache
|
||
, Hasura.RQL.Types.SchemaCache.Build
|
||
, Hasura.RQL.Types.SchemaCacheTypes
|
||
, Hasura.RQL.Types.Source
|
||
, Hasura.RQL.Types.SourceCustomization
|
||
, Hasura.RQL.Types.Table
|
||
, Hasura.RQL.Types.Roles
|
||
, Hasura.RQL.Types.Roles.Internal
|
||
, Hasura.RQL.DDL.Action
|
||
, Hasura.RQL.DDL.ApiLimit
|
||
, Hasura.RQL.DDL.ComputedField
|
||
, Hasura.RQL.DDL.CustomTypes
|
||
, Hasura.RQL.DDL.Endpoint
|
||
, Hasura.RQL.DDL.GraphqlSchemaIntrospection
|
||
, Hasura.RQL.DDL.InheritedRoles
|
||
, Hasura.RQL.DDL.Headers
|
||
, Hasura.RQL.DDL.Metadata
|
||
, Hasura.RQL.DDL.Metadata.Types
|
||
, Hasura.RQL.DDL.Permission
|
||
, Hasura.RQL.DDL.Permission.Internal
|
||
, Hasura.RQL.DDL.QueryCollection
|
||
, Hasura.RQL.DDL.QueryTags
|
||
, Hasura.RQL.DDL.Relationship
|
||
, Hasura.RQL.DDL.Relationship.Rename
|
||
, Hasura.RQL.DDL.RemoteRelationship
|
||
, Hasura.RQL.DDL.RemoteRelationship.Validate
|
||
, Hasura.RQL.DDL.RemoteSchema
|
||
, Hasura.RQL.DDL.RemoteSchema.Permission
|
||
, Hasura.RQL.DDL.WebhookTransforms
|
||
, Hasura.RQL.DDL.Schema
|
||
, Hasura.RQL.DDL.Schema.Cache
|
||
, Hasura.RQL.DDL.Schema.Cache.Common
|
||
, Hasura.RQL.DDL.Schema.Cache.Dependencies
|
||
, Hasura.RQL.DDL.Schema.Cache.Fields
|
||
, Hasura.RQL.DDL.Schema.Cache.Permission
|
||
, Hasura.RQL.DDL.Schema.Catalog
|
||
, Hasura.RQL.DDL.Schema.Diff
|
||
, Hasura.RQL.DDL.Schema.LegacyCatalog
|
||
, Hasura.RQL.DDL.Schema.Enum
|
||
, Hasura.RQL.DDL.Schema.Function
|
||
, Hasura.RQL.DDL.Schema.Rename
|
||
, Hasura.RQL.DDL.Schema.Table
|
||
, Hasura.RQL.DDL.Schema.Source
|
||
, Hasura.RQL.DDL.EventTrigger
|
||
, Hasura.RQL.DDL.ScheduledTrigger
|
||
, Hasura.RQL.DDL.Network
|
||
, Hasura.RQL.DML.Count
|
||
, Hasura.RQL.DML.Delete
|
||
, Hasura.RQL.DML.Insert
|
||
, Hasura.RQL.DML.Internal
|
||
, Hasura.RQL.DML.Update
|
||
, Hasura.RQL.DML.Types
|
||
, Hasura.RQL.IR.BoolExp
|
||
, Hasura.RQL.IR.Conflict
|
||
, Hasura.RQL.IR.Delete
|
||
, Hasura.RQL.IR.Insert
|
||
, Hasura.RQL.IR.OrderBy
|
||
, Hasura.RQL.IR.Returning
|
||
, Hasura.RQL.IR.Select
|
||
, Hasura.RQL.IR.RemoteSchema
|
||
, Hasura.RQL.IR.Update
|
||
, Hasura.RQL.IR.Root
|
||
, Hasura.RQL.IR
|
||
, Hasura.GraphQL.Analyse
|
||
, Hasura.GraphQL.Context
|
||
, Hasura.GraphQL.Execute
|
||
, Hasura.GraphQL.Execute.Action
|
||
, Hasura.GraphQL.Execute.Action.Subscription
|
||
, Hasura.GraphQL.Execute.Action.Types
|
||
, Hasura.GraphQL.Execute.Backend
|
||
, Hasura.GraphQL.Execute.Common
|
||
, Hasura.GraphQL.Execute.Inline
|
||
, Hasura.GraphQL.Execute.Instances
|
||
, Hasura.GraphQL.Execute.LiveQuery.Options
|
||
, Hasura.GraphQL.Execute.LiveQuery.Plan
|
||
, Hasura.GraphQL.Execute.LiveQuery.Poll
|
||
, Hasura.GraphQL.Execute.LiveQuery.State
|
||
, Hasura.GraphQL.Execute.LiveQuery.TMap
|
||
, Hasura.GraphQL.Execute.Mutation
|
||
, Hasura.GraphQL.Execute.Remote
|
||
, Hasura.GraphQL.Execute.RemoteJoin
|
||
, Hasura.GraphQL.Execute.RemoteJoin.Types
|
||
, Hasura.GraphQL.Execute.RemoteJoin.Collect
|
||
, Hasura.GraphQL.Execute.RemoteJoin.Join
|
||
, Hasura.GraphQL.Execute.RemoteJoin.RemoteSchema
|
||
, Hasura.GraphQL.Execute.Resolve
|
||
, Hasura.GraphQL.Execute.Types
|
||
, Hasura.GraphQL.Explain
|
||
, Hasura.GraphQL.Namespace
|
||
, Hasura.GraphQL.ParameterizedQueryHash
|
||
, Hasura.GraphQL.Parser
|
||
, Hasura.GraphQL.Parser.Class
|
||
, Hasura.GraphQL.Parser.Class.Parse
|
||
, Hasura.GraphQL.Parser.Collect
|
||
, Hasura.GraphQL.Parser.Column
|
||
, Hasura.GraphQL.Parser.Directives
|
||
, Hasura.GraphQL.Parser.Internal.Convert
|
||
, Hasura.GraphQL.Parser.Internal.Input
|
||
, Hasura.GraphQL.Parser.Internal.Parser
|
||
, Hasura.GraphQL.Parser.Internal.Scalars
|
||
, Hasura.GraphQL.Parser.Internal.TypeChecking
|
||
, Hasura.GraphQL.Parser.Internal.Types
|
||
, Hasura.GraphQL.Parser.Monad
|
||
, Hasura.GraphQL.Parser.Schema
|
||
, Hasura.GraphQL.RemoteServer
|
||
, Hasura.GraphQL.Schema
|
||
, Hasura.GraphQL.Schema.Action
|
||
, Hasura.GraphQL.Schema.Backend
|
||
, Hasura.GraphQL.Schema.BoolExp
|
||
, Hasura.GraphQL.Schema.Build
|
||
, Hasura.GraphQL.Schema.Common
|
||
, Hasura.GraphQL.Schema.Introspect
|
||
, Hasura.GraphQL.Schema.Instances
|
||
, Hasura.GraphQL.Schema.Mutation
|
||
, Hasura.GraphQL.Schema.OrderBy
|
||
, Hasura.GraphQL.Schema.Postgres
|
||
, Hasura.GraphQL.Schema.Remote
|
||
, Hasura.GraphQL.Schema.RemoteRelationship
|
||
, Hasura.GraphQL.Schema.Select
|
||
, Hasura.GraphQL.Schema.Table
|
||
, Hasura.GraphQL.Schema.Update
|
||
, Hasura.GraphQL.Transport.Backend
|
||
, Hasura.GraphQL.Transport.HTTP
|
||
, Hasura.GraphQL.Transport.HTTP.Protocol
|
||
, Hasura.GraphQL.Transport.Instances
|
||
, Hasura.GraphQL.Transport.WSServerApp
|
||
, Hasura.GraphQL.Transport.WebSocket
|
||
, Hasura.GraphQL.Transport.WebSocket.Types
|
||
, Hasura.GraphQL.Transport.WebSocket.Protocol
|
||
, Hasura.GraphQL.Transport.WebSocket.Server
|
||
|
||
, Hasura.Eventing.Common
|
||
, Hasura.Eventing.EventTrigger
|
||
, Hasura.Eventing.HTTP
|
||
, Hasura.Eventing.ScheduledTrigger
|
||
, Hasura.Eventing.ScheduledTrigger.Types
|
||
, Data.GADT.Compare.Extended
|
||
, Data.Tuple.Extended
|
||
, Hasura.SQL.AnyBackend
|
||
, Hasura.SQL.Backend
|
||
, Hasura.SQL.TH
|
||
, Hasura.SQL.Tag
|
||
, Hasura.SQL.GeoJSON
|
||
, Hasura.SQL.Time
|
||
, Hasura.SQL.Types
|
||
, Hasura.SQL.Value
|
||
, Hasura.SQL.WKT
|
||
, Hasura.Tracing
|
||
, Hasura.QueryTags
|
||
, Network.HTTP.Client.Transformable
|
||
, Network.HTTP.Client.Manager
|
||
, Network.HTTP.Client.DynamicTlsPermissions
|
||
, Network.HTTP.Client.Restricted
|
||
, Network.HTTP.Client.Blocklisting
|
||
, Network.HTTP.Client.CreateManager
|
||
, Network.URI.Extended
|
||
, Network.Wai.Extended
|
||
, Network.Wai.Handler.WebSockets.Custom
|
||
|
||
|
||
executable graphql-engine
|
||
import: common-all, common-exe
|
||
|
||
if flag(optimize-hasura)
|
||
ghc-options:
|
||
-- This is for performance (See mono #2610):
|
||
-fspecialise-aggressively
|
||
|
||
hs-source-dirs: src-exec
|
||
main-is: Main.hs
|
||
build-depends: base
|
||
, graphql-engine
|
||
, bytestring
|
||
, kan-extensions
|
||
, pg-client
|
||
, text
|
||
, text-conversions
|
||
, time
|
||
, unix
|
||
, ekg-core
|
||
|
||
test-suite graphql-engine-integration-tests
|
||
import: common-all, common-exe
|
||
type: exitcode-stdio-1.0
|
||
build-tool-depends: hspec-discover:hspec-discover
|
||
build-depends:
|
||
graphql-engine
|
||
, base
|
||
, aeson
|
||
, aeson-qq
|
||
, bytestring
|
||
, ekg-core
|
||
, exceptions
|
||
, hedgehog
|
||
, hspec >=2.8.3 && <3
|
||
, hspec-core >=2.8.3 && <3
|
||
, hspec-discover >=2.8.3 && <3
|
||
, hspec-expectations
|
||
, hspec-wai
|
||
, hspec-wai-json
|
||
, http-types
|
||
, lens
|
||
, monad-control
|
||
, mtl
|
||
, optparse-applicative
|
||
, pg-client
|
||
, shakespeare
|
||
, template-haskell
|
||
, text
|
||
, time
|
||
, tmp-postgres
|
||
, transformers
|
||
, unordered-containers
|
||
, wai
|
||
, wai-extra
|
||
hs-source-dirs: tests/integration
|
||
main-is: Main.hs
|
||
other-modules:
|
||
Backend.Postgres
|
||
Hasura.Test.App
|
||
Hasura.Test.Requests
|
||
Tests.RemoteSourceSpec
|
||
Tests.RemoteSourceSql
|
||
|
||
test-suite graphql-engine-tests
|
||
import: common-all, common-exe
|
||
type: exitcode-stdio-1.0
|
||
build-depends:
|
||
aeson
|
||
, base
|
||
, bytestring
|
||
, case-insensitive
|
||
, containers
|
||
, cron
|
||
, dependent-map
|
||
, dependent-sum
|
||
, graphql-engine
|
||
, graphql-parser
|
||
, hedgehog
|
||
, hspec >=2.8.3 && <3
|
||
, hspec-core >=2.8.3 && <3
|
||
, hspec-expectations
|
||
, hspec-expectations-lifted
|
||
, hspec-hedgehog
|
||
, http-client
|
||
, http-client-tls
|
||
, http-types
|
||
, insert-ordered-containers
|
||
, jose
|
||
, kan-extensions
|
||
, lens
|
||
, lens-aeson
|
||
, lifted-base
|
||
, mmorph
|
||
, monad-control
|
||
, mtl
|
||
, natural-transformation >=0.4 && <0.5
|
||
, network-uri
|
||
, optparse-applicative
|
||
, pg-client
|
||
, process
|
||
, QuickCheck
|
||
, safe
|
||
, scientific
|
||
, split
|
||
, stm
|
||
, template-haskell
|
||
, text
|
||
, time
|
||
, transformers
|
||
, transformers-base
|
||
, unordered-containers
|
||
, utf8-string
|
||
, vector
|
||
, yaml
|
||
-- mssql support
|
||
, odbc
|
||
, resource-pool
|
||
hs-source-dirs: src-test
|
||
main-is: Main.hs
|
||
other-modules:
|
||
Data.HashMap.Strict.ExtendedSpec
|
||
Data.NonNegativeIntSpec
|
||
Data.Parser.CacheControlSpec
|
||
Data.Parser.JSONPathSpec
|
||
Data.Parser.URLTemplate
|
||
Data.Text.RawString
|
||
Data.TimeSpec
|
||
Database.MSSQL.TransactionSpec
|
||
Hasura.Backends.MySQL.DataLoader.ExecuteTests
|
||
Hasura.Backends.MSSQL.ErrorSpec
|
||
Hasura.EventingSpec
|
||
Hasura.Generator.Common
|
||
Hasura.GraphQL.NamespaceSpec
|
||
Hasura.GraphQL.Parser.DirectivesTest
|
||
Hasura.GraphQL.Parser.TestUtils
|
||
Hasura.GraphQL.Schema.RemoteTest
|
||
Hasura.QuickCheck.Instances
|
||
Hasura.IncrementalSpec
|
||
Hasura.RQL.IR.Generator
|
||
Hasura.RQL.MetadataSpec
|
||
Hasura.RQL.IR.Postgres
|
||
Hasura.RQL.PermissionSpec
|
||
Hasura.RQL.WebhookTransformsSpec
|
||
Hasura.RQL.Types.AllowlistSpec
|
||
Hasura.RQL.Types.CommonSpec
|
||
Hasura.RQL.Types.EndpointSpec
|
||
Hasura.Server.Auth.JWTSpec
|
||
Hasura.Server.AuthSpec
|
||
Hasura.Server.MigrateSpec
|
||
Hasura.Server.TelemetrySpec
|
||
Hasura.SessionSpec
|
||
Hasura.SQL.WKTSpec
|
||
Network.HTTP.Client.TransformableSpec
|
||
Test.QuickCheck.Extended
|
||
|
||
test-suite tests-hspec
|
||
import: common-all, common-exe
|
||
type: exitcode-stdio-1.0
|
||
build-tool-depends: hspec-discover:hspec-discover
|
||
build-depends:
|
||
QuickCheck
|
||
, Spock-core
|
||
, aeson
|
||
, aeson-casing
|
||
, aeson-qq
|
||
, async
|
||
, base
|
||
, bytestring
|
||
, case-insensitive
|
||
, conduit
|
||
, containers
|
||
, cron
|
||
, dependent-map
|
||
, dependent-sum
|
||
, ekg-core
|
||
, graphql-engine
|
||
, graphql-parser
|
||
, haskell-src-meta
|
||
, hedgehog
|
||
, hspec
|
||
, hspec >=2.8.3 && <3
|
||
, hspec-core >=2.8.3 && <3
|
||
, hspec-discover >=2.8.3 && <3
|
||
, hspec-expectations
|
||
, hspec-expectations-lifted
|
||
, hspec-hedgehog
|
||
, http-client
|
||
, http-client-tls
|
||
, http-conduit
|
||
, http-types
|
||
, insert-ordered-containers
|
||
, jose
|
||
, kan-extensions
|
||
, lens
|
||
, lens-aeson
|
||
, libyaml
|
||
, lifted-base
|
||
, mmorph
|
||
, monad-control
|
||
, monad-logger
|
||
, morpheus-graphql
|
||
, mtl
|
||
, mysql
|
||
, mysql-simple
|
||
, natural-transformation >=0.4 && <0.5
|
||
, network
|
||
, network-uri
|
||
, odbc
|
||
, optparse-applicative
|
||
, parsec
|
||
, pg-client
|
||
, postgresql-libpq
|
||
, postgresql-simple
|
||
, process
|
||
, resource-pool
|
||
, resourcet
|
||
, safe
|
||
, safe-exceptions
|
||
, scientific
|
||
, split
|
||
, stm
|
||
, template-haskell
|
||
, text
|
||
, text-conversions
|
||
, th-lift
|
||
, th-lift-instances
|
||
, time
|
||
, transformers-base
|
||
, typed-process
|
||
, unix
|
||
, unliftio-core
|
||
, unordered-containers
|
||
, utf8-string
|
||
, vector
|
||
, warp
|
||
, websockets
|
||
, yaml
|
||
hs-source-dirs: tests-hspec
|
||
-- Turning off optimizations is intentional; tests aren't
|
||
-- performance sensitive and waiting for compilation is a problem.
|
||
ghc-options: -Wall -O0 -threaded
|
||
main-is: Spec.hs
|
||
other-modules:
|
||
SpecHook
|
||
|
||
-- Harness
|
||
Harness.Constants
|
||
Harness.Env
|
||
Harness.Exceptions
|
||
Harness.GraphqlEngine
|
||
Harness.Http
|
||
Harness.RemoteServer
|
||
Harness.State
|
||
|
||
-- Harness.Backend
|
||
Harness.Backend.BigQuery
|
||
Harness.Backend.Citus
|
||
Harness.Backend.Mysql
|
||
Harness.Backend.Postgres
|
||
Harness.Backend.Sqlserver
|
||
|
||
-- Harness.Test
|
||
Harness.Test.Context
|
||
|
||
-- Harness.Quoter
|
||
Harness.Quoter.Graphql
|
||
Harness.Quoter.Sql
|
||
Harness.Quoter.Yaml
|
||
|
||
-- Test
|
||
Test.ArrayRelationshipsSpec
|
||
Test.BasicFieldsSpec
|
||
Test.DirectivesSpec
|
||
Test.HelloWorldSpec
|
||
Test.LimitOffsetSpec
|
||
Test.NestedRelationshipsSpec
|
||
Test.ObjectRelationshipsLimitSpec
|
||
Test.ObjectRelationshipsSpec
|
||
Test.OrderingSpec
|
||
Test.RemoteRelationship.XToDBArrayRelationshipSpec
|
||
Test.RemoteRelationship.XToDBObjectRelationshipSpec
|
||
Test.RemoteRelationship.XToRemoteSchemaRelationshipSpec
|
||
Test.RequestHeadersSpec
|
||
Test.ServiceLivenessSpec
|
||
Test.ViewsSpec
|
||
Test.WhereSpec
|