graphql-engine/server/tests-py/queries/endpoints
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
..
endpoint_conflicting.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_dropped.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_duplicate_param.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_empty_path_param.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_empty_path_segment.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_empty_path.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_missing.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple_cached.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple_wrong_method.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_subscription.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_trailing_slash.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_with_body_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_multiple_query_args.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_missing_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_url_encoded_2.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_url_encoded.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_template.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
setup.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
teardown.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00