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

Update get_secret_value to properly check versions and stages match #5238

Merged

Conversation

bsch150
Copy link
Contributor

@bsch150 bsch150 commented Jun 16, 2022

Howdy folks, just started using moto, it's been a great help with testing some lambdas I've got.

I noticed that the get_secret_value operation has a minor issue where we weren't checking that the version_stage and version_id match each other. the AWS cli and boto3 will throw an error in real life.

@bsch150
Copy link
Contributor Author

bsch150 commented Jun 17, 2022

Some of these test cases appear to be inaccurate. Here is a gist with steps to provide evidence using the AWS cli. I'm working on updating the tests!

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2022

Codecov Report

Merging #5238 (c1da20f) into master (6a1a8ee) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master    #5238    +/-   ##
========================================
  Coverage   95.86%   95.87%            
========================================
  Files         688      688            
  Lines       68240    68434   +194     
========================================
+ Hits        65419    65611   +192     
- Misses       2821     2823     +2     
Flag Coverage Δ
servertests 36.33% <62.50%> (-0.07%) ⬇️
unittests 95.81% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
moto/secretsmanager/exceptions.py 97.05% <100.00%> (+0.39%) ⬆️
moto/secretsmanager/models.py 98.61% <100.00%> (+0.01%) ⬆️
moto/greengrass/models.py 99.02% <0.00%> (-0.32%) ⬇️
moto/greengrass/responses.py 100.00% <0.00%> (ø)
moto/s3/responses.py 95.51% <0.00%> (+0.01%) ⬆️

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 6a1a8ee...c1da20f. Read the comment docs.

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

Awesome - thanks for the PR @bsch150!

@bblommers bblommers merged commit 836a2e6 into getmoto:master Jun 18, 2022
@bblommers bblommers added this to the 3.1.14 milestone Jun 18, 2022
@github-actions
Copy link
Contributor

This is now part of moto >= 3.1.14.dev18

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.

None yet

3 participants