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

Decouple js client from host specific zome call signing logic #221

Closed
matthme opened this issue Dec 15, 2023 · 2 comments
Closed

Decouple js client from host specific zome call signing logic #221

matthme opened this issue Dec 15, 2023 · 2 comments

Comments

@matthme
Copy link
Contributor

matthme commented Dec 15, 2023

Currently the js-client has host specific zome call signing logic for both tauri and electron. I think it would make sense to decouple that, i.e. that the js client does not need to care about the specifics of the host that does the signing but can instead just check for a variable on the window object and have it signed that way. Along the lines of:

if (window.__HOST_ZOME_CALL_SIGNER__) {
  signedZomeCall = await window.__HOST_ZOME_CALL_SIGNER__.signZomeCall(payload);
}

The host (tauri/electron/...) is then responsible for providing that method on the window object.
We can still keep the current methods as a fallback for backwards compatibility.

I can put up a PR for this if people agree.

cc @jost-s @mattyg

@mattyg
Copy link
Member

mattyg commented Dec 15, 2023

Yep that sounds good!

@jost-s
Copy link
Contributor

jost-s commented Dec 15, 2023

Sweet as!

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

3 participants