Skip to content

Disable authentication on generated CORS options#179

Merged
JordonPhillips merged 1 commit intosmithy-lang:masterfrom
JordonPhillips:dont-authenticate-cors-options
Oct 4, 2019
Merged

Disable authentication on generated CORS options#179
JordonPhillips merged 1 commit intosmithy-lang:masterfrom
JordonPhillips:dont-authenticate-cors-options

Conversation

@JordonPhillips
Copy link
Copy Markdown
Contributor

@JordonPhillips JordonPhillips commented Oct 3, 2019

CORS preflight options checks are sent without authentication, and so
the generated OPTIONS integrations should have an empty
"security" list.

To enable this, I made the list of security settings an Optional to distinguish between an empty list and a list that wasn't set. This is a bit odd in terms of the rest of the code base where we simply don't serialize empty lists. It's needed so that we can special case the OPTIONS methods from the general "security" setting. The alternative is to explicitly set the "security" setting on every method, which seems like it would be error prone.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

CORS preflight options checks are sent without authentication, and so
the generated OPTIONS integrations should have an empty
"security" list.
@JordonPhillips JordonPhillips force-pushed the dont-authenticate-cors-options branch from 67661c9 to 9c9eca5 Compare October 3, 2019 18:17
@mtdowling mtdowling self-requested a review October 3, 2019 20:54
@JordonPhillips JordonPhillips merged commit 82416a5 into smithy-lang:master Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants