diff --git a/etc/storyboard.conf.sample b/etc/storyboard.conf.sample index 37483e11..4f37fd7b 100644 --- a/etc/storyboard.conf.sample +++ b/etc/storyboard.conf.sample @@ -38,7 +38,6 @@ lock_path = $state_path/lock # bind_port = 8080 # List paging configuration options. -# page_size_maximum = 500 # page_size_default = 20 # Enable notifications. This feature drives deferred processing, reporting, diff --git a/storyboard/api/config.py b/storyboard/api/config.py index 2d1f4d1c..b4b3c3d1 100644 --- a/storyboard/api/config.py +++ b/storyboard/api/config.py @@ -22,10 +22,6 @@ app = { } cfg.CONF.register_opts([ - cfg.IntOpt('page_size_maximum', - default=500, - help='The maximum number of results to allow a user to request ' - 'from the API'), cfg.IntOpt('page_size_default', default=20, help='The maximum number of results to allow a user to request ' diff --git a/storyboard/api/v1/branches.py b/storyboard/api/v1/branches.py index 21465e56..23e82390 100644 --- a/storyboard/api/v1/branches.py +++ b/storyboard/api/v1/branches.py @@ -82,7 +82,7 @@ class BranchesController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_branch = branches_api.branch_get(marker) diff --git a/storyboard/api/v1/milestones.py b/storyboard/api/v1/milestones.py index 8bcbab12..d2e381ea 100644 --- a/storyboard/api/v1/milestones.py +++ b/storyboard/api/v1/milestones.py @@ -81,7 +81,7 @@ class MilestonesController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_milestone = milestones_api.milestone_get(marker) diff --git a/storyboard/api/v1/project_groups.py b/storyboard/api/v1/project_groups.py index fb386323..e328db95 100644 --- a/storyboard/api/v1/project_groups.py +++ b/storyboard/api/v1/project_groups.py @@ -131,7 +131,7 @@ class ProjectGroupsController(rest.RestController): if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_group = project_groups.project_group_get(marker) diff --git a/storyboard/api/v1/projects.py b/storyboard/api/v1/projects.py index 1596483b..94115803 100644 --- a/storyboard/api/v1/projects.py +++ b/storyboard/api/v1/projects.py @@ -100,7 +100,7 @@ class ProjectsController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_project = projects_api.project_get(marker) diff --git a/storyboard/api/v1/stories.py b/storyboard/api/v1/stories.py index 22918428..e2c38357 100644 --- a/storyboard/api/v1/stories.py +++ b/storyboard/api/v1/stories.py @@ -94,7 +94,7 @@ class StoriesController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_story = stories_api.story_get(marker) diff --git a/storyboard/api/v1/subscription_events.py b/storyboard/api/v1/subscription_events.py index c811bf28..49a31afd 100644 --- a/storyboard/api/v1/subscription_events.py +++ b/storyboard/api/v1/subscription_events.py @@ -108,7 +108,7 @@ class SubscriptionEventsController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_sub = subscription_events_api.subscription_events_get(marker) diff --git a/storyboard/api/v1/subscriptions.py b/storyboard/api/v1/subscriptions.py index ccffe217..d25727e3 100644 --- a/storyboard/api/v1/subscriptions.py +++ b/storyboard/api/v1/subscriptions.py @@ -101,7 +101,7 @@ class SubscriptionsController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Sanity check on user_id current_user = user_api.user_get(request.current_user_id) diff --git a/storyboard/api/v1/task_statuses.py b/storyboard/api/v1/task_statuses.py index 6d65512b..d0ca1dd2 100644 --- a/storyboard/api/v1/task_statuses.py +++ b/storyboard/api/v1/task_statuses.py @@ -39,7 +39,7 @@ class TaskStatusesController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) statuses = tasks_api.task_get_statuses() task_statuses = [] diff --git a/storyboard/api/v1/tasks.py b/storyboard/api/v1/tasks.py index 531c86a5..6ac6b2b2 100644 --- a/storyboard/api/v1/tasks.py +++ b/storyboard/api/v1/tasks.py @@ -295,7 +295,7 @@ class TasksPrimaryController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_task = tasks_api.task_get(marker) @@ -470,7 +470,7 @@ class TasksNestedController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_task = tasks_api.task_get(marker) diff --git a/storyboard/api/v1/teams.py b/storyboard/api/v1/teams.py index 2cf3843a..09113126 100644 --- a/storyboard/api/v1/teams.py +++ b/storyboard/api/v1/teams.py @@ -136,7 +136,7 @@ class TeamsController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_team = teams_api.team_get(marker) diff --git a/storyboard/api/v1/timeline.py b/storyboard/api/v1/timeline.py index 2ec2318e..0969519d 100644 --- a/storyboard/api/v1/timeline.py +++ b/storyboard/api/v1/timeline.py @@ -81,7 +81,7 @@ class TimeLineEventsController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Sanity check on event types. if event_type: @@ -155,7 +155,7 @@ class CommentsController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_event = None diff --git a/storyboard/api/v1/user_tokens.py b/storyboard/api/v1/user_tokens.py index 5253b338..9a67ad0d 100644 --- a/storyboard/api/v1/user_tokens.py +++ b/storyboard/api/v1/user_tokens.py @@ -74,7 +74,7 @@ class UserTokensController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_token = token_api.user_token_get(marker) diff --git a/storyboard/api/v1/users.py b/storyboard/api/v1/users.py index f26798c4..0e96fecd 100644 --- a/storyboard/api/v1/users.py +++ b/storyboard/api/v1/users.py @@ -74,7 +74,7 @@ class UsersController(rest.RestController): # Boundary check on limit. if limit is None: limit = CONF.page_size_default - limit = min(CONF.page_size_maximum, max(1, limit)) + limit = max(0, limit) # Resolve the marker record. marker_user = users_api.user_get(marker)