{"id":20807062,"url":"https://github.com/pmvieira93/personalized-api-gateway","last_synced_at":"2026-05-02T11:38:13.510Z","repository":{"id":247411290,"uuid":"822684233","full_name":"pmvieira93/personalized-api-gateway","owner":"pmvieira93","description":"Personalized API Gateway with Customized Predicates and Filters (By: Spring Cloud Gateway)","archived":false,"fork":false,"pushed_at":"2024-12-04T15:06:01.000Z","size":404,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T13:39:24.272Z","etag":null,"topics":["api","cloud","gateway","java","maven","personalization","spring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmvieira93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-01T15:51:57.000Z","updated_at":"2024-11-27T10:43:24.000Z","dependencies_parsed_at":"2024-11-28T10:34:45.366Z","dependency_job_id":null,"html_url":"https://github.com/pmvieira93/personalized-api-gateway","commit_stats":null,"previous_names":["pmvieira93/personalized-api-gateway"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvieira93%2Fpersonalized-api-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvieira93%2Fpersonalized-api-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvieira93%2Fpersonalized-api-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvieira93%2Fpersonalized-api-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmvieira93","download_url":"https://codeload.github.com/pmvieira93/personalized-api-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243152875,"owners_count":20244657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cloud","gateway","java","maven","personalization","spring"],"created_at":"2024-11-17T19:30:32.146Z","updated_at":"2025-12-25T11:52:19.260Z","avatar_url":"https://github.com/pmvieira93.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Cloud Gateway\n\n## Initializer\n\n### Docker Commands\n\nRun Service\n```bash\ndocker-compose up --build -d\n```\n\nStop Service\n```bash\ndocker-compose down\n```\n\n### Setup FGA \u0026 Environment\n\nInitializer FGA Service\n```bash\nnewman run fga-initializer.postman_collection.json --export-globals ./target/generated-ids.json\n```\n\nParse IDs into `.env` file\n```bash\njq -r '.values | map(\"export \\(.key|sub(\"-\";\"_\"; \"g\")|ascii_upcase)=\\(.value|tostring)\")|.[]' ./target/generated-ids.json \u003e ./target/.spring-env\n```\n\nLoad Env variables\n```bash\nsource .spring-env\n```\n\n## Maven Commands\n\nRun application\n```bash\nmvnw spring-boot:run\n```\n\nDebug mode\n```bash\nmvnw spring-boot:run -Dspring-boot.run.jvmArguments=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005\"\n```\n\nCompile Application\n```bash\nmvnw clean compile\n```\n\n## Test Commands\n\n### Unit \u0026 Integration Tests\n\n```bash\nmvnw verify\n```\n\nRunning all tests\n```bash\nmvnw test\n```\n\nRunning specific test class\n```bash\nmvnw -Dtest=RouteGatewayFilterIntegrationTest test\n```\n\n### Manually Tests\n\nTesting Routes using default Predicates/Filters\n\n```bash\n# Test Route: 'code_rewrite_route'\ncurl -v 'http://localhost:8080/foo/ip' -H 'host: pedro.rewrite.org'\n\n# Test Route: 'yml_header_path_rewrite_route'\ncurl -v 'http://localhost:8080/self/ip' -H 'X-Request-Id: 123'\n```\n\n## Personalized Filters and Predicates\n\n\n### Manually Tests\n\nTesting Routes using personalized Predicates/Filters\n\n**ApiVersionValidation**\n\n```bash\n# Test Route: 'code_path_rewrite_apiversion_route'\n#   \u003e Expected: 200\ncurl -v 'http://localhost:8080/version/ip' -H 'api-version: 4.5.0'\n#   \u003e Expected: 403\ncurl -v 'http://localhost:8080/version/ip' -H 'api-version: 1.5.0'\n```\n\n```bash\n# Test Route: 'httpbin_apiversionfilter_v1_route' (Default Header)\n#   \u003e Expected: 200\ncurl -v 'http://localhost:8080/v1/ip' -H 'api-version: 4.5.0'\n#   \u003e Expected: 403\ncurl -v 'http://localhost:8080/v1/ip' -H 'api-version: 1.5.0'\n\n# Test Route: 'httpbin_apiversionfilter_v1_route' (Configured Header)\n#   \u003e Expected: 200\ncurl -v 'http://localhost:8080/v1/ip' -H 'ApiVersion: 4.5.0'\n#   \u003e Expected: 403\ncurl -v 'http://localhost:8080/v1/ip' -H 'ApiVersion: 1.5.0'\n```\n\n**TraceRequest**\n\n```bash\n# Test Route: 'httpbin_trace_route'\n#   \u003e Expected: 200\ncurl -v 'http://localhost:8080/trace/ip' -H 'dummy: trace'\n```\n\n## References\n\n- [Creating a custom Spring Cloud Gateway Filter](https://spring.io/blog/2022/08/26/creating-a-custom-spring-cloud-gateway-filter)\n- [Building a Gateway](https://spring.io/guides/gs/gateway)\n- [Spring Cloud Gateway Sample](https://github.com/spring-cloud-samples/spring-cloud-gateway-sample)\n- [Properties with Spring](https://www.baeldung.com/properties-with-spring)\n- [Writing Custom Spring Cloud Gateway Filters](https://www.baeldung.com/spring-cloud-custom-gateway-filters)\n- [gatewayapp.routes](https://github.com/eugenp/tutorials/blob/master/spring-cloud-modules/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/routes/ServiceRouteConfiguration.java)\n- [RewritePath GatewayFilter Factory](https://docs.spring.io/spring-cloud-gateway/reference/spring-cloud-gateway/gatewayfilter-factories/rewritepath-factory.html)\n- [Class RewritePathGatewayFilterFactory](https://www.javadoc.io/static/org.springframework.cloud/spring-cloud-gateway-core/2.2.0.RELEASE/org/springframework/cloud/gateway/filter/factory/RewritePathGatewayFilterFactory.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmvieira93%2Fpersonalized-api-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmvieira93%2Fpersonalized-api-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmvieira93%2Fpersonalized-api-gateway/lists"}