From 3fdcb841aadff03c9ff581a670b873c076664a64 Mon Sep 17 00:00:00 2001 From: matiasperrone-exo Date: Wed, 4 Feb 2026 22:50:16 +0000 Subject: [PATCH 1/6] chore: Initial setup for OpenAPI 3.1 documentation Signed-off-by: matiasperrone-exo --- .env.example | 6 +++--- config/l5-swagger.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 0e19658e..9afe5d6e 100644 --- a/.env.example +++ b/.env.example @@ -153,8 +153,8 @@ OTEL_TRACES_SAMPLER_PARENT=false # OpenAPI CONFIG (former Swagger) L5_SWAGGER_CONST_HOST=${APP_URL} -L5_SWAGGER_CONST_AUTH_URL='/oauth2/auth' -L5_SWAGGER_CONST_TOKEN_URL='/oauth2/token' +L5_SWAGGER_CONST_AUTH_URL=${IDP_AUTHORIZATION_ENDPOINT} +L5_SWAGGER_CONST_TOKEN_URL=${IDP_TOKEN_ENDPOINT} # L5_FORMAT_TO_USE_FOR_DOCS=yaml L5_SWAGGER_GENERATE_ALWAYS=true # Dev setting -L5_SWAGGER_OPEN_API_SPEC_VERSION=3.1.2 +L5_SWAGGER_OPEN_API_SPEC_VERSION=3.2.0 diff --git a/config/l5-swagger.php b/config/l5-swagger.php index 6cf40432..aae36dbb 100644 --- a/config/l5-swagger.php +++ b/config/l5-swagger.php @@ -6,7 +6,7 @@ 'documentations' => [ 'default' => [ 'api' => [ - 'title' => 'OpenStackID API Swagger UI', + 'title' => 'Summit API Swagger UI', ], 'routes' => [ From 771bd6f0ea7b6c20e53bec4589447bc423ae194b Mon Sep 17 00:00:00 2001 From: matiasperrone-exo Date: Thu, 5 Feb 2026 19:40:45 +0000 Subject: [PATCH 2/6] chore: Move to OpenAPI v3.1.2 so UI supports it Signed-off-by: matiasperrone-exo --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 9afe5d6e..c2886741 100644 --- a/.env.example +++ b/.env.example @@ -157,4 +157,4 @@ L5_SWAGGER_CONST_AUTH_URL=${IDP_AUTHORIZATION_ENDPOINT} L5_SWAGGER_CONST_TOKEN_URL=${IDP_TOKEN_ENDPOINT} # L5_FORMAT_TO_USE_FOR_DOCS=yaml L5_SWAGGER_GENERATE_ALWAYS=true # Dev setting -L5_SWAGGER_OPEN_API_SPEC_VERSION=3.2.0 +L5_SWAGGER_OPEN_API_SPEC_VERSION=3.1.2 From 23e4b331d9af8255dd672514118fc0b0e0466ec8 Mon Sep 17 00:00:00 2001 From: matiasperrone-exo Date: Wed, 11 Feb 2026 22:42:10 +0000 Subject: [PATCH 3/6] update .env.example with right values for OpenAPI docs Signed-off-by: matiasperrone-exo --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index c2886741..0e19658e 100644 --- a/.env.example +++ b/.env.example @@ -153,8 +153,8 @@ OTEL_TRACES_SAMPLER_PARENT=false # OpenAPI CONFIG (former Swagger) L5_SWAGGER_CONST_HOST=${APP_URL} -L5_SWAGGER_CONST_AUTH_URL=${IDP_AUTHORIZATION_ENDPOINT} -L5_SWAGGER_CONST_TOKEN_URL=${IDP_TOKEN_ENDPOINT} +L5_SWAGGER_CONST_AUTH_URL='/oauth2/auth' +L5_SWAGGER_CONST_TOKEN_URL='/oauth2/token' # L5_FORMAT_TO_USE_FOR_DOCS=yaml L5_SWAGGER_GENERATE_ALWAYS=true # Dev setting L5_SWAGGER_OPEN_API_SPEC_VERSION=3.1.2 From 094bb417c64a45162d5f72138034d4654fe04e6c Mon Sep 17 00:00:00 2001 From: matiasperrone-exo Date: Thu, 12 Feb 2026 19:14:00 +0000 Subject: [PATCH 4/6] chore: change API name in config Signed-off-by: matiasperrone-exo --- config/l5-swagger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/l5-swagger.php b/config/l5-swagger.php index aae36dbb..6cf40432 100644 --- a/config/l5-swagger.php +++ b/config/l5-swagger.php @@ -6,7 +6,7 @@ 'documentations' => [ 'default' => [ 'api' => [ - 'title' => 'Summit API Swagger UI', + 'title' => 'OpenStackID API Swagger UI', ], 'routes' => [ From c25f22254f08c1fb866e7f687b002886712ba285 Mon Sep 17 00:00:00 2001 From: matiasperrone-exo Date: Wed, 11 Feb 2026 22:34:43 +0000 Subject: [PATCH 5/6] feat: Add OpenAPI documentation annotations for OAuth2UserRegistrationRequestApiController Signed-off-by: matiasperrone-exo --- ...h2UserRegistrationRequestApiController.php | 134 ++++++++++++++++++ .../Models/UserRegistrationRequestSchema.php | 27 ++++ ...egistrationRequestApiControllerSchemas.php | 26 ++++ ...teUserRegistrationRequestRequestSchema.php | 45 ++++++ ...teUserRegistrationRequestRequestSchema.php | 38 +++++ .../UserRegistrationRequestFieldsSchema.php | 48 +++++++ ...tionRequestApiControllerSecurityScheme.php | 34 +++++ 7 files changed, 352 insertions(+) create mode 100644 app/Swagger/Models/UserRegistrationRequestSchema.php create mode 100644 app/Swagger/OAuth2UserRegistrationRequestApiControllerSchemas.php create mode 100644 app/Swagger/Requests/CreateUserRegistrationRequestRequestSchema.php create mode 100644 app/Swagger/Requests/UpdateUserRegistrationRequestRequestSchema.php create mode 100644 app/Swagger/Requests/UserRegistrationRequestFieldsSchema.php create mode 100644 app/Swagger/Security/OAuth2UserRegistrationRequestApiControllerSecurityScheme.php diff --git a/app/Http/Controllers/Api/OAuth2/OAuth2UserRegistrationRequestApiController.php b/app/Http/Controllers/Api/OAuth2/OAuth2UserRegistrationRequestApiController.php index f9709d22..3d463cac 100644 --- a/app/Http/Controllers/Api/OAuth2/OAuth2UserRegistrationRequestApiController.php +++ b/app/Http/Controllers/Api/OAuth2/OAuth2UserRegistrationRequestApiController.php @@ -14,6 +14,7 @@ use App\Http\Controllers\GetAllTrait; use App\libs\Auth\Repositories\IUserRegistrationRequestRepository; +use App\libs\OAuth2\IUserScopes; use App\ModelSerializers\SerializerRegistry; use App\Services\Auth\IUserService; use Illuminate\Support\Facades\Log; @@ -22,6 +23,8 @@ use models\exceptions\EntityNotFoundException; use models\exceptions\ValidationException; use OAuth2\IResourceServerContext; +use OpenApi\Attributes as OA; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Utils\Services\ILogService; /** * Class OAuth2UserRegistrationRequestApiController @@ -43,6 +46,58 @@ final class OAuth2UserRegistrationRequestApiController extends OAuth2ProtectedCo * @param IResourceServerContext $resource_server_context * @param ILogService $log_service */ + #[OA\Get( + path: '/api/v1/user-registration-requests', + operationId: 'getUserRegistrationRequests', + summary: 'Get all user registration requests', + security: [['OAuth2UserRegistrationRequestApi' => [IUserScopes::Registration]]], + tags: ['User Registration Requests'], + parameters: [ + new OA\Parameter( + name: 'page', + description: 'Page number', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'per_page', + description: 'Items per page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'filter', + description: 'Filter criteria (first_name, last_name, email, is_redeemed) ("=@" starts with, "==" exact match)', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string') + ), + new OA\Parameter( + name: 'order', + description: 'Order criteria (id)', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response( + response: HttpResponse::HTTP_OK, + description: 'OK', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedUserRegistrationRequestResponse') + ), + new OA\Response( + response: HttpResponse::HTTP_PRECONDITION_FAILED, + description: 'Precondition Failed' + ), + new OA\Response( + response: HttpResponse::HTTP_INTERNAL_SERVER_ERROR, + description: 'Server Error' + ), + ] + )] public function __construct ( IUserRegistrationRequestRepository $repository, @@ -97,6 +152,41 @@ protected function getFilterValidatorRules(): array /** * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Post( + path: '/api/v1/user-registration-requests', + operationId: 'createUserRegistrationRequest', + summary: 'Create a user registration request', + security: [['OAuth2UserRegistrationRequestApi' => [IUserScopes::Registration]]], + tags: ['User Registration Requests'], + requestBody: new OA\RequestBody( + description: 'User registration request data', + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/CreateUserRegistrationRequestRequest') + ), + responses: [ + new OA\Response( + response: HttpResponse::HTTP_CREATED, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/UserRegistrationRequest') + ), + new OA\Response( + response: HttpResponse::HTTP_BAD_REQUEST, + description: 'Bad Request' + ), + new OA\Response( + response: HttpResponse::HTTP_PRECONDITION_FAILED, + description: 'Precondition Failed' + ), + new OA\Response( + response: HttpResponse::HTTP_NOT_FOUND, + description: 'Not Found' + ), + new OA\Response( + response: HttpResponse::HTTP_INTERNAL_SERVER_ERROR, + description: 'Server Error' + ), + ] + )] public function register(){ try { @@ -148,6 +238,50 @@ public function register(){ * @param $id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Put( + path: '/api/v1/user-registration-requests/{id}', + operationId: 'updateUserRegistrationRequest', + summary: 'Update a user registration request', + security: [['OAuth2UserRegistrationRequestApi' => [IUserScopes::Registration]]], + tags: ['User Registration Requests'], + parameters: [ + new OA\Parameter( + name: 'id', + description: 'Registration request ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + ], + requestBody: new OA\RequestBody( + description: 'User registration request data to update', + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/UpdateUserRegistrationRequestRequest') + ), + responses: [ + new OA\Response( + response: HttpResponse::HTTP_OK, + description: 'OK', + content: new OA\JsonContent(ref: '#/components/schemas/UserRegistrationRequest') + ), + new OA\Response( + response: HttpResponse::HTTP_BAD_REQUEST, + description: 'Bad Request' + ), + new OA\Response( + response: HttpResponse::HTTP_PRECONDITION_FAILED, + description: 'Precondition Failed' + ), + new OA\Response( + response: HttpResponse::HTTP_NOT_FOUND, + description: 'Not Found' + ), + new OA\Response( + response: HttpResponse::HTTP_INTERNAL_SERVER_ERROR, + description: 'Server Error' + ), + ] + )] public function update($id){ try { diff --git a/app/Swagger/Models/UserRegistrationRequestSchema.php b/app/Swagger/Models/UserRegistrationRequestSchema.php new file mode 100644 index 00000000..0e9e61e4 --- /dev/null +++ b/app/Swagger/Models/UserRegistrationRequestSchema.php @@ -0,0 +1,27 @@ + "User registration", + ] + ), + ] +)] +class OAuth2UserRegistrationRequestApiControllerSecurityScheme +{ +} From 3389ba3c75e27e9f659bf5675fd8038cf5c2197e Mon Sep 17 00:00:00 2001 From: matiasperrone-exo Date: Thu, 12 Feb 2026 19:20:53 +0000 Subject: [PATCH 6/6] fix: Update OAuth2GroupsSecurity security scheme to use constants for URLs Signed-off-by: matiasperrone-exo --- ...serRegistrationRequestApiControllerSecurityScheme.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Swagger/Security/OAuth2UserRegistrationRequestApiControllerSecurityScheme.php b/app/Swagger/Security/OAuth2UserRegistrationRequestApiControllerSecurityScheme.php index fc12c69b..99829ec1 100644 --- a/app/Swagger/Security/OAuth2UserRegistrationRequestApiControllerSecurityScheme.php +++ b/app/Swagger/Security/OAuth2UserRegistrationRequestApiControllerSecurityScheme.php @@ -1,4 +1,5 @@ - "User registration", ] @@ -31,4 +32,4 @@ )] class OAuth2UserRegistrationRequestApiControllerSecurityScheme { -} +} \ No newline at end of file