From 18fe724fadf760a62c89383644c93015c5099bd6 Mon Sep 17 00:00:00 2001 From: kthouky Date: Fri, 22 Sep 2023 10:55:31 +0200 Subject: [PATCH] limits --- fediseer/apis/v1/censures.py | 4 ++-- fediseer/apis/v1/endorsements.py | 4 ++-- fediseer/apis/v1/guarantees.py | 4 ++-- fediseer/apis/v1/hesitations.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fediseer/apis/v1/censures.py b/fediseer/apis/v1/censures.py index 1fef2af..0d4a7ce 100644 --- a/fediseer/apis/v1/censures.py +++ b/fediseer/apis/v1/censures.py @@ -13,7 +13,7 @@ class CensuresGiven(Resource): get_parser.add_argument("min_censures", required=False, default=1, type=int, help="Limit to this amount of censures of more", location="args") get_parser.add_argument("reasons_csv", required=False, type=str, help="Only retrieve censures where their reasons include any of the text in this csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Censures_get, code=200, description='Instances', skip_none=True) @@ -152,7 +152,7 @@ class Censures(Resource): return {"domains": [instance["domain"] for instance in instance_details]},200 return {"instances": instance_details},200 - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] put_parser = reqparse.RequestParser() put_parser.add_argument("apikey", type=str, required=True, help="The sending instance's API key.", location='headers') put_parser.add_argument("Client-Agent", default="unknown:0:unknown", type=str, required=False, help="The client name and version.", location="headers") diff --git a/fediseer/apis/v1/endorsements.py b/fediseer/apis/v1/endorsements.py index b7a4de1..3f9fd5e 100644 --- a/fediseer/apis/v1/endorsements.py +++ b/fediseer/apis/v1/endorsements.py @@ -13,7 +13,7 @@ class Approvals(Resource): get_parser.add_argument("min_endorsements", required=False, default=1, type=int, help="Limit to this amount of endorsements of more", location="args") get_parser.add_argument("reasons_csv", required=False, type=str, help="Only retrieve endorsements where their reasons include any of the text in this csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Endorsed_get, code=200, description='Instances', skip_none=True) @@ -87,7 +87,7 @@ class Endorsements(Resource): get_parser.add_argument("csv", required=False, type=bool, help="Set to true to return just the domains as a csv. Mutually exclusive with domains", location="args") get_parser.add_argument("domains", required=False, type=bool, help="Set to true to return just the domains as a list. Mutually exclusive with csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Endorsed_get, code=200, description='Instances', skip_none=True) diff --git a/fediseer/apis/v1/guarantees.py b/fediseer/apis/v1/guarantees.py index 9371067..322c72e 100644 --- a/fediseer/apis/v1/guarantees.py +++ b/fediseer/apis/v1/guarantees.py @@ -9,7 +9,7 @@ class Guarantors(Resource): get_parser.add_argument("csv", required=False, type=bool, help="Set to true to return just the domains as a csv. Mutually exclusive with domains", location="args") get_parser.add_argument("domains", required=False, type=bool, help="Set to true to return just the domains as a list. Mutually exclusive with csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Whitelist_get, code=200, description='Instances', skip_none=True) @@ -36,7 +36,7 @@ class Guarantees(Resource): get_parser.add_argument("csv", required=False, type=bool, help="Set to true to return just the domains as a csv. Mutually exclusive with domains", location="args") get_parser.add_argument("domains", required=False, type=bool, help="Set to true to return just the domains as a list. Mutually exclusive with csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Whitelist_get, code=200, description='Instances', skip_none=True) diff --git a/fediseer/apis/v1/hesitations.py b/fediseer/apis/v1/hesitations.py index d8d7562..a0e5952 100644 --- a/fediseer/apis/v1/hesitations.py +++ b/fediseer/apis/v1/hesitations.py @@ -13,7 +13,7 @@ class HesitationsGiven(Resource): get_parser.add_argument("min_hesitations", required=False, default=1, type=int, help="Limit to this amount of hesitations of more", location="args") get_parser.add_argument("reasons_csv", required=False, type=str, help="Only retrieve hesitations where their reasons include any of the text in this csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Hesitations_get, code=200, description='Instances', skip_none=True) @@ -92,7 +92,7 @@ class Hesitations(Resource): get_parser.add_argument("csv", required=False, type=bool, help="Set to true to return just the domains as a csv. Mutually exclusive with domains", location="args") get_parser.add_argument("domains", required=False, type=bool, help="Set to true to return just the domains as a list. Mutually exclusive with csv", location="args") - decorators = [limiter.limit("30/minute"), limiter.limit("20/minute", key_func = get_request_path)] + decorators = [limiter.limit("45/minute"), limiter.limit("30/minute", key_func = get_request_path)] @api.expect(get_parser) @cache.cached(timeout=10, query_string=True) @api.marshal_with(models.response_model_model_Hesitations_get, code=200, description='Instances', skip_none=True)