Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable authentication on generated CORS options #179

Conversation

JordonPhillips
Copy link
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