comparison roundup/configuration.py @ 5732:0e6ed3d72f92

Rest rate limiting code first commit. It is a bit rough and turned off by default. The current code is lossy. If client connections are fast enough, the rate limiting code doesn't count every connection. So the client can get more connections than configured if they are fast enough. 5-20% of the connections are not recorded.
author John Rouillard <rouilj@ieee.org>
date Sat, 25 May 2019 16:50:25 -0400
parents e199d0ae4a25
children 1b5bcc5d745f
comparison
equal deleted inserted replaced
5731:058ef18af5fd 5732:0e6ed3d72f92
758 """Whether to enable the REST API in the roundup web 758 """Whether to enable the REST API in the roundup web
759 interface. By default the REST endpoint is the string 'rest' plus any 759 interface. By default the REST endpoint is the string 'rest' plus any
760 additional REST-API parameters after the roundup web url configured in 760 additional REST-API parameters after the roundup web url configured in
761 the tracker section. If this variable is set to 'no', the rest path has 761 the tracker section. If this variable is set to 'no', the rest path has
762 no special meaning and will yield an error message."""), 762 no special meaning and will yield an error message."""),
763 (IntegerNumberOption, 'api_calls_per_interval', "0",
764 "Limit API calls per api_interval_in_sec seconds to\n"
765 "this number.\n"
766 "Determines the burst rate and the rate that new api\n"
767 "calls will be made available. If set to 360 and\n"
768 "api_intervals_in_sec is set to 3600, the 361st call in\n"
769 "10 seconds results in a 429 error to the caller. It\n"
770 "tells them to wait 10 seconds (360/3600) before making\n"
771 "another api request. A value of 0 turns off rate\n"
772 "limiting in the API. Tune this as needed. See rest\n"
773 "documentation for more info.\n"),
774 (IntegerNumberOption, 'api_interval_in_sec', "3600",
775 "Defines the interval in seconds over which an api client can\n"
776 "make api_calls_per_interval api calls. Tune this as needed.\n"),
763 (CsrfSettingOption, 'csrf_enforce_token', "yes", 777 (CsrfSettingOption, 'csrf_enforce_token', "yes",
764 """How do we deal with @csrf fields in posted forms. 778 """How do we deal with @csrf fields in posted forms.
765 Set this to 'required' to block the post and notify 779 Set this to 'required' to block the post and notify
766 the user if the field is missing or invalid. 780 the user if the field is missing or invalid.
767 Set this to 'yes' to block the post and notify the user 781 Set this to 'yes' to block the post and notify the user

Roundup Issue Tracker: http://roundup-tracker.org/