graphql-engine/server/src-lib/Hasura
Lyndon Maydwell 08da0c63b6 REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions
Resolves Issues:

* https://github.com/hasura/graphql-engine-mono/issues/658 - Invalid Slashes
* https://github.com/hasura/graphql-engine-mono/issues/628 - Subscriptions

Implementation:

* Moved some logic from Endpoint.hs to allow reuse of splitting url into PathSegments.
* Additional validation steps alongside checking for overlapping routes
* Logging potential misuse of GET for mutations

Future Work:

* [ ] GET is allowed for mutations (Ignore/Log warning for Now)
* [ ] Add to scInconsistentObjs rather than throwing error
  * Add information to scInconsistentObjs instead of raising errors directly.

TODO:

* [x] Duplicate variable segments with the same name in the location should not be allowed
* [x] We should throw an error on trailing and leading slashes and URLs which contain empty segments
* [x] Endpoints can be created using subscriptions. But the error only shows at the time of the query
* [x] Tests

---

### Kodiak commit message

Prohibit Invalid slashes, duplicate variables, subscriptions for REST endpoints.

GitOrigin-RevId: 86c0d4af97984c8afd02699e6071e9c1658710b8
2021-02-24 04:31:05 +00:00
..
Backends server: fix build 2021-02-23 21:43:56 +00:00
Cache Support only the bounded cache, with default HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE of 4000. Closes #5363 2020-07-28 19:02:44 -04:00
Eventing server: add MSSQL support 2021-02-23 17:38:36 +00:00
GraphQL server: add MSSQL support 2021-02-23 17:38:36 +00:00
Incremental server: changes to support other backends 2021-02-03 16:25:17 +00:00
Metadata Optimistic Metadata Locking 2021-02-19 02:40:23 +00:00
RQL REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
Server server: add MSSQL support 2021-02-23 17:38:36 +00:00
SQL server: add MSSQL support 2021-02-23 17:38:36 +00:00
App.hs server: add MSSQL support 2021-02-23 17:38:36 +00:00
EncJSON.hs server: heterogeneous execution of GraphQL queries (#5869) 2020-10-07 10:23:17 +00:00
GC.hs server: simplify shutdown logic, improve resource management (#218) (#195) 2020-12-21 18:56:57 +00:00
HTTP.hs improve debug information in actions errors response (close #4031) (#4432) 2020-04-24 13:25:51 +05:30
Incremental.hs Build the GraphQL context after pruning dangling dependents 2020-01-30 18:17:29 -06:00
Logging.hs server: simplify JSON instances 2021-01-19 19:15:42 +00:00
Prelude.hs server: simplify JSON instances 2021-01-19 19:15:42 +00:00
Session.hs server: generalize schema cache building (#496) 2021-02-14 06:08:46 +00:00
Tracing.hs server: RQL code health 2021-01-08 23:10:36 +00:00