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

Safeguarding devs from potential per-protocol use of Uint8Array values #171

Open
MasterKale opened this issue Sep 18, 2024 · 1 comment
Open

Comments

@MasterKale
Copy link

One possible foot gun in the structure of the Digital Credentials API is that instances of DigitalCredentialsProvider (soon DigitalCredentialsRequest) maybe require certain values to be specified as Uint8Array values. Is there anything that can be defined at the navigator.credentials.get({ digital: ... }) level here to help developers treat Uint8Array values exclusively as (Base64url) strings into and out of this .get() call?

My motivation here is to reduce the need to write/pull in a base64url-to-bytes helper when using this API for lack of standard functionality in JavaScript to pull this off. JSON serialization of Uint8Array is awkward. Improvements to Uint8Array to add things like toBase64() and fromBase64() are in Stage 3 and so likely to become available to devs over bespoke helpers, but even when those are available it'd be great to handle most of the back-and-forth automatically if possible for easing adoption.

@MasterKale
Copy link
Author

MasterKale commented Sep 18, 2024

I wonder if this has inadvertently become a dupe of #125 🤔

Edit: Then again I wonder if serialization methods would be necessary if this API could mandate that user agents handle such values automatically (so from the developer's perspective it's base64url strings in and out)

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

1 participant