Make it easier to configure CORS
As an API developer all I want to is "enable CORS" and not have to get bogged down by all configuration settings - perhaps Kusk could provide a "CORS templates" (configurable?) - which I could refer to - i.e.
x-kusk:
cors:
template: default
which would expand to whatever we think is a reasonable default setting for CORS. The possibility to configure other templates would be at the kusk-gateway level - perhaps via a CRD!?
Maybe we can even autogenerate CORS?
Current CORS configuration looks like this:
cors:
origins:
- 'http://example.org'
- 'http://example.com'
methods:
- POST
- PATCH
- DELETE
- PUT
- GET
- OPTIONS
headers:
- Content-Type
credentials: true
max_age: 86200
We can get hosts, methods, headers from open api spec?
duh - why didn't I think of that! We should definitely be able to auto-generate some of these (methods, hosts, headers) - perhaps this could be a template: auto setting!?