Ukpaa Chigozie
/users/{userId}
to fetch user details, while the Product Service has an endpoint /products/{productId}
to retrieve product information. We want to expose these endpoints through the microgateway.Dockerfile
(with no extension) in the project directory and add the following content :/mygateway
, copy the compiled microgateway JAR file (mygateway-0.0.1-SNAPSHOT.jar
) into the container as mygateway-0.0.1-SNAPSHOT.jar.original
, expose port 8080, and define the entrypoint command to run the microgateway. Save the Dockerfile and proceed to the next step.http://localhost:8080/users/{userId}
or http://localhost:8080/products/{productId}
, replacing {userId}
and {productId}
with the desired values.SecurityConfig
in the com.example.mygateway.config
package.configureGlobal
method configures an in-memory user with the username "admin" and a password encoded with BCrypt
. You can modify this method to integrate with your own user authentication system.apiKeyFilter
) that intercepts incoming requests and checks for the presence and validity of an API key. The isValidApiKey
method sends a request to the API Key management service (specified by the apiKeyUrl
property) to validate the API key. You should modify this method to integrate with your own API Key management system.microgateway-deployment.yaml
file.EXTERNAL-IP
column for the my-microgateway-service
. If the external IP is pending or not yet available, wait for a few moments and re-run the command.http://<EXTERNAL-IP>
.