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

Change the default timeout to 5 mins #65

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

qalandarov
Copy link

@qalandarov qalandarov commented May 6, 2024

The comment in the code said that the default was 60 seconds, but the code was set 60 mins.
And @dimitribouniol pointed out that the actual default based on the spec was 5 mins :)

@qalandarov qalandarov mentioned this pull request May 6, 2024
@qalandarov qalandarov changed the title Change timeout default from 60 mins to 60 seconds Change the default timeout to 5 mins May 9, 2024
Copy link
Contributor

@dimitribouniol dimitribouniol left a comment

Choose a reason for hiding this comment

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

Looks good to me!

/// - attestation: The Relying Party's preference regarding attestation. Defaults to `.none`.
/// - publicKeyCredentialParameters: A list of public key algorithms the Relying Party chooses to restrict
/// support to. Defaults to all supported algorithms.
/// - Returns: Registration options ready for the browser.
public func beginRegistration(
user: PublicKeyCredentialUserEntity,
timeout: Duration? = .seconds(3600),
timeout: Duration? = .milliseconds(300000),
Copy link
Contributor

Choose a reason for hiding this comment

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

Now if only we could just specify .minutes(5) 😛

Copy link
Contributor

Choose a reason for hiding this comment

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

Upon further reflection (and reading the original reason why .minutes() is not a thing), I think it would be best to specify this as an expression:

Suggested change
timeout: Duration? = .milliseconds(300000),
timeout: Duration? = .seconds(5*60),

I'll leave the call to you though, as there's nothing explicitly wrong with how it is now, just potentially clearer to whoever is reading the code and not the documentation.

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

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.

None yet

3 participants