near / near-api-js

JavaScript library to interact with NEAR Protocol via RPC API
https://near.github.io/near-api-js
MIT License
388 stars 240 forks source link

biometric-ed25519 update to support BitWarden password manager #1331

Closed hcho112 closed 3 months ago

hcho112 commented 3 months ago

Pre-flight checklist

Motivation

This PR contains fixes for #1330 issue. The main reason why passkey did not work with BitWarden was because they do not follow standard format for webauthn credentials in which they used data format of Uint8Array instead of ArrayBuffer. However they can be easily convert-able so in this PR I have implemented logic to do the conversion.

Test Plan

On https://github.com/near/fast-auth-signer/ repo, run it locally with commend yarn && NETWORK_ID=testnet yarn run start --https (Bitwarden only works with https) On new Chrome browser profile, install Bitwarden chrome extension package. manually navigate to localhost:3000/create-account and try to create an account. (At this point, you should be able to replicate the issues)

Apply the above change directly to source code. (There is issues with setting up yarn link/npm link between these two projects)

I have confirm that above change has resolved the issue and was able to conduct create key and get keys without error.

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 30e3b34d843ab13f3e2c467260261130a8e2b543

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | @near-js/biometric-ed25519 | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

hcho112 commented 3 months ago

@vikinatora thank you for the review, updated PR as per request