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 no allowed origin #2180

Merged
merged 2 commits into from
Nov 8, 2021
Merged

Fix no allowed origin #2180

merged 2 commits into from
Nov 8, 2021

Conversation

c2tarun
Copy link
Contributor

@c2tarun c2tarun commented Oct 11, 2021

Issue #, if available:

Description of changes:
If a template with empty AllowOrigins is passed to SAM we detect and throw ValueError, this error is then left uncaught and causes service error. This PR Is converting that ValueError to a SAM specific error which is then handled properly and proper error message is returned as part of transform failure.

Description of how you validated changes:
Added functional test.

Checklist:

  • Add/update tests using:
    • Correct values (already exist)
    • Bad/wrong values (None, empty, wrong type, length, etc.)
    • Intrinsic Functions
  • make pr passes
  • Update documentation
  • Verify transformed template deploys and application functions as expected

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/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.

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2021

Codecov Report

Merging #2180 (438cd85) into develop (e7a1496) will increase coverage by 0.81%.
The diff coverage is 97.38%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2180      +/-   ##
===========================================
+ Coverage    93.58%   94.40%   +0.81%     
===========================================
  Files           90       95       +5     
  Lines         6124     6501     +377     
  Branches      1260     1307      +47     
===========================================
+ Hits          5731     6137     +406     
+ Misses         183      168      -15     
+ Partials       210      196      -14     
Impacted Files Coverage Δ
samtranslator/model/lambda_.py 93.10% <ø> (ø)
samtranslator/plugins/globals/globals.py 99.05% <ø> (ø)
samtranslator/translator/logical_id_generator.py 100.00% <ø> (+9.09%) ⬆️
samtranslator/region_configuration.py 77.77% <63.63%> (-22.23%) ⬇️
samtranslator/model/eventsources/pull.py 90.04% <87.50%> (+11.36%) ⬆️
samtranslator/translator/translator.py 97.26% <90.00%> (+0.07%) ⬆️
samtranslator/swagger/swagger.py 94.00% <90.62%> (+0.63%) ⬆️
samtranslator/__init__.py 100.00% <100.00%> (ø)
samtranslator/feature_toggle/dialup.py 100.00% <100.00%> (ø)
samtranslator/feature_toggle/feature_toggle.py 100.00% <100.00%> (+12.16%) ⬆️
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11f9fef...438cd85. Read the comment docs.

Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c2tarun c2tarun merged commit dd9d814 into aws:develop Nov 8, 2021
@c2tarun c2tarun deleted the fix-no-allowed-origin branch November 8, 2021 17:38
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.

4 participants