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

fix: Defining CORS when ApiKeyRequired is true results in an OPTIONS method that requires an API key #2981

Merged
merged 17 commits into from
Mar 10, 2023

Conversation

ConnorRobertson
Copy link

@ConnorRobertson ConnorRobertson commented Mar 1, 2023

Issue #, if available

#1786

Description of changes

Created a property of AWS::Serverless::Api::Auth called AddApiKeyRequiredToCorsPreflight. When set to false does not apply ApiKeyRequired to Cors Preflight requests. By Default set to true.

Description of how you validated changes

Transformed a template that had the issue where ApiKeyRequired was being applied to CorsPreflight requests. Set AddApiKeyRequired to Cors Preflight to false. Checked if the transformed template required an ApiKey in the Cors section.

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

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

@ConnorRobertson ConnorRobertson self-assigned this Mar 1, 2023
@ConnorRobertson ConnorRobertson marked this pull request as ready for review March 2, 2023 17:16
@ConnorRobertson ConnorRobertson requested a review from a team as a code owner March 2, 2023 17:16
integration/combination/test_api_with_cors.py Outdated Show resolved Hide resolved
samtranslator/swagger/swagger.py Outdated Show resolved Hide resolved
samtranslator/swagger/swagger.py Outdated Show resolved Hide resolved
samtranslator/swagger/swagger.py Outdated Show resolved Hide resolved
samtranslator/swagger/swagger.py Outdated Show resolved Hide resolved
samtranslator/swagger/swagger.py Outdated Show resolved Hide resolved
Connor Robertson and others added 2 commits March 2, 2023 12:54
aaythapa
aaythapa previously approved these changes Mar 2, 2023
samtranslator/swagger/swagger.py Show resolved Hide resolved
@aaythapa aaythapa dismissed their stale review March 2, 2023 22:44

misclick

samtranslator/swagger/swagger.py Show resolved Hide resolved
@hoffa hoffa added this pull request to the merge queue Mar 10, 2023
Merged via the queue into develop with commit 089859e Mar 10, 2023
@hoffa hoffa deleted the CorsPreflightApiKey branch March 10, 2023 23:04
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.

5 participants