To validate the max size of the incoming request, Tyk operator provides support through API Definitions and support information is captured in below documentation.
# API Definitions
An API Definition describes the configuration of an API. It instructs Tyk Gateway how to configure the API.
To check the supported features of the API Definitions CRD version you're currently using, please use the "Switch branches / tags" feature on GitHub and select corresponding version tag.
## Implemented Capabilities / Support Status
| Symbol | Description |
|--------|-----------------------------------|
| ✅ | Fully supported |
| ⚠️ | Untested / Requires Documentation |
| ❌️ | Not currently supported |
## API Types
| Type | Support | Supported From | Comments | Sample |
|--------------------------------|---------|----------------|------------------------------|--------------------------------------------------------------------------------------------|
| HTTP | ✅ | v0.1 | - | |
| HTTPS | ✅ | v0.4 | - | [Sample](./../config/samples/tls/example.yaml)️ |
| TCP | ✅ | v0.1 | - | |
This file has been truncated. show original
But sample YAML provided for Validate - Limit Request Size feature has json validation details. Can you help providing the API definition details for max size validation feature.
https://github.com/TykTechnologies/tyk-operator/blob/master/config/samples/httpbin_validate.yaml
ahmet
April 16, 2021, 8:09am
2
Apologies - this looks like a typo.
Here is an example:
apiVersion: tyk.tyk.io/v1alpha1
kind: ApiDefinition
metadata:
name: httpbin-limit
spec:
name: httpbin-limit
use_keyless: true
protocol: http
active: true
proxy:
target_url: http://httpbin.org
listen_path: /httpbin-limit
strip_listen_path: true
version_data:
default_version: Default
not_versioned: true
versions:
Default:
name: Default
use_extended_paths: true
extended_paths:
size_limits:
- method: POST
path: /post
size_limit: 5
Then putting it in action
curl http://YOURURL/httpbin-limit/post -X POST -d '123456'
{
"error": "Request is too large"
}
opened 08:14AM - 16 Apr 21 UTC
closed 05:06PM - 04 May 21 UTC
defect
Our example for request size limit middleware points to json schema validation.
…
- [ ] Provide ApiDefinition example to demonstrate Request Size Limit as per https://community.tyk.io/t/validate-limit-request-size-api-definition-tyk-operator/4536/2?u=ahmet
- [ ] Update the Endpoint Middleware table https://github.com/TykTechnologies/tyk-operator/blob/master/docs/api_definitions.md#apidefinition---endpoint-middleware to point to the new documentation
<img width="516" alt="Screenshot 2021-04-16 at 09 12 51" src="https://user-images.githubusercontent.com/1465130/114993769-0ae41400-9e94-11eb-9594-ac9d1945de60.png">
Thank you ahmet. It worked fine now.
1 Like