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

JSON parsing should be on top of Infra primitives #2207

Open
annevk opened this issue Nov 18, 2024 · 4 comments
Open

JSON parsing should be on top of Infra primitives #2207

annevk opened this issue Nov 18, 2024 · 4 comments
Assignees

Comments

@annevk
Copy link
Member

annevk commented Nov 18, 2024

I suspect that most can be replaced by https://infra.spec.whatwg.org/#parse-json-bytes-to-an-infra-value. This will also require some changes to the following steps as they now have an Infra value. This should also allow for the removal of the notes as now this is all well-defined instead of somewhat hand-wavy.

@timcappalli
Copy link
Member

This will also require some changes to the following steps

@annevk which steps are you referring to?

@annevk
Copy link
Member Author

annevk commented Nov 18, 2024

For instance in https://w3c.github.io/webauthn/#sctn-registering-a-new-credential steps 5/6 would be combined by instead calling into Infra. Then step 7 and such can no longer use the C.type syntax to refer to members. Instead you'll have to use

C["type"]

which will make it more consistent with other specifications.

@nadalin nadalin added this to the L3-WD-02 milestone Nov 20, 2024
@emlun
Copy link
Member

emlun commented Nov 27, 2024

While I somewhat agree in principle, I'm not sure that using parse JSON bytes to an Infra value is better. It indirectly references invoking %JSON.parse% from ECMAScript, which may be appropriate if this verification step happens to be running in a browser, but these steps often run on a backend server that's not JavaScript, so it seems awkward to (indirectly) refer to ECMAScript procedures in those cases. While yes, describing these RP operations as operating on JavaScript values is a bit of a fantasy as they've most likely been transformed to and from network representations along the way, I'm not sure that using Infra values really adds much.

I would leave this as is for L3 and maybe reconsider for L4.

@annevk
Copy link
Member Author

annevk commented Nov 27, 2024

The browser doesn't always implement that step in terms of a JS engine either. What's important is that the outcome is the same and does not deviate from that operation. Historically at least there have been differences and specifications should avoid causing more of those to come up.

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

No branches or pull requests

4 participants