w3ui icon indicating copy to clipboard operation
w3ui copied to clipboard

wip: fake keyring playground

Open travis opened this issue 2 years ago • 2 comments

I wanted to prove to myself that postMessage would be a viable way to communicate between an app and the keyring site, so I created two example apps and got them to talk to eachother.

to try this out, in two different consoles run:

console a:

cd examples/react/fake-keyring
pnpm install
pnpm run dev

console b:

cd examples/react/fake-keyring
pnpm install
pnpm run dev

then head to http://localhost:3000 and hit "grab the keys"

you should see output in the console confirming this cross-origin communication works as expected, with some TODOs that sketch out what the keyring might need to do to make this all work as expected. I'm not entirely sure why the handler gets registered multiple times, but that's not super important for now.

https://user-images.githubusercontent.com/1113/214172064-f4e2c0ba-d735-43f7-8a59-efde0384c3af.mp4

big open question for me - does the UCAN need to be transmitted all the way back to the app domain or can we just store it on the server as proof that a user has granted a domain access to a particular set of capabilities?

this should probably never be merged - close it when we no longer need it handy

travis avatar Jan 23 '23 23:01 travis

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5b42f3e08f4a34e96fca245d91273fbd4e69d4a5:

Sandbox Source
@w3ui/example-react-file-upload Configuration
@w3ui/example-react-sign-up-in Configuration
@w3ui/example-react-uploads-list Configuration
@w3ui/example-solid-file-upload Configuration
@w3ui/example-solid-sign-up-in Configuration
@w3ui/example-solid-uploads-list Configuration
@w3ui/example-vue-file-upload Configuration
@w3ui/example-vue-sign-up-in Configuration
@w3ui/example-vue-uploads-list Configuration

codesandbox-ci[bot] avatar Jan 23 '23 23:01 codesandbox-ci[bot]

big open question for me - does the UCAN need to be transmitted all the way back to the app domain or can we just store it on the server as proof that a user has granted a domain access to a particular set of capabilities?

It probably depends on context, but in general I think we want more the former than the latter. Give the end-user (or their user-agent aka web browser) the delegation so they are in control of it. Don't hide it from them by storing it on their server without them having a copy.

gobengo avatar Jan 31 '23 20:01 gobengo