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

Add cognitoidp.admin_respond_to_auth_challenge #7136

Merged

Conversation

matusfaro
Copy link
Contributor

Implements cognitoidp.admin_respond_to_auth_challenge. It simply calls the corresponding public endpoint respond_to_auth_challenge internally as there is no relevant differences between them.

Since there are no changes in logic, I didn't add any additional tests, but I did convert existing tests so a call to admin_initiate_auth and initiate_auth uses the appropriate API admin_respond_to_auth_challenge and respond_to_auth_challenge respectively.

Let me know if there's anything I missed.

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d44d05c) 95.87% compared to head (aba0a20) 95.88%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7136   +/-   ##
=======================================
  Coverage   95.87%   95.88%           
=======================================
  Files         834      834           
  Lines       82233    82245   +12     
=======================================
+ Hits        78844    78858   +14     
+ Misses       3389     3387    -2     
Flag Coverage Δ
servertests 35.78% <25.00%> (-0.01%) ⬇️
unittests 95.82% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

The region_agnostic_backend loops over all regions, over all UserPools in that region, untils it finds the region that contains the UserPool that contains the correct Session.

In the admin_respond_to_auth_challenge operation we do have access to the UserPoolId, so there is a future improvement to only loop over the regions until we have a matching UserPool (and error otherwise).

But as I said, that as an enhancement - this looks good as is.

Thank you @matusfaro!

@bblommers bblommers added this to the 4.2.13 milestone Dec 19, 2023
@moto-payments-app
Copy link

Hi @matusfaro,

Thank you for contributing to Moto!

To show our thanks, we'd like to share some of the donations that we've received with you. PR's like this are the big reason that Moto is as successful as it is - so it's only fair that you, as a contributor, get to share the spoils.

We've created a companion website with more information:
https://payments.getmoto.org/

Feel free to open a bug or discussion if you run into any problems:
https://github.com/getmoto/payments

@bblommers bblommers merged commit 34a0c20 into getmoto:master Dec 19, 2023
34 checks passed
Copy link
Contributor

This is now part of moto >= 4.2.13.dev8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants