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

Improve timeouts during registration/authentication polling #209

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

MKodde
Copy link
Member

@MKodde MKodde commented Sep 12, 2024

While polling for authn/registration state changes. The globally defined timeout periods for these actions where not tested explicitly. This PR ensures we start testing if the timeout period is expired.

For registration, I added a new timeout error page. For this a new translation was added @pmeulen do you agree with my proposed translations? If not feel free to suggest better ones. I based these off the authn ones.

An offset time is substracted from the hard timeout time. This makes the timeout occur a couple of seconds before the actual timeout would take place. This prevents user actions taking place right before expiration time from erroring.

See: https://www.pivotaltracker.com/story/show/188205272 (note that the story mentions registration/authentication sessions. These are not to be confused with state/php sessions. But they are the 'session' in which an authentication or a registration takes place.)

That is added to isolate the timeout 'business' rules are implemented
correctly. And make them testable.
// Effectively this does a $this->_stateStorage->getValue(self::PREFIX_CHALLENGE . $sessionKey);
// To check that the session key still exists in the Tiqr_Service's state storage
try {
$this->tiqrService->authenticationUrl();
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the old logic, the story mentions. I opted to stop applying this method of testing for timeouts. And simply apply the same timeout check I added for the enrollment (registration) logic.

The Jest test was not yet covering the possibility of a registration
timeout
@MKodde MKodde merged commit 0285fa5 into main Sep 16, 2024
2 checks passed
@MKodde MKodde deleted the feature/polling-timeout branch September 16, 2024 07:09
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