lablup / backend.ai

Backend.AI is a streamlined, container-based computing cluster platform that hosts popular computing/ML frameworks and diverse programming languages, with pluggable heterogeneous accelerator support including CUDA GPU, ROCm GPU, TPU, IPU and other NPUs.
https://www.backend.ai
GNU Lesser General Public License v3.0
520 stars 154 forks source link

Limit the page size of GraphQL queries to 50 with the default to 10. #2561

Open achimnol opened 3 months ago

achimnol commented 3 months ago

There were several mis-use of the paginated GraphQL queries by setting the page size to an unreasonably large number, like 1000.

Let's explicitly forbid such usage by setting the maximum page size to 50 and the default page size to 10 when not specified.

achimnol commented 2 months ago

@lqez will contribute to this issue!

lqez commented 2 months ago
The below list shows the current implementation status of GraphQL models.   v1 (graphene.ObjectType) v1 list (whole items) v1 list (manual paging) v2 (graphene.ObjectType & AsyncNode) v2 list (PaginatedConnection) variations
agent agent agents agent_list      
agent_summary agent_summary   agent_summary_list      
domain domain domains        
group group groups   group_node group_nodes groups_by_name
image image images   customized_image    
user user users user_list user_node user_nodes  
keypair keypair keypairs keypair_list      
keypair_resource_policiy keypair_resource_policy keypair_resource_policies        
user_resource user_resource_policy user_resource_policies        
project_resource project_resource_policy project_resource_policies        
resource_preset resource_preset resource_presets        
scailing_group scailing_group scailing_groups       scailing_groups_for_domain / scailing_groups_for_user_group / scailing_groups_for_keypair
storage_volume storage_volume   storage_volume_list      
vfolder vfolder vfolders vfolder_list vfolder_node vfolder_nodes  
vfolder_permission_list     vfolder_permission_list      
vfolder_own_list     vfolder_own_list      
vfolder_invited_list     vfolder_invited_list      
vfolder_project_list     vfolder_project_list      
vfolder_host_permissions   vfolder_host_permissions        
compute_session compute_session   compute_session_list      
compute_container compute_container   compute_container_list      
legacy_compute_session legacy_compute_session   legacy_compute_session_list      
endpoint endpoint   endpoint_list      
routing routing   routing_list      
endpoint_token endpoint_token   endpoint_token_list      
quota_scope quota_scope          
container_registry   container_registries   container_registry    
model_card       model_card model_cards