From 5bcce2283fd462454d785bf325cf80600781d552 Mon Sep 17 00:00:00 2001 From: smarcet Date: Mon, 29 Sep 2025 20:47:50 -0300 Subject: [PATCH 01/10] fix: improve ticket csv serializer performance fix: improve ticket repository performance remove not needed extra joins fix: set fetchJoinCollection to false for ticket repo fix: get always owner to avoid N+1 on ticket repository fix: improve get tickets generic pagination --- .../Summit/DoctrineSummitAttendeeTicketRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php index 890fbceed..ce4f773aa 100644 --- a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php +++ b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php @@ -792,4 +792,4 @@ public function getAllByPage(PagingInfo $paging_info, Filter $filter = null, Ord ); } -} +} \ No newline at end of file From 90450e3f0c9b2401df70b5e881640f70c68fb5b0 Mon Sep 17 00:00:00 2001 From: smarcet Date: Tue, 30 Sep 2025 13:28:05 -0300 Subject: [PATCH 02/10] chore: refactor DoctrineSummitEventRepository to suppport 2 phase paging chore: fix .gitmessage.txt chore: increase header size to 150 --- .../Summit/DoctrineSummitAttendeeTicketRepository.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php index ce4f773aa..634401514 100644 --- a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php +++ b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php @@ -756,6 +756,7 @@ public function getAllByPage(PagingInfo $paging_info, Filter $filter = null, Ord $start = time(); Log::debug(sprintf('DoctrineSummitAttendeeTicketRepository::getAllByPage')); $total = $this->getFastCount($filter, $order); + if(!$total) return new PagingResponse(0, $paging_info->getPerPage(), $paging_info->getCurrentPage(), 0, []); $ids = $this->getAllIdsByPage($paging_info, $filter, $order); $query = $this->getEntityManager()->createQueryBuilder() ->select('e, a, o, tt, pc, b, bt, a_c, m') @@ -775,6 +776,10 @@ public function getAllByPage(PagingInfo $paging_info, Filter $filter = null, Ord $byId = []; foreach ($rows as $e) $byId[$e->getId()] = $e; + $rows = $query->getQuery()->getResult(); + $byId = []; + foreach ($rows as $e) $byId[$e->getId()] = $e; + $data = []; foreach ($ids as $id) { if (isset($byId[$id])) $data[] = $byId[$id]; From b5f7394382fa3c5e889dec4749c3bf0102d69744 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 30 Sep 2025 17:38:59 -0300 Subject: [PATCH 03/10] feat: Add OpenAPI documentation to "getAll" method - Add controller's response to OpenAPI schema --- .../Main/OAuth2GroupsApiController.php | 76 ++++++++++++++++++- app/Swagger/schemas.php | 22 ++++++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php index 067783469..b62dc2677 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php @@ -12,9 +12,12 @@ * limitations under the License. **/ +use App\Security\SummitScopes; +use Illuminate\Http\Response; use models\main\IGroupRepository; use models\oauth2\IResourceServerContext; use ModelSerializers\SerializerRegistry; +use OpenApi\Attributes as OA; /** * Class OAuth2GroupsApiController @@ -40,6 +43,77 @@ public function __construct $this->repository = $group_repository; } + #[OA\Get( + path: "/api/v1/groups", + description: "Get all groups with filtering and pagination. Groups are used for access control and organization of members. Requires OAuth2 authentication with appropriate scope.", + summary: 'Get all groups', + operationId: 'getAllGroups', + tags: ['Groups'], + security: [['summit_rsvp_oauth2' => [ + SummitScopes::ReadAllSummitData, + ]]], + parameters: [ + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token (alternative to Authorization: Bearer)', + schema: new OA\Schema(type: 'string', example: 'eyJhbGciOi...') + ), + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + description: 'Page number for pagination', + schema: new OA\Schema(type: 'integer', example: 1) + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + description: 'Items per page', + schema: new OA\Schema(type: 'integer', example: 10, maximum: 100) + ), + new OA\Parameter( + name: 'filter[]', + in: 'query', + required: false, + description: 'Filter expressions. Format: fieldvalue. Available fields: code (=@, ==, @@), title (=@, ==, @@). Operators: == (equals), =@ (starts with), @@ (contains)', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string', example: 'code==administrators') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s). Available fields: code, title, id. Use "-" prefix for descending order.', + schema: new OA\Schema(type: 'string', example: 'title') + ), + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + description: 'Comma-separated list of related resources to include. Available relations: members', + schema: new OA\Schema(type: 'string', example: 'members') + ), + ], + responses: [ + new OA\Response( + response: 200, + description: 'Success - Returns paginated list of groups', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedGroupsResponse') + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request - Invalid parameters"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized - Invalid or missing access token"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden - Insufficient permissions"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function getAll() { return $this->_getAll( @@ -71,4 +145,4 @@ function () { ); } -} \ No newline at end of file +} diff --git a/app/Swagger/schemas.php b/app/Swagger/schemas.php index b940875b5..f7b7470ff 100644 --- a/app/Swagger/schemas.php +++ b/app/Swagger/schemas.php @@ -579,6 +579,28 @@ class PaymentGatewayProfileCreateRequestSchema class PaymentGatewayProfileUpdateRequestSchema { } + + +#[OA\Schema( + schema: 'PaginatedGroupsResponse', + allOf: [ + new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), + new OA\Schema( + type: 'object', + properties: [ + new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/Group') + ) + ] + ) + ] +)] +class PaginatedGroupsResponseSchema +{ +} + // User Stories From dedf3c75728816b3c64e872d70cfa301548ae61d Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 13:08:02 -0300 Subject: [PATCH 04/10] chore: Revert to main version due to conflicts with rebase --- .../Summit/DoctrineSummitAttendeeTicketRepository.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php index 634401514..890fbceed 100644 --- a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php +++ b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php @@ -756,7 +756,6 @@ public function getAllByPage(PagingInfo $paging_info, Filter $filter = null, Ord $start = time(); Log::debug(sprintf('DoctrineSummitAttendeeTicketRepository::getAllByPage')); $total = $this->getFastCount($filter, $order); - if(!$total) return new PagingResponse(0, $paging_info->getPerPage(), $paging_info->getCurrentPage(), 0, []); $ids = $this->getAllIdsByPage($paging_info, $filter, $order); $query = $this->getEntityManager()->createQueryBuilder() ->select('e, a, o, tt, pc, b, bt, a_c, m') @@ -776,10 +775,6 @@ public function getAllByPage(PagingInfo $paging_info, Filter $filter = null, Ord $byId = []; foreach ($rows as $e) $byId[$e->getId()] = $e; - $rows = $query->getQuery()->getResult(); - $byId = []; - foreach ($rows as $e) $byId[$e->getId()] = $e; - $data = []; foreach ($ids as $id) { if (isset($byId[$id])) $data[] = $byId[$id]; @@ -797,4 +792,4 @@ public function getAllByPage(PagingInfo $paging_info, Filter $filter = null, Ord ); } -} \ No newline at end of file +} From 4f8b5968580114f565c9d47eb99920221fbd939f Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 31 Oct 2025 11:04:20 -0300 Subject: [PATCH 05/10] fix: comment --- .../Apis/Protected/Main/OAuth2GroupsApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php index b62dc2677..3fc1a64d4 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php @@ -29,7 +29,7 @@ final class OAuth2GroupsApiController extends OAuth2ProtectedController use ParametrizedGetAll; /** - * OAuth2MembersApiController constructor. + * OAuth2GroupsApiController constructor. * @param IGroupRepository $group_repository * @param IResourceServerContext $resource_server_context */ From c0c97b25f6e07209a2e528c10df0660db40ff66f Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 11 Nov 2025 20:58:13 +0000 Subject: [PATCH 06/10] fix: Add security schema --- .../Main/OAuth2GroupsApiController.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php index 3fc1a64d4..13472aa34 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php @@ -19,6 +19,26 @@ use ModelSerializers\SerializerRegistry; use OpenApi\Attributes as OA; + +#[OA\SecurityScheme( + type: 'oauth2', + securityScheme: 'groups_oauth2', + flows: [ + new OA\Flow( + authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, + tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, + flow: 'authorizationCode', + scopes: [ + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::ReadSummitData => 'Read Summit Data', + '%s/groups/read' => 'Read Groups Data', + ], + ), + ], + ) +] +class RSVPAuthSchema{} + /** * Class OAuth2GroupsApiController * @package App\Http\Controllers @@ -49,8 +69,10 @@ public function __construct summary: 'Get all groups', operationId: 'getAllGroups', tags: ['Groups'], - security: [['summit_rsvp_oauth2' => [ + security: [['groups_oauth2' => [ SummitScopes::ReadAllSummitData, + SummitScopes::ReadSummitData, + '%s/groups/read', ]]], parameters: [ new OA\Parameter( From 196ebeaa3e72b8248965010ad7e92757e155d987 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 11 Nov 2025 21:04:42 +0000 Subject: [PATCH 07/10] fix: security schema class name --- .../Apis/Protected/Main/OAuth2GroupsApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php index 13472aa34..2cadb53dc 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php @@ -37,7 +37,7 @@ ], ) ] -class RSVPAuthSchema{} +class GroupsOAuthSchema{} /** * Class OAuth2GroupsApiController From c6c76d4b5b17fa06d46f5ccf28715e392662f736 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 13 Nov 2025 18:44:12 +0000 Subject: [PATCH 08/10] chore: ReadGroupsData was added to SummitScopes and the security schema was moved to its own file --- .../Main/OAuth2GroupsApiController.php | 42 ++++++------------- app/Security/SummitScopes.php | 7 +++- app/Swagger/Security/GroupsOAuthSchema.php | 26 ++++++++++++ 3 files changed, 44 insertions(+), 31 deletions(-) create mode 100644 app/Swagger/Security/GroupsOAuthSchema.php diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php index 2cadb53dc..9f1104587 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php @@ -1,4 +1,5 @@ - 'Read All Summit Data', - SummitScopes::ReadSummitData => 'Read Summit Data', - '%s/groups/read' => 'Read Groups Data', - ], - ), - ], - ) -] -class GroupsOAuthSchema{} - /** * Class OAuth2GroupsApiController * @package App\Http\Controllers @@ -55,10 +36,9 @@ final class OAuth2GroupsApiController extends OAuth2ProtectedController */ public function __construct ( - IGroupRepository $group_repository, + IGroupRepository $group_repository, IResourceServerContext $resource_server_context - ) - { + ) { parent::__construct($resource_server_context); $this->repository = $group_repository; } @@ -69,11 +49,15 @@ public function __construct summary: 'Get all groups', operationId: 'getAllGroups', tags: ['Groups'], - security: [['groups_oauth2' => [ - SummitScopes::ReadAllSummitData, - SummitScopes::ReadSummitData, - '%s/groups/read', - ]]], + security: [ + [ + 'groups_oauth2' => [ + SummitScopes::ReadAllSummitData, + SummitScopes::ReadSummitData, + SummitScopes::ReadGroupsData, + ] + ] + ], parameters: [ new OA\Parameter( name: 'access_token', diff --git a/app/Security/SummitScopes.php b/app/Security/SummitScopes.php index f8869c38b..9470449a2 100644 --- a/app/Security/SummitScopes.php +++ b/app/Security/SummitScopes.php @@ -1,4 +1,5 @@ - 'Read All Summit Data', + SummitScopes::ReadSummitData => 'Read Summit Data', + SummitScopes::ReadGroupsData => 'Read Groups Data', + ], + ), + ], +) +] +class GroupsOAuthSchema +{ +} \ No newline at end of file From 8a7cd800a42d198a18423ad01aa0f747120a5e97 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 20 Nov 2025 22:37:00 +0000 Subject: [PATCH 09/10] chore: add requested changes in PR --- .../Main/OAuth2GroupsApiController.php | 2 +- app/Swagger/Models/GroupSchema.php | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 app/Swagger/Models/GroupSchema.php diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php index 9f1104587..6d91c5519 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2GroupsApiController.php @@ -103,7 +103,7 @@ public function __construct name: 'expand', in: 'query', required: false, - description: 'Comma-separated list of related resources to include. Available relations: members', + description: 'Comma-separated list of related resources to include. Available relations: members (expands member IDs to full member objects)', schema: new OA\Schema(type: 'string', example: 'members') ), ], diff --git a/app/Swagger/Models/GroupSchema.php b/app/Swagger/Models/GroupSchema.php new file mode 100644 index 000000000..3c2212f54 --- /dev/null +++ b/app/Swagger/Models/GroupSchema.php @@ -0,0 +1,30 @@ + Date: Tue, 2 Dec 2025 21:20:13 +0000 Subject: [PATCH 10/10] chore: change namespace --- app/Swagger/Security/GroupsOAuthSchema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Swagger/Security/GroupsOAuthSchema.php b/app/Swagger/Security/GroupsOAuthSchema.php index b5b996621..a58b97ce2 100644 --- a/app/Swagger/Security/GroupsOAuthSchema.php +++ b/app/Swagger/Security/GroupsOAuthSchema.php @@ -1,5 +1,5 @@