Repository navigation
Api gateway - #1
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Spring Cloud API Gateway service and updates the user-service configuration to support running behind the gateway with environment-driven settings.
Changes:
- Introduces a new
api-gatewaySpring Boot service (Gateway routes, WebFlux Security, Docker/Maven wrapper scaffolding). - Updates
user-serviceconfiguration (port, app name, env-var DB config, JWT settings, actuator exposure). - Enables actuator endpoint exposure (health/info/prometheus) across services.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| services/user-service/src/main/resources/application.yml | Configures user-service port, DB env vars, JWT settings, and actuator exposure. |
| services/api-gateway/src/main/java/com/platformops/api_gateway/ApiGatewayApplication.java | Adds API gateway Spring Boot entrypoint. |
| services/api-gateway/src/main/java/com/platformops/api_gateway/SecurityConfig.java | Adds WebFlux security with JWT resource-server configuration. |
| services/api-gateway/src/main/resources/application.yml | Configures gateway port, routes to user-service, and resource-server issuer URI. |
| services/api-gateway/src/test/java/com/platformops/api_gateway/ApiGatewayApplicationTests.java | Adds basic context-load test. |
| services/api-gateway/pom.xml | Adds Gateway/WebFlux/Security/Actuator/Prometheus dependencies. |
| services/api-gateway/Dockerfile | Container build for the gateway service. |
| services/api-gateway/mvnw / mvnw.cmd / .mvn/wrapper/maven-wrapper.properties | Maven wrapper scripts/config for the gateway module. |
| services/api-gateway/.gitignore | Module-local ignores for build/IDE artifacts. |
| services/api-gateway/.gitattributes | Line-ending settings for wrapper scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,12 +1,29 @@ | |||
| server: | |||
| port: 8081 | |||
There was a problem hiding this comment.
server.port is set to 8081, but the existing container/compose setup still exposes 8080 for user-service (see services/user-service/Dockerfile EXPOSE 8080 and docker-compose.yml mapping 8080:8080). This will make the service unreachable unless those are updated (or revert the port to 8080 and update the gateway accordingly).
| endpoints: | ||
| web: | ||
| exposure: | ||
| include: health,info,prometheus |
There was a problem hiding this comment.
The config exposes the prometheus actuator endpoint, but user-service does not include micrometer-registry-prometheus in its dependencies, so /actuator/prometheus will not be available. Either add the Prometheus registry dependency or remove prometheus from the exposure list to avoid a misleading configuration.
| include: health,info,prometheus | |
| include: health,info |
| show-sql: true | ||
|
|
||
| jwt: | ||
| secret: ${JWT_SECRET:404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970} |
There was a problem hiding this comment.
jwt.secret has a committed default value. Keeping a usable default secret in source control makes it easy to accidentally deploy insecurely. Prefer requiring JWT_SECRET to be set (no default), or load it from a secret store/config tree so the app fails fast when missing.
| secret: ${JWT_SECRET:404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970} | |
| secret: ${JWT_SECRET} |
… repository, and service classes
…ons and Kafka integration - Added Maven configuration for order service. - Implemented main application class for Spring Boot. - Created OrderController with endpoints for creating and retrieving orders. - Defined OrderRequest and OrderResponse DTOs for request and response handling. - Developed Order entity with JPA annotations for database mapping. - Created OrderRepository interface for data access. - Implemented OrderService for business logic related to orders. - Configured application properties for PostgreSQL and Kafka. - Added unit tests for application context loading. feat(payment-service): implement payment service with Kafka producer - Created Dockerfile for payment service. - Implemented main application logic with Gin framework. - Developed PaymentHandler for handling payment requests. - Created Kafka producer for publishing payment events. - Defined PaymentService for processing payments and emitting events. - Added model definitions for PaymentRequest and PaymentResponse. fix(risk-service): update Dockerfile for Python application - Changed base image to Python 3.11 and configured for Uvicorn server. feat(user-service): add Redis dependency and update application configuration - Added Redis starter dependency for user service. - Updated application properties for PostgreSQL and Redis configuration. - Refactored JWT security settings for improved clarity.
No description provided.