Remove gRPC-related classes and proto-generated files no longer in us…#2
Remove gRPC-related classes and proto-generated files no longer in us…#2OmmrGAZAR315 wants to merge 12 commits intomainfrom
Conversation
…e to streamline the codebase.
…, controllers, and request/response handling. Integrate `GrpcServiceProvider` and update configuration and bootstrap files.
…eamline request handling, and introduce `CartController`. Update Docker environment variables and image version for compatibility. Remove unused gRPC config.
…ust method visibility, and refine service definitions.
There was a problem hiding this comment.
Pull Request Overview
This PR removes obsolete proto-generated gRPC files and classes, streamlines service routing, and introduces a dynamic gateway for handling flexible gRPC requests.
- Deleted unused HealthService and GPBMetadata proto artifacts.
- Added
GrpcRouteRegistryandGrpcServiceRouterfor dynamic service/method routing. - Introduced
UserGrpcServiceand updated Cart/HTTP proxy services to use a gateway pattern.
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| app/Grpc/Services/UserGrpcService.php | Added gateway service to forward flexible gRPC calls |
| app/Grpc/Services/GrpcService.php | New HTTP-to-gRPC proxy (proxyRequest/dispatchGrpcRequest) |
| app/Grpc/GrpcRouteRegistry.php | New static registry for service-method mappings |
| app/Grpc/GrpcRoute.php | Fluent interface for registering gRPC routes |
| app/Console/Commands/GrpcServeCommand.php | Updated server command to handle UserGrpcService |
| app/Grpc/GPBMetadata/User/UserService.php | Removed generated proto metadata for UserService |
| $responseData = new Any(); | ||
| $resource = new UserResource($user); | ||
| $responseData->setValue(json_encode([ | ||
| 'data' => $resource |
There was a problem hiding this comment.
[nitpick] Passing a UserResource object directly into json_encode may not yield the expected structure; consider converting it to an array (e.g., $resource->toArray()) before encoding.
| 'data' => $resource | |
| 'data' => $resource->toArray() |
|
|
||
| namespace App\Grpc\Services; | ||
|
|
||
| use App\Grpc\Controllers\BaseGrpcService; |
There was a problem hiding this comment.
The BaseGrpcService import is not referenced in this file; remove the unused import to clean up the code.
| use App\Grpc\Controllers\BaseGrpcService; |
| if ($bearerToken = request()->bearerToken()) | ||
| $metadata['authorization'] = ['Bearer ' . $bearerToken]; |
There was a problem hiding this comment.
[nitpick] Use braces for the if statement to avoid ambiguity and make future expansions safer (e.g., if (...) { ... }).
| if ($bearerToken = request()->bearerToken()) | |
| $metadata['authorization'] = ['Bearer ' . $bearerToken]; | |
| if ($bearerToken = request()->bearerToken()) { | |
| $metadata['authorization'] = ['Bearer ' . $bearerToken]; | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…methods, simplify request handling, and adjust service definitions for improved consistency and maintainability.
…pdate ProductHandler for dependency injection
…cAuthMiddleware`, and migrate `logout` method from UserServer.
…e to streamline the codebase.