Coder Social home page Coder Social logo

Comments (2)

MasterKale avatar MasterKale commented on July 28, 2024 1

I was able to address this easily enough in #2047, the TypeError definition in the Create exceptions was generalizable enough for Get too:

Screenshot 2024-07-10 at 12 51 52 PM

#2047 (comment)

from webauthn.

emlun avatar emlun commented on July 28, 2024

I reckon this is inherited from the JavaScript-to-WebIDL language bindings? See for example the conversion routine for dictionary types (which include PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions):

3.2.17. Dictionary types
[...]
A JavaScript value jsDict is converted to an IDL dictionary type value by running the following algorithm (where D is the dictionary type):

  1. If Type(jsDict) is not Undefined, Null or Object, then throw a TypeError.
    [...]
    4.1.3.1. Let idlMemberValue be the result of converting jsMemberValue to an IDL value whose type is the type member is declared to be of.
    [...]
    4.1.5. Otherwise, if jsMemberValue is undefined and member is required, then throw a TypeError.

We don't explicitly state in the WebAuthn spec that this conversion must occur, but it clearly must since the API is defined in WebIDL and the actual implementation is exposed in JavaScript. See also:

§3.2. JavaScript type mapping
[...]
[...] For each IDL type, it is described how JavaScript values are converted to an IDL value when passed to a platform object expecting that type, [...]

§2.12. Objects implementing interfaces
[...]
Platform objects are objects that implement an interface.

...which would for example include the PublicKeyCredential interface.

I'm in favour of #2047 mentioning that TypeError is one of the errors RPs may expect, but I don't think WebAuthn needs to explicitly define how these particular TypeErrors should be thrown - I figure that should be handled by WebIDL already.

from webauthn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.