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

fast: Use Web crypto #1045

Merged
merged 4 commits into from
Jan 6, 2025
Merged

fast: Use Web crypto #1045

merged 4 commits into from
Jan 6, 2025

Conversation

singpolyma
Copy link
Contributor

Switch SASL mechanism used by FAST over to web crypto for smaller bundle size

@sonnyp sonnyp changed the title FAST for browser Use Web crypto for fast Jan 6, 2025
@sonnyp sonnyp changed the title Use Web crypto for fast fast: Use Web crypto Jan 6, 2025
@sonnyp sonnyp self-requested a review January 6, 2025 20:45
Comment on lines +102 to -107
const streamFeatures = await getStreamFeatures({ element, features });
const fast_available = !!fast?.mechanism;

if (mechanisms.length === 0 && !fast_available) {
throw new SASLError("SASL: No compatible mechanism available.");
}

const streamFeatures = await getStreamFeatures({ element, features });
const fast_available = !!fast?.mechanism;
Copy link
Member

Choose a reason for hiding this comment

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

In which scenario would a token be available but no compatible sasl mechanism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've been discussing doing FAST-only (where the inital token is provisioned out of band / during registration) for some accounts, so that would be an example in the real world of this.

@sonnyp sonnyp merged commit 8932a84 into xmppjs:main Jan 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants