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

STCOR-776 optionally schedule RTR based on session data #1488

Merged
merged 4 commits into from
Jun 10, 2024

Conversation

zburke
Copy link
Member

@zburke zburke commented Jun 7, 2024

Not all authentication-related responses are created equal. If the response contains AT expiration data, i.e. it is a response from /bl-users/login-with-expiry, use that data to configure RTR. If the response does not contain such data, i.e. it is a response from /bl-users/_self, pull AT expiration data from the session and use that. If we still don't have any AT expiration data, cross your fingers and try rotating in 10 seconds.

Previously, we did not ever check the session, so RTR always fired 10 seconds into a resumed session, which is exactly the situation faced in e2e tests.

This doesn't precisely handle the issue faced by e2e tests that stall when the RTR request fires, but leveraging the session data should push the RTR request far enough into the future that most e2e tests will now complete before RTR fires. We should still try to understand that problem and solve it, but in the mean time this may enable us to work around it.

Refs STCOR-776, FAT-13789

TLDR: just like the title says, only trigger RTR on successful
authentication requests.

The proximate reason for this change is e2e test failures that appear to
be related to RTR erroneously firing 10 seconds into a test, which is
only explainable if an authn request to `/_self` succeeded. Previously,
cruft in localforage certainly could lead to a call to `/_self` even
when no session was active ... but it would have return 4xx with a plain
text response. RTR _should_ only have kicked off if the response
contained json.

IOW, this change definitely patches a bug, but it doesn't reliably
explain all the bad behavior seen in tests. Nonetheless, it feels like a
worthwhile fix since it does fix ... something.

Refs STCOR-776
@zburke zburke requested review from JohnC-80, bbergkotte and aidynoJ June 7, 2024 16:49
Copy link

github-actions bot commented Jun 7, 2024

Jest Unit Test Results

232 tests  +4   232 ✅ +4   46s ⏱️ ±0s
 36 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 13458ef. ± Comparison against base commit 83afa6b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jun 7, 2024

Bigtest Unit Test Results

193 tests  ±0   188 ✅ ±0   6s ⏱️ ±0s
  1 suites ±0     5 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 13458ef. ± Comparison against base commit 83afa6b.

This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
      equal to check email label in english translation
      equal to check email precautions label in english translation
      equal to sent email precautions label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the header with an appropriate text content
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the header with an appropriate text content
      equal to check email label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
      equal to check email precautions label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
      equal to sent email precautions label in english translation

♻️ This comment has been updated with latest results.

@zburke zburke marked this pull request as draft June 7, 2024 18:45
Not all authentication-related responses are created equal. If the
response contains AT expiration data, i.e. it is a response from
`/bl-users/login-with-expiry`, use that data to configure RTR. If the
response does not contain such data, i.e. it is a response from
`/bl-users/_self`, pull AT expiration data from the session and use
that. If we still don't have any AT expiration data, cross your fingers
and try rotating in 10 seconds.

This doesn't precisely handle the issue faced by e2e tests that stall
when the rtr requests fires, but leveraging the session data should
pushh the rtr request far enough into the future that most e2e tests
will now avoid it. We should still try to understand that problem and
solve it, but in the mean time this may enable us to work around it.
@zburke zburke changed the title STCOR-776 only trigger RTR on successful authn requests STCOR-776 optionally schedule RTR based on session data Jun 7, 2024
@zburke zburke marked this pull request as ready for review June 7, 2024 22:26
Copy link

@zburke zburke merged commit e93a5af into master Jun 10, 2024
26 checks passed
zburke added a commit that referenced this pull request Jul 25, 2024
Not all authentication-related responses are created equal. If the
response contains AT expiration data, i.e. it is a response from
`/bl-users/login-with-expiry`, use that data to configure RTR. If the
response does not contain such data, i.e. it is a response from
`/bl-users/_self`, pull AT expiration data from the session and use
that. If we still don't have any AT expiration data, cross your fingers
and try rotating in 10 seconds.

Previously, we did not ever check the session, so RTR always fired 10
seconds into a resumed, which is exactly the situation faced in e2e
tests.

This doesn't precisely handle the issue faced by e2e tests that stall
when the rtr requests fires, but leveraging the session data should
push the rtr request far enough into the future that most e2e tests
will now avoid it. We should still try to understand that problem and
solve it, but in the mean time this may enable us to work around it.

Refs STCOR-776

(cherry picked from commit e93a5af)
@zburke zburke deleted the STCOR-776-check-auth-ok branch August 13, 2024 20:13
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.

2 participants