solo-io / gloo-portal-issues

Public tracker for issues related to Gloo Portal
https://docs.solo.io/gloo-portal/latest/
1 stars 3 forks source link

Provide more detail on customizing CORS configuration in Gloo Portal in Official Docs #121

Open ably77 opened 2 years ago

ably77 commented 2 years ago

Describe the requested changes Provide doc examples for customizing CORS configuration for Gloo Portal + Edge, Istio, and GMG in these forms

It would be good to have specific examples including outputs so that the user can validate/debug that their CORS configuration is correct. The current docs just state: "If cors is set, the default config provided by Gloo Portal on the VirtualService or VirtualHost will be overridden for this route. It will be up to the user to make sure CORS is configured correctly to work with the “Try it out” feature in the Developer Portal UI." and can be ambiguous

For example, the Environment CR with customized cors options can generate a Gloo Edge VirtualService as well as an Istio VirtualService where the cors policy is different

Generated Gloo Edge VS:

cors:
          allowCredentials: true
          allowHeaders:
          - api-key
          - Authorization
          allowOrigin:
          - http://portal.mycompany.corp
          - https://portal.mycompany.corp

Generated Istio VS:

- corsPolicy:
      allowHeaders:
      - api-key
      - Authorization
      allowOrigins:
        - exact: http://petstore.example.com
        - exact: https://petstore.example.com

Link to any relevant existing docs

Reference to these issues: https://github.com/solo-io/gloo-portal-issues/issues/120 https://github.com/solo-io/gloo-portal-issues/issues/106 and these docs: https://docs.solo.io/gloo-portal/latest/reference/api/environment/#environmentspec-gatewayconfig https://docs.solo.io/gloo-portal/latest/reference/api/route/#routespec

Browser Information If the change isn't related to content, please include your browser version and any other relevant information (e.g., browser zoom) to help us reproduce docs-related bugs.

Additional context Add any other context about the problem here.