Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9749408
D2856.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D2856.diff
View Options
diff --git a/docs/developers-info.rst b/docs/developers-info.rst
--- a/docs/developers-info.rst
+++ b/docs/developers-info.rst
@@ -73,8 +73,6 @@
in charge of communication with :mod:`swh.storage` to retrieve information and
perform conversion for the upper layer.
* :mod:`swh.web.common.swh_templatetags`: Custom Django template tags library for swh.
- * :mod:`swh.web.common.throttling`: Custom request rate limiter to use with the `Django REST Framework
- <http://www.django-rest-framework.org/>`_
* :mod:`swh.web.common.urlsindex`: Utilities to help the registering of endpoints
for the web applications
* :mod:`swh.web.common.utils`: Utility functions used in the web applications implementation
@@ -88,6 +86,8 @@
* :mod:`swh.web.api.apiresponse`: Utility module to ease the generation of
web api responses.
* :mod:`swh.web.api.apiurls`: Utilities to facilitate the registration of web api endpoints.
+ * :mod:`swh.web.api.throttling`: Custom request rate limiter to use with the `Django REST Framework
+ <http://www.django-rest-framework.org/>`_
* :mod:`swh.web.api.urls`: Module that defines the whole URI scheme for the api endpoints
* :mod:`swh.web.api.utils`: Utility functions used in the web api implementation.
* :mod:`swh.web.api.views.content`: Implementation of API endpoints for getting information
diff --git a/swh/web/api/apiurls.py b/swh/web/api/apiurls.py
--- a/swh/web/api/apiurls.py
+++ b/swh/web/api/apiurls.py
@@ -10,7 +10,7 @@
from rest_framework.decorators import api_view
from swh.web.common.urlsindex import UrlsIndex
-from swh.web.common import throttling
+from swh.web.api import throttling
class APIUrls(UrlsIndex):
diff --git a/swh/web/common/throttling.py b/swh/web/api/throttling.py
rename from swh/web/common/throttling.py
rename to swh/web/api/throttling.py
diff --git a/swh/web/misc/origin_save.py b/swh/web/misc/origin_save.py
--- a/swh/web/misc/origin_save.py
+++ b/swh/web/misc/origin_save.py
@@ -14,13 +14,13 @@
from rest_framework.decorators import api_view, authentication_classes
+from swh.web.api.throttling import throttle_scope
from swh.web.common.exc import ForbiddenExc
from swh.web.common.models import SaveOriginRequest
from swh.web.common.origin_save import (
create_save_origin_request, get_savable_visit_types,
get_save_origin_requests_from_queryset
)
-from swh.web.common.throttling import throttle_scope
from swh.web.common.utils import EnforceCSRFAuthentication
diff --git a/swh/web/settings/common.py b/swh/web/settings/common.py
--- a/swh/web/settings/common.py
+++ b/swh/web/settings/common.py
@@ -168,7 +168,7 @@
'rest_framework.renderers.TemplateHTMLRenderer'
),
'DEFAULT_THROTTLE_CLASSES': (
- 'swh.web.common.throttling.SwhWebRateThrottle',
+ 'swh.web.api.throttling.SwhWebRateThrottle',
),
'DEFAULT_THROTTLE_RATES': throttle_rates,
'DEFAULT_AUTHENTICATION_CLASSES': [
diff --git a/swh/web/tests/common/test_throttling.py b/swh/web/tests/api/test_throttling.py
rename from swh/web/tests/common/test_throttling.py
rename to swh/web/tests/api/test_throttling.py
--- a/swh/web/tests/common/test_throttling.py
+++ b/swh/web/tests/api/test_throttling.py
@@ -17,7 +17,7 @@
from rest_framework.decorators import api_view
-from swh.web.common.throttling import SwhWebRateThrottle, throttle_scope
+from swh.web.api.throttling import SwhWebRateThrottle, throttle_scope
class MockViewScope1(APIView):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 24, 5:05 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3218512
Attached To
D2856: Move throttling module from swh.web.common to swh.web.api
Event Timeline
Log In to Comment