mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 19:13:14 -04:00
Fixes https://github.com/elastic/ingest-dev/issues/3217 ## Summary Add rate limiting to "install by upload" endpoint. Implemented with a cache that is set with the timestamp of each install by upload, independently from the package name/version. If the time elapsed since the last timestamp it's less than retry time (10s), the endpoint will return `429 Too many requests`. ### Testing - Upload a package with ``` curl -XPOST -H 'content-type: application/zip' -H 'kbn-xsrf: true' http://localhost:5601/YOUR_PATH/api/fleet/epm/packages -u elastic:changeme --data-binary @PACKAGE_NAME.zip ``` - Upload another package shortly after. It can be the same one or another one, as the rate limiting is applied across all uploads, no matter the package name. - If the second upload happens <10s after the first one, should return error `429 Too Many Requests. Please wait 10s before uploading again.` ### Checklist - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
apm | ||
beats | ||
elasticsearch | ||
enterprisesearch | ||
kibana | ||
logstash | ||
index.ts |