-
Notifications
You must be signed in to change notification settings - Fork 12
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
What should be the data type for the response? #119
Comments
Use of ArrayBuffer is discouraged (unless there's a good reason), so probably a See also: #93 and w3ctag/design-principles#463 However, before we settle on something, we need to make sure we fully understand what wallets are going to be returning. There's also some overlap with #95 cc @timcappalli |
Yeah, agreed that this is the key question. The main question I have on my mind is whether wallets are going to be returning bytes or strings (e.g. text/json). I'm assuming wallets are going to be returning small payloads, so we don't need streams. So, to narrow down the options here, I think we have to decide between a We should also probably find a way to avoid cornering ourselves doing something that is forwards compatible if we wanted to change the type later. |
In the CG call today we converged as a group that
We heard from Lee that the cross-device hybrid/ctap structure also assume that the response can be JSON-parseable/stringifiable, so this aligns well. @marcoscaceres and I will work towards patching the spec to specify that the response data is of type |
Co-authored-by: Sam Goto <[email protected]>
What should be the WebIDL data type for the
DigitalCredential.data
response?This is currently returning
any
(to keep Safari and Chrome's implementation interoperable), but we should probably be more specific than that.A few options that occurred to us:
Uint8Array
DOMString
(what WebOTP uses)USVString
(what FedCM uses -- as opposed to aDOMString
it can take UTF-8, e.g.application/json
, guidance from TAG here and here),ArrayBuffer
(what WebAuthn is using, but also apparently discouraged)Blob
, which has atext()
andbytes()
methods (thanks to Joshua Bell for bringing up this suggestion!).object
if everything can beJSON.parse()
-ableIt is not clear to me what are the trade-offs between these options (mostly ergonomics? or are there security trade-offs here?) nor what the requirements are (e.g. do we need to support passing back binary or non-JSON response's data?), so this issue here is intended to try to collect requirements and help us figure out what's best to use.
@marcoscaceres FYI
The text was updated successfully, but these errors were encountered: