feat(gateway): support Private Network Access (PNA) in CORS preflight#15957
feat(gateway): support Private Network Access (PNA) in CORS preflight#15957
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces support for Private Network Access (PNA) within the API Gateway's CORS preflight handling. By adding a new configuration option, Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for Private Network Access (PNA) in CORS preflight requests. This involves adding an allowPrivateNetwork boolean field to the CORS configuration across the UI, API definition models, and gateway processors (both V2 and Reactive). The UI now includes a toggle for this setting, and the gateway logic has been updated to respond with Access-Control-Allow-Private-Network: true when enabled and requested. Associated serialization, deserialization, OpenAPI documentation, and test cases have also been updated. Review comments suggest improving maintainability by defining hardcoded header names as constants in the gateway processors and their respective tests.
...main/java/io/gravitee/gateway/handlers/api/processor/cors/CorsPreflightRequestProcessor.java
Show resolved
Hide resolved
.../io/gravitee/gateway/reactive/handlers/api/processor/cors/CorsPreflightRequestProcessor.java
Show resolved
Hide resolved
...gravitee/gateway/reactive/handlers/api/processor/cors/CorsPreflightRequestProcessorTest.java
Outdated
Show resolved
Hide resolved
306cbad to
3be1b20
Compare
|



Summary
allowPrivateNetworkboolean to CORS config model (defaultfalse)Access-Control-Allow-Private-Network: trueto preflight requests containingAccess-Control-Request-Private-Network: trueFixes APIM-13215
Test plan
allowPrivateNetwork