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

wip: fake keyring playground #290

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

wip: fake keyring playground #290

wants to merge 1 commit into from

Conversation

travis
Copy link
Member

@travis travis commented Jan 23, 2023

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.

Arc.-.Vite.+.React.-.23.January.2023.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

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.

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?
@travis travis requested review from jchris and gobengo January 23, 2023 23:01
@codesandbox-ci
Copy link

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 5b42f3e:

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

@gobengo
Copy link
Contributor

gobengo commented Jan 31, 2023

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.

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

Successfully merging this pull request may close these issues.

2 participants