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

Okta 719439 https loopback #3650

Merged
merged 4 commits into from
Jun 25, 2024
Merged

Conversation

Luxu2-Okta
Copy link
Contributor

Description:

Add https loopback support to SIW v2 and v3

PR Checklist

Issue:

Reviewers:

Screenshot/Video:

Downstream Monolith Build:

.requestHooks(loopbackSuccessLogger, loopbackSuccessWithHttpsMock)('in loopback server approach, https loopback succeeds', async t => {
failureCount = 0;
// after OKTA-715718 is fixed, should use ".eql(0)" for ".lte(otherProbeCount)" assertions
const otherProbeCount = process.env.OKTA_SIW_GEN3 === 'true' ? 0 : 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bacon test flakiness

@denysoblohin-okta has a fix in this PR

According to my local test, it is indeed flaky, especially when I add break points

SIW V2, should be only two /probe call like V3
but actually, four /probe calls
Screenshot 2024-06-14 at 11 54 49 AM

three /probe calls
Screenshot 2024-06-14 at 11 50 10 AM

SIW V3, it is using simple async/await, so only two /probe calls, which is expected
Screenshot 2024-06-13 at 1 55 53 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

any specific reasons we see different number of probe calls in V2 and V3? I'm fine with asserting different number of calls but would like to understand the root cause

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the reason is in this PR's description. Mainly because Promisified $.ajax in BaseOktaVerifyChallengeView were not chained correctly

@Luxu2-Okta Luxu2-Okta marked this pull request as ready for review June 14, 2024 19:57
Copy link
Contributor

@yannongli-okta yannongli-okta left a comment

Choose a reason for hiding this comment

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

please get some review from SIW team as well, especially on V3 code and tests

playground/mocks/config/responseConfig.js Show resolved Hide resolved
.requestHooks(loopbackSuccessLogger, loopbackSuccessWithHttpsMock)('in loopback server approach, https loopback succeeds', async t => {
failureCount = 0;
// after OKTA-715718 is fixed, should use ".eql(0)" for ".lte(otherProbeCount)" assertions
const otherProbeCount = process.env.OKTA_SIW_GEN3 === 'true' ? 0 : 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

any specific reasons we see different number of probe calls in V2 and V3? I'm fine with asserting different number of calls but would like to understand the root cause

yannongli-okta
yannongli-okta previously approved these changes Jun 21, 2024
Copy link
Contributor

@yannongli-okta yannongli-okta left a comment

Choose a reason for hiding this comment

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

lgtm!

shuowu-okta
shuowu-okta previously approved these changes Jun 24, 2024
// if https domain are included, max number of ports to be probed should be doubled
Logger.info('httpsDomain enabled, will probe and challenge https first');
maxNumberOfPorts += maxNumberOfPorts;
ports.forEach(port => {
Copy link
Contributor

Choose a reason for hiding this comment

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

move this probing logic into a function? looks similar with the one used for regular domain.

@@ -124,11 +125,19 @@ const LoopbackProbe: FunctionComponent<{ uischema: LoopbackProbeElement }> = ({
useEffect(() => {
const doLoopback = async () => {
let foundPort = false;
// loop over each port

let urls = ports.map((port) => `${domain}:${port}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: urls -> baseUrls

@oktapp-aperture-okta oktapp-aperture-okta bot merged commit 05d8bc6 into master Jun 25, 2024
1 check passed
@oktapp-aperture-okta oktapp-aperture-okta bot deleted the OKTA-719439-https-loopback branch June 25, 2024 00:06
trevoring-okta pushed a commit that referenced this pull request Jun 25, 2024
OKTA-719439 OKTA-719439 Support HTTPS loopback server call
support v3 https loopback
Fix review comments
fix review comments
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