graphql-engine/server/src-lib/Hasura/RQL/DDL
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
..
Metadata Optimistic Metadata Locking 2021-02-19 02:40:23 +00:00
Permission server: add MSSQL support 2021-02-23 17:38:36 +00:00
Relationship server: add MSSQL support 2021-02-23 17:38:36 +00:00
RemoteRelationship server: generalize schema cache building (#496) 2021-02-14 06:08:46 +00:00
RemoteSchema Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
Schema REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
Action.hs server: generalize schema cache building (#496) 2021-02-14 06:08:46 +00:00
ApiLimit.hs server: multitenant metadata storage 2021-02-11 17:55:21 +00:00
ComputedField.hs server: generalize schema cache building (#496) 2021-02-14 06:08:46 +00:00
CustomTypes.hs server: generalize schema cache building (#496) 2021-02-14 06:08:46 +00:00
Deps.hs server: support separate metadata database and server code setup for multi sources (#197) 2020-12-28 12:56:55 +00:00
Endpoint.hs server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
EventTrigger.hs server: add MSSQL support 2021-02-23 17:38:36 +00:00
Headers.hs server: remove a few unused Lift instances (#114) 2020-11-26 13:58:07 +00:00
Metadata.hs server: add MSSQL support 2021-02-23 17:38:36 +00:00
Permission.hs server: add MSSQL support 2021-02-23 17:38:36 +00:00
QueryCollection.hs server: RQL code health 2021-01-08 23:10:36 +00:00
Relationship.hs server: add MSSQL support 2021-02-23 17:38:36 +00:00
RemoteRelationship.hs server: generalize schema cache building (#496) 2021-02-14 06:08:46 +00:00
RemoteSchema.hs server: new function permissions layer 2021-01-29 05:49:09 +00:00
ScheduledTrigger.hs server: support for maintenance mode in v1.4 2021-02-18 16:47:22 +00:00
Schema.hs server: add MSSQL support 2021-02-23 17:38:36 +00:00