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

update package dependencies #16

Conversation

jrayback
Copy link
Collaborator

@jrayback jrayback commented Dec 6, 2023

Eliminates sketchy packages:

@jrayback
Copy link
Collaborator Author

jrayback commented Dec 6, 2023

The only dependencies we have now are the two maintained/audited @noble packages and the libsodium package.

@pfeairheller
Copy link
Member

If you are removing the urlsafe-base64 in favor of Node native calls are you pinning this library to be Node only? Meaning will it no longer be available for Browsers?

@kentbull
Copy link

kentbull commented Dec 8, 2023

That was my question as well. Will the Buffer.from(<string value> ,'base64url') and Buffer.from([<buffer raw val>]).toString('base64url') syntax work only in Node or does that work with browsers as well?

@AlexAndrei98
Copy link

One thing I noticed is that in signify we do the following

import { Buffer } from 'buffer';

try {
    window.Buffer = Buffer;
} catch (e) {}

Currently trying to refactor signify to use cesr-ts but It will probably take me the weekend!

@jrayback
Copy link
Collaborator Author

jrayback commented Dec 8, 2023

Yes, @AlexAndrei98 , and the Node.js docs explicitly suggest import { Buffer } from 'node.buffer' for precisely this reason, I imagine (disambiguation). Let me look further into this. I'll make a commit to this PR containing a better approach.

@jrayback
Copy link
Collaborator Author

jrayback commented Dec 8, 2023

Looks like the import statement @AlexAndrei98 quotes above references the buffer npm package here. This package makes the buffer module from node.js available in browsers. The project seems well-maintained and very widely used. Also, it appears that we're already using it in signify.ts. I'll see if I can rework this PR to leverage this package rather than reverting to urlsafe-base64. Please advise if any objections to this approach.

@jrayback
Copy link
Collaborator Author

jrayback commented Dec 8, 2023

OK. Using the buffer npm package now. This will make the functionality of the native node.js module available widely in browsers. @pfeairheller , I think we're all set to merge this now.

@jrayback
Copy link
Collaborator Author

jrayback commented Dec 8, 2023

fixes #7

@jrayback jrayback merged commit 763dc0e into WebOfTrust:development Dec 8, 2023
@jrayback jrayback deleted the rayback_231121_update-package-dependencies branch December 8, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants