mirror of https://github.com/status-im/consul.git
e027c94b52
* server: add placeholder glue for rate limit handler This commit adds a no-op implementation of the rate-limit handler and adds it to the `consul.Server` struct and setup code. This allows us to start working on the net/rpc and gRPC interceptors and config logic. * Add handler errors * Set the global read and write limits * fixing multilimiter moving packages * Fix typo * Simplify globalLimit usage * add multilimiter and tests * exporting LimitedEntity * Apply suggestions from code review Co-authored-by: John Murret <john.murret@hashicorp.com> * add config update and rename config params * add doc string and split config * Apply suggestions from code review Co-authored-by: Dan Upton <daniel@floppy.co> * use timer to avoid go routine leak and change the interface * add comments to tests * fix failing test * add prefix with config edge, refactor tests * Apply suggestions from code review Co-authored-by: Dan Upton <daniel@floppy.co> * refactor to apply configs for limiters under a prefix * add fuzz tests and fix bugs found. Refactor reconcile loop to have a simpler logic * make KeyType an exported type * split the config and limiter trees to fix race conditions in config update * rename variables * fix race in test and remove dead code * fix reconcile loop to not create a timer on each loop * add extra benchmark tests and fix tests * fix benchmark test to pass value to func * server: add placeholder glue for rate limit handler This commit adds a no-op implementation of the rate-limit handler and adds it to the `consul.Server` struct and setup code. This allows us to start working on the net/rpc and gRPC interceptors and config logic. * Set the global read and write limits * fixing multilimiter moving packages * add server configuration for global rate limiting. * remove agent test * remove added stuff from handler * remove added stuff from multilimiter * removing unnecessary TODOs * Removing TODO comment from handler * adding in defaulting to infinite * add disabled status in there * adding in documentation for disabled mode. * make disabled the default. * Add mock and agent test * addig documentation and missing mock file. * Fixing test TestLoad_IntegrationWithFlags * updating docs based on PR feedback. * Updating Request Limits mode to use int based on PR feedback. * Adding RequestLimits struct so we have a nested struct in ReloadableConfig. * fixing linting references * Update agent/consul/rate/handler.go Co-authored-by: Dan Upton <daniel@floppy.co> * Update agent/consul/config.go Co-authored-by: Dan Upton <daniel@floppy.co> * removing the ignore of the request limits in JSON. addingbuilder logic to convert any read rate or write rate less than 0 to rate.Inf * added conversion function to convert request limits object to handler config. * Updating docs to reflect gRPC and RPC are rate limit and as a result, HTTP requests are as well. * Updating values for TestLoad_FullConfig() so that they were different and discernable. * Updating TestRuntimeConfig_Sanitize * Fixing TestLoad_IntegrationWithFlags test * putting nil check in place * fixing rebase * removing change for missing error checks. will put in another PR * Rebasing after default multilimiter config change * resolving rebase issues * updating reference for incomingRPCLimiter to use interface * updating interface * Updating interfaces * Fixing mock reference Co-authored-by: Daniel Upton <daniel@floppy.co> Co-authored-by: Dhia Ayachi <dhia@hashicorp.com> |
||
---|---|---|
.. | ||
ae | ||
auto-config | ||
cache | ||
cache-types | ||
checks | ||
config | ||
configentry | ||
connect | ||
consul | ||
debug | ||
dns | ||
exec | ||
grpc-external | ||
grpc-internal | ||
grpc-middleware | ||
hcp | ||
local | ||
metadata | ||
mock | ||
pool | ||
proxycfg | ||
proxycfg-glue | ||
proxycfg-sources | ||
router | ||
routine-leak-checker | ||
rpc | ||
rpcclient/health | ||
structs | ||
submatview | ||
systemd | ||
token | ||
uiserver | ||
xds | ||
acl.go | ||
acl_endpoint.go | ||
acl_endpoint_legacy.go | ||
acl_endpoint_legacy_test.go | ||
acl_endpoint_test.go | ||
acl_oss.go | ||
acl_test.go | ||
agent.go | ||
agent_endpoint.go | ||
agent_endpoint_oss.go | ||
agent_endpoint_oss_test.go | ||
agent_endpoint_test.go | ||
agent_oss.go | ||
agent_test.go | ||
apiserver.go | ||
apiserver_test.go | ||
catalog_endpoint.go | ||
catalog_endpoint_oss.go | ||
catalog_endpoint_test.go | ||
check.go | ||
config_endpoint.go | ||
config_endpoint_test.go | ||
connect_auth.go | ||
connect_ca_endpoint.go | ||
connect_ca_endpoint_test.go | ||
coordinate_endpoint.go | ||
coordinate_endpoint_test.go | ||
delegate_mock_test.go | ||
denylist.go | ||
denylist_test.go | ||
discovery_chain_endpoint.go | ||
discovery_chain_endpoint_test.go | ||
dns.go | ||
dns_oss.go | ||
dns_oss_test.go | ||
dns_test.go | ||
enterprise_delegate_oss.go | ||
event_endpoint.go | ||
event_endpoint_test.go | ||
federation_state_endpoint.go | ||
health_endpoint.go | ||
health_endpoint_test.go | ||
http.go | ||
http_decode_test.go | ||
http_oss.go | ||
http_oss_test.go | ||
http_register.go | ||
http_test.go | ||
intentions_endpoint.go | ||
intentions_endpoint_oss_test.go | ||
intentions_endpoint_test.go | ||
keyring.go | ||
keyring_test.go | ||
kvs_endpoint.go | ||
kvs_endpoint_test.go | ||
metrics.go | ||
metrics_test.go | ||
nodeid.go | ||
nodeid_test.go | ||
notify.go | ||
notify_test.go | ||
operator_endpoint.go | ||
operator_endpoint_oss.go | ||
operator_endpoint_test.go | ||
peering_endpoint.go | ||
peering_endpoint_oss_test.go | ||
peering_endpoint_test.go | ||
prepared_query_endpoint.go | ||
prepared_query_endpoint_test.go | ||
reload.go | ||
remote_exec.go | ||
remote_exec_test.go | ||
retry_join.go | ||
retry_join_test.go | ||
service_checks_test.go | ||
service_manager.go | ||
service_manager_test.go | ||
session_endpoint.go | ||
session_endpoint_test.go | ||
setup.go | ||
setup_oss.go | ||
sidecar_service.go | ||
sidecar_service_test.go | ||
signal_unix.go | ||
signal_windows.go | ||
snapshot_endpoint.go | ||
snapshot_endpoint_test.go | ||
status_endpoint.go | ||
status_endpoint_test.go | ||
streaming_test.go | ||
testagent.go | ||
testagent_test.go | ||
translate_addr.go | ||
txn_endpoint.go | ||
txn_endpoint_test.go | ||
ui_endpoint.go | ||
ui_endpoint_oss_test.go | ||
ui_endpoint_test.go | ||
user_event.go | ||
user_event_test.go | ||
util.go | ||
util_test.go | ||
watch_handler.go | ||
watch_handler_test.go |