Adds support for Okta Verify risky login challenge
Should fix #643
Rebased onto current master
@duckfez This is such an important change, and I am looking at merging it. Could you please add a test for this change?
Codecov Report
Merging #793 (792eace) into master (f8af25e) will decrease coverage by
0.05%. The diff coverage is0.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
I will take a look at adding tests. Thanks!
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.
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
I am struggling to figure out how to write tests for this. I've started by (very small) factoring of the
verifyMfafunction to put the Okta Push part into its own function. (Writing a test for all ofverifyMfawas 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
@duckfez please see #1015 for HTTP lifecycle testing