graphql-engine/server/graphql-engine.cabal

411 lines
14 KiB
Plaintext
Raw Normal View History

2018-06-27 16:11:32 +03:00
name: graphql-engine
version: 1.0.0
synopsis: GraphQL API over Postgres
-- description:
homepage: https://www.hasura.io
license: Apache-2.0
2018-07-10 18:27:20 +03:00
-- license-file: LICENSE.md
2018-06-27 16:11:32 +03:00
author: Vamshi Surabhi
maintainer: vamshi@hasura.io
copyright: Hasura Inc.
2018-06-27 16:11:32 +03:00
category: Database
build-type: Simple
-- extra-source-files: README.md
cabal-version: >=1.10
source-repository head
type: git
location: https://github.com/hasura/graphql-engine
flag developer
description: operate in developer mode
default: False
manual: True
2019-04-17 12:48:41 +03:00
flag profile
description: compile with profile options set
default: False
manual: True
2018-06-27 16:11:32 +03:00
library
hs-source-dirs: src-lib
default-language: Haskell2010
build-depends: base
, pg-client
, text
, text-builder >= 0.6
2018-06-27 16:11:32 +03:00
, bytestring
, postgresql-libpq
, mtl
, aeson
, aeson-casing
, unordered-containers
, template-haskell
, hashable
, transformers
, transformers-base
, http-types
, attoparsec
, attoparsec-iso8601 >= 1.0
2018-06-27 16:11:32 +03:00
, time
, scientific
, Spock-core
, split
, optparse-applicative
, containers
, monad-control
add support for jwt authorization (close #186) (#255) The API: 1. HGE has `--jwt-secret` flag or `HASURA_GRAPHQL_JWT_SECRET` env var. The value of which is a JSON. 2. The structure of this JSON is: `{"type": "<standard-JWT-algorithms>", "key": "<the-key>"}` `type` : Standard JWT algos : `HS256`, `RS256`, `RS512` etc. (see jwt.io). `key`: i. Incase of symmetric key, the key as it is. ii. Incase of asymmetric keys, only the public key, in a PEM encoded string or as a X509 certificate. 3. The claims in the JWT token must contain the following: i. `x-hasura-default-role` field: default role of that user ii. `x-hasura-allowed-roles` : A list of allowed roles for the user. The default role is overriden by `x-hasura-role` header. 4. The claims in the JWT token, can have other `x-hasura-*` fields where their values can only be strings. 5. The JWT tokens are sent as `Authorization: Bearer <token>` headers. --- To test: 1. Generate a shared secret (for HMAC-SHA256) or RSA key pair. 2. Goto https://jwt.io/ , add the keys 3. Edit the claims to have `x-hasura-role` (mandatory) and other `x-hasura-*` fields. Add permissions related to the claims to test permissions. 4. Start HGE with `--jwt-secret` flag or `HASURA_GRAPHQL_JWT_SECRET` env var, which takes a JSON string: `{"type": "HS256", "key": "mylongsharedsecret"}` or `{"type":"RS256", "key": "<PEM-encoded-public-key>"}` 5. Copy the JWT token from jwt.io and use it in the `Authorization: Bearer <token>` header. --- TODO: Support EC public keys. It is blocked on frasertweedale/hs-jose#61
2018-08-30 13:32:09 +03:00
, monad-time
, monad-validate
2018-06-27 16:11:32 +03:00
, fast-logger
, wai
, postgresql-binary
, process
2018-06-27 16:11:32 +03:00
-- Encoder related
, uuid
, vector
-- Logging related
, network
, byteorder
-- for parsing RSA keys
2018-06-27 16:11:32 +03:00
, cryptonite
add support for jwt authorization (close #186) (#255) The API: 1. HGE has `--jwt-secret` flag or `HASURA_GRAPHQL_JWT_SECRET` env var. The value of which is a JSON. 2. The structure of this JSON is: `{"type": "<standard-JWT-algorithms>", "key": "<the-key>"}` `type` : Standard JWT algos : `HS256`, `RS256`, `RS512` etc. (see jwt.io). `key`: i. Incase of symmetric key, the key as it is. ii. Incase of asymmetric keys, only the public key, in a PEM encoded string or as a X509 certificate. 3. The claims in the JWT token must contain the following: i. `x-hasura-default-role` field: default role of that user ii. `x-hasura-allowed-roles` : A list of allowed roles for the user. The default role is overriden by `x-hasura-role` header. 4. The claims in the JWT token, can have other `x-hasura-*` fields where their values can only be strings. 5. The JWT tokens are sent as `Authorization: Bearer <token>` headers. --- To test: 1. Generate a shared secret (for HMAC-SHA256) or RSA key pair. 2. Goto https://jwt.io/ , add the keys 3. Edit the claims to have `x-hasura-role` (mandatory) and other `x-hasura-*` fields. Add permissions related to the claims to test permissions. 4. Start HGE with `--jwt-secret` flag or `HASURA_GRAPHQL_JWT_SECRET` env var, which takes a JSON string: `{"type": "HS256", "key": "mylongsharedsecret"}` or `{"type":"RS256", "key": "<PEM-encoded-public-key>"}` 5. Copy the JWT token from jwt.io and use it in the `Authorization: Bearer <token>` header. --- TODO: Support EC public keys. It is blocked on frasertweedale/hs-jose#61
2018-08-30 13:32:09 +03:00
-- for jwt verification
, jose
, pem
, x509
, asn1-encoding
, asn1-types
2018-06-27 16:11:32 +03:00
-- Server related
, warp
, th-lift-instances
, lens
-- GraphQL related
, graphql-parser
-- URL parser related
, network-uri
-- String related
, case-insensitive
, string-conversions
, text-conversions
2018-06-27 16:11:32 +03:00
-- Http client
, wreq
, http-client
-- ordered map
, insert-ordered-containers
-- Parsing SemVer
, semver
-- Templating
, mustache
2018-09-05 14:26:46 +03:00
, file-embed
, shakespeare >= 2.0.22
2018-06-27 16:11:32 +03:00
--
, data-has
-- for src-exec
, yaml
, template-haskell >= 2.11
2018-06-27 16:11:32 +03:00
-- websockets interface related
, websockets
, wai-websockets
, stm
, stm-containers
, list-t
, async
-- logging related
, base64-bytestring >= 1.0
, auto-update
-- regex related
, regex-tdfa >= 1.2
-- pretty printer
, ansi-wl-pprint
-- for capturing various metrics
2019-04-17 12:48:41 +03:00
, ekg-core
, ekg-json
2019-04-17 12:48:41 +03:00
-- metrics for CI integration
, ci-info
-- serve static files
, filepath >= 1.4
, mime-types >= 0.1
-- HTTP compression
, zlib
exposed-modules: Hasura.Prelude
, Hasura.Logging
, Hasura.EncJSON
2019-04-17 12:48:41 +03:00
, Hasura.Db
, Hasura.Cache
, Hasura.Server.App
, Hasura.Server.Auth
add support for jwt authorization (close #186) (#255) The API: 1. HGE has `--jwt-secret` flag or `HASURA_GRAPHQL_JWT_SECRET` env var. The value of which is a JSON. 2. The structure of this JSON is: `{"type": "<standard-JWT-algorithms>", "key": "<the-key>"}` `type` : Standard JWT algos : `HS256`, `RS256`, `RS512` etc. (see jwt.io). `key`: i. Incase of symmetric key, the key as it is. ii. Incase of asymmetric keys, only the public key, in a PEM encoded string or as a X509 certificate. 3. The claims in the JWT token must contain the following: i. `x-hasura-default-role` field: default role of that user ii. `x-hasura-allowed-roles` : A list of allowed roles for the user. The default role is overriden by `x-hasura-role` header. 4. The claims in the JWT token, can have other `x-hasura-*` fields where their values can only be strings. 5. The JWT tokens are sent as `Authorization: Bearer <token>` headers. --- To test: 1. Generate a shared secret (for HMAC-SHA256) or RSA key pair. 2. Goto https://jwt.io/ , add the keys 3. Edit the claims to have `x-hasura-role` (mandatory) and other `x-hasura-*` fields. Add permissions related to the claims to test permissions. 4. Start HGE with `--jwt-secret` flag or `HASURA_GRAPHQL_JWT_SECRET` env var, which takes a JSON string: `{"type": "HS256", "key": "mylongsharedsecret"}` or `{"type":"RS256", "key": "<PEM-encoded-public-key>"}` 5. Copy the JWT token from jwt.io and use it in the `Authorization: Bearer <token>` header. --- TODO: Support EC public keys. It is blocked on frasertweedale/hs-jose#61
2018-08-30 13:32:09 +03:00
, Hasura.Server.Auth.JWT
2018-06-27 16:11:32 +03:00
, Hasura.Server.Init
, Hasura.Server.Context
2018-06-27 16:11:32 +03:00
, Hasura.Server.Middleware
, Hasura.Server.Logging
, Hasura.Server.Query
, Hasura.Server.Utils
, Hasura.Server.Cors
, Hasura.Server.Version
, Hasura.Server.CheckUpdates
2019-01-28 16:55:28 +03:00
, Hasura.Server.Telemetry
, Hasura.Server.SchemaUpdate
, Hasura.Server.PGDump
, Hasura.Server.Config
, Hasura.Server.Compression
2018-06-27 16:11:32 +03:00
, Hasura.RQL.Types
, Hasura.RQL.Instances
, Hasura.RQL.Types.SchemaCache
, Hasura.RQL.Types.SchemaCacheTypes
, Hasura.RQL.Types.BoolExp
, Hasura.RQL.Types.Catalog
, Hasura.RQL.Types.Column
, Hasura.RQL.Types.Common
2018-06-27 16:11:32 +03:00
, Hasura.RQL.Types.DML
, Hasura.RQL.Types.Error
, Hasura.RQL.Types.EventTrigger
, Hasura.RQL.Types.Metadata
, Hasura.RQL.Types.Permission
, Hasura.RQL.Types.QueryCollection
, Hasura.RQL.Types.RemoteSchema
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DDL.Deps
, Hasura.RQL.DDL.Permission.Internal
, Hasura.RQL.DDL.Permission.Triggers
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DDL.Permission
, Hasura.RQL.DDL.Relationship
, Hasura.RQL.DDL.Relationship.Rename
, Hasura.RQL.DDL.Relationship.Types
, Hasura.RQL.DDL.Schema
, Hasura.RQL.DDL.Schema.Cache
, Hasura.RQL.DDL.Schema.Catalog
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DDL.Schema.Diff
, Hasura.RQL.DDL.Schema.Enum
, Hasura.RQL.DDL.Schema.Function
, Hasura.RQL.DDL.Schema.Rename
, Hasura.RQL.DDL.Schema.Table
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DDL.Metadata
, Hasura.RQL.DDL.Utils
, Hasura.RQL.DDL.EventTrigger
, Hasura.RQL.DDL.Headers
, Hasura.RQL.DDL.RemoteSchema
, Hasura.RQL.DDL.QueryCollection
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DML.Delete
, Hasura.RQL.DML.Internal
, Hasura.RQL.DML.Insert
, Hasura.RQL.DML.Mutation
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DML.Returning
, Hasura.RQL.DML.Select.Internal
, Hasura.RQL.DML.Select.Types
2018-06-27 16:11:32 +03:00
, Hasura.RQL.DML.Select
, Hasura.RQL.DML.Update
, Hasura.RQL.DML.Count
, Hasura.RQL.GBoolExp
, Hasura.GraphQL.Transport.HTTP.Protocol
, Hasura.GraphQL.Transport.HTTP
, Hasura.GraphQL.Transport.WebSocket.Protocol
, Hasura.GraphQL.Transport.WebSocket.Server
, Hasura.GraphQL.Transport.WebSocket
, Hasura.GraphQL.Schema.BoolExp
, Hasura.GraphQL.Schema.Common
, Hasura.GraphQL.Schema.Function
, Hasura.GraphQL.Schema.OrderBy
, Hasura.GraphQL.Schema.Select
, Hasura.GraphQL.Schema.Merge
, Hasura.GraphQL.Schema.Mutation.Common
, Hasura.GraphQL.Schema.Mutation.Insert
, Hasura.GraphQL.Schema.Mutation.Update
, Hasura.GraphQL.Schema.Mutation.Delete
2018-06-27 16:11:32 +03:00
, Hasura.GraphQL.Schema
, Hasura.GraphQL.Utils
, Hasura.GraphQL.Validate
2018-06-27 16:11:32 +03:00
, Hasura.GraphQL.Validate.Types
, Hasura.GraphQL.Validate.Context
, Hasura.GraphQL.Validate.Field
, Hasura.GraphQL.Validate.InputValue
, Hasura.GraphQL.Explain
, Hasura.GraphQL.Execute
2019-04-17 12:48:41 +03:00
, Hasura.GraphQL.Execute.Plan
, Hasura.GraphQL.Execute.Query
, Hasura.GraphQL.Execute.LiveQuery
, 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.Resolve
, Hasura.GraphQL.Resolve.Types
2018-06-27 16:11:32 +03:00
, Hasura.GraphQL.Resolve.Context
, Hasura.GraphQL.Resolve.BoolExp
2018-06-27 16:11:32 +03:00
, Hasura.GraphQL.Resolve.InputValue
, Hasura.GraphQL.Resolve.Introspect
, Hasura.GraphQL.Resolve.Insert
2018-06-27 16:11:32 +03:00
, Hasura.GraphQL.Resolve.Mutation
, Hasura.GraphQL.Resolve.Select
, Hasura.GraphQL.RemoteServer
, Hasura.GraphQL.Context
, Hasura.GraphQL.Logging
2018-06-27 16:11:32 +03:00
2018-09-05 14:26:46 +03:00
, Hasura.Events.Lib
, Hasura.Events.HTTP
, Hasura.HTTP
, Control.Concurrent.Extended
, Control.Lens.Extended
2019-04-17 12:48:41 +03:00
, Data.Aeson.Extended
, Data.HashMap.Strict.InsOrd.Extended
, Data.Parser.JSONPath
, Data.Sequence.NonEmpty
, Data.TByteString
, Data.Text.Extended
, Data.Time.Clock.Units
2018-06-27 16:11:32 +03:00
, Hasura.SQL.DML
, Hasura.SQL.Error
2018-06-27 16:11:32 +03:00
, Hasura.SQL.GeoJSON
, Hasura.SQL.Rewrite
, Hasura.SQL.Time
, Hasura.SQL.Types
, Hasura.SQL.Value
, Network.URI.Extended
2018-06-27 16:11:32 +03:00
other-modules: Hasura.Server.Auth.JWT.Internal
, Hasura.Server.Auth.JWT.Logging
default-extensions: ApplicativeDo
BangPatterns
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GeneralizedNewtypeDeriving
InstanceSigs
LambdaCase
MultiParamTypeClasses
MultiWayIf
NoImplicitPrelude
OverloadedStrings
QuasiQuotes
RankNTypes
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeFamilies
2019-04-17 12:48:41 +03:00
if flag(profile)
2018-06-27 16:11:32 +03:00
ghc-prof-options: -rtsopts -fprof-auto -fno-prof-count-entries
2019-04-17 12:48:41 +03:00
if flag(developer)
cpp-options: -DDeveloperAPIs
2018-06-27 16:11:32 +03:00
ghc-options: -O2
-foptimal-applicative-do
-fdefer-typed-holes
-Wall
-Wcompat
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
2018-06-27 16:11:32 +03:00
executable graphql-engine
default-extensions: ApplicativeDo
BangPatterns
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GeneralizedNewtypeDeriving
InstanceSigs
LambdaCase
MultiParamTypeClasses
MultiWayIf
NoImplicitPrelude
OverloadedStrings
QuasiQuotes
RankNTypes
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeFamilies
2018-06-27 16:11:32 +03:00
main-is: Main.hs
default-language: Haskell2010
hs-source-dirs: src-exec
build-depends: base
, warp >= 3.2
2018-06-27 16:11:32 +03:00
, graphql-engine
, aeson >= 1.0
, bytestring >= 0.10
, mtl
, optparse-applicative >= 0.12
, yaml
, template-haskell >= 2.11 , time >= 1.6
2018-06-27 16:11:32 +03:00
, text
, lens
, unordered-containers >= 0.2
, pg-client
, http-client
, http-client-tls
2018-09-05 14:26:46 +03:00
, stm
, wreq
, string-conversions
, uuid
, unix
other-modules: Ops
, Migrate
, Migrate.Version
2018-06-27 16:11:32 +03:00
if flag(developer)
ghc-prof-options: -rtsopts -fprof-auto -fno-prof-count-entries
ghc-options: -O2
-foptimal-applicative-do
-fdefer-typed-holes
-Wall
-Wcompat
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-threaded -rtsopts
-- Re. `-I2` see #2565
"-with-rtsopts=-N -I2"