This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6e3126a2e17 fix(api): unify get_permissions pagination with other list
endpoints (#61726)
6e3126a2e17 is described below
commit 6e3126a2e17c7022b750ad47d9270e6ca5a03de3
Author: Henry Chen <[email protected]>
AuthorDate: Thu Feb 12 23:33:15 2026 +0800
fix(api): unify get_permissions pagination with other list endpoints
(#61726)
- Use get_effective_limit for limit parameter
- Add ge=0 constraint to offset
- Ensure consistent pagination behavior across all FAB API list endpoints
---
.../openapi/v2-fab-auth-manager-generated.yaml | 16 ++++++++++------
.../fab/auth_manager/api_fastapi/routes/roles.py | 5 ++++-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git
a/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/openapi/v2-fab-auth-manager-generated.yaml
b/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/openapi/v2-fab-auth-manager-generated.yaml
index e892c0294cd..9ad5472e709 100644
---
a/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/openapi/v2-fab-auth-manager-generated.yaml
+++
b/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/openapi/v2-fab-auth-manager-generated.yaml
@@ -409,20 +409,24 @@ paths:
- OAuth2PasswordBearer: []
- HTTPBearer: []
parameters:
- - name: limit
+ - name: offset
in: query
required: false
schema:
type: integer
- default: 100
- title: Limit
- - name: offset
+ minimum: 0
+ description: Number of items to skip before starting to collect
results.
+ default: 0
+ title: Offset
+ description: Number of items to skip before starting to collect
results.
+ - name: limit
in: query
required: false
schema:
type: integer
- default: 0
- title: Offset
+ minimum: 0
+ default: 100
+ title: Limit
responses:
'200':
description: Successful Response
diff --git
a/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py
b/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py
index 36a38c9f060..50a34ffa9e4 100644
---
a/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py
+++
b/providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/roles.py
@@ -150,7 +150,10 @@ def patch_role(
),
dependencies=[Depends(requires_fab_custom_view("GET",
permissions.RESOURCE_ROLE))],
)
-def get_permissions(limit: int = Query(100), offset: int = Query(0)):
+def get_permissions(
+ limit: int = Depends(get_effective_limit()),
+ offset: int = Query(0, ge=0, description="Number of items to skip before
starting to collect results."),
+):
"""List all action-resource (permission) pairs."""
with get_application_builder():
return FABAuthManagerRoles.get_permissions(limit=limit, offset=offset)