Skip to content

Simplify transports types#776

Merged
MasterKale merged 8 commits into
milestone/v14.0.0from
fix/simplify-transports-types
Jul 9, 2026
Merged

Simplify transports types#776
MasterKale merged 8 commits into
milestone/v14.0.0from
fix/simplify-transports-types

Conversation

@MasterKale

Copy link
Copy Markdown
Owner

This PR softens typing on transports to string[]. This is intended to make it easier to pass in TypeScript-DOM-lib-typed output from navigator.credentials.create() and navigator.credentials.get() into the various SimpleWebAuthn methods.

I will note to my future self that transports is generally typed as string[] in TypeScript types because that's what we typed it as over in the WAWG:

https://w3c.github.io/webauthn/#dom-authenticatorattestationresponse-gettransports

My trying to apply stricter typing to them here was to communicate what the possible transport values might be. But spec guidance instructs RPs to treat transports as "opaque values" (read: don't worry about them, just store them and pass them back to the browser.) I probably inadvertently made RPs too aware of what transports are by, for example, requiring casting to as AuthenticatorTransportFuture[] when crafting excludeCredentials and allowCredentials. That shouldn't be necessary anymore with these changes.

Fixes #768.

@MasterKale MasterKale added this to the v14.0.0 milestone Jul 6, 2026
@MasterKale MasterKale changed the title Simplify transports types (Approach 1) Simplify transports types Jul 6, 2026
@MasterKale MasterKale added package:browser @simplewebauthn/browser package:server @simplewebauthn/server labels Jul 9, 2026
@MasterKale
MasterKale merged commit b472daf into milestone/v14.0.0 Jul 9, 2026
15 checks passed
@MasterKale
MasterKale deleted the fix/simplify-transports-types branch July 9, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:browser @simplewebauthn/browser package:server @simplewebauthn/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant