saml2aws icon indicating copy to clipboard operation
saml2aws copied to clipboard

Adds support for Okta Verify risky login challenge

Open duckfez opened this issue 4 years ago • 8 comments

Should fix #643

duckfez avatar Mar 23 '22 11:03 duckfez

Rebased onto current master

duckfez avatar May 28 '22 23:05 duckfez

@duckfez This is such an important change, and I am looking at merging it. Could you please add a test for this change?

mapkon avatar Mar 26 '23 04:03 mapkon

Codecov Report

Merging #793 (792eace) into master (f8af25e) will decrease coverage by 0.05%. The diff coverage is 0.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #793      +/-   ##
==========================================
- Coverage   36.29%   36.25%   -0.05%     
==========================================
  Files          53       53              
  Lines        7941     7950       +9     
==========================================
  Hits         2882     2882              
- Misses       4686     4695       +9     
  Partials      373      373              
Flag Coverage Δ
unittests 36.25% <0.00%> (-0.05%) :arrow_down:

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

Impacted Files Coverage Δ
pkg/provider/okta/okta.go 22.03% <0.00%> (-0.17%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Mar 26 '23 04:03 codecov-commenter

I will take a look at adding tests. Thanks!

duckfez avatar Mar 27 '23 02:03 duckfez

I will take a look at adding tests. Thanks!

Thank you! The aim is to keep the current coverage or at least increase. You can view the effect of your PR on the codecov report above.

mapkon avatar Mar 27 '23 02:03 mapkon

I am struggling to figure out how to write tests for this. I've started by (very small) factoring of the verifyMfa function to put the Okta Push part into its own function. (Writing a test for all of verifyMfa was a lot). The primary issue I'm finding in the testing is that the real provider has to make 3+ round-trip calls to the Okta HTTP API, and I don't quite know how to mock that up. Advice / examples welcome

duckfez avatar Apr 03 '23 03:04 duckfez

I am struggling to figure out how to write tests for this. I've started by (very small) factoring of the verifyMfa function to put the Okta Push part into its own function. (Writing a test for all of verifyMfa was a lot). The primary issue I'm finding in the testing is that the real provider has to make 3+ round-trip calls to the Okta HTTP API, and I don't quite know how to mock that up. Advice / examples welcome

Is it possible to mock the round trips? @gliptak has been using that technique in some of his recent commits

mapkon avatar Apr 03 '23 03:04 mapkon

@duckfez please see #1015 for HTTP lifecycle testing

gliptak avatar Apr 03 '23 10:04 gliptak