Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(edge-identity-view): reduce max page size to 100 #2937

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/app/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def get_paginated_response(self, paginator, response_schema):


class EdgeIdentityPagination(CustomPagination):
max_page_size = 100
page_size = 100

def paginate_queryset(self, dynamo_queryset, request, view=None):
last_evaluated_key = dynamo_queryset.get("LastEvaluatedKey")
if last_evaluated_key:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ def test_get_identities_list(
edge_identity_dynamo_wrapper_mock,
):
# Given
url = reverse(
base_url = reverse(
"api-v1:environments:environment-edge-identities-list",
args=[environment_api_key],
)
url = f"{base_url}?page_size=9999"

edge_identity_dynamo_wrapper_mock.get_all_items.return_value = {
"Items": [identity_document],
Expand All @@ -232,7 +233,7 @@ def test_get_identities_list(
# Then
assert response.status_code == status.HTTP_200_OK
edge_identity_dynamo_wrapper_mock.get_all_items.assert_called_with(
environment_api_key, 999, None
environment_api_key, 100, None
)


Expand Down Expand Up @@ -268,7 +269,7 @@ def test_search_identities_without_exact_match(
environment_api_key,
identifier,
EdgeIdentityViewSet.dynamo_identifier_search_functions["BEGINS_WITH"],
999,
100,
None,
)

Expand Down Expand Up @@ -307,7 +308,7 @@ def test_search_for_identities_with_exact_match(
environment_api_key,
identifier,
EdgeIdentityViewSet.dynamo_identifier_search_functions["EQUAL"],
999,
100,
None,
)

Expand Down