-
Notifications
You must be signed in to change notification settings - Fork 24
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
How to mock permissions
?
#324
Comments
Sorry for not getting back to this earlier. If this is too late for you, I hope it's at least helpful to others coming across this. The short answer is: We don't support this yet. Long answer: From reading this:
This looks somewhat like an X/Y problem: You want to run tests with webnative, not necessarily mock permissions, right? Well, we don't quite fully support running webnative in nodejs today. At some point we hacked together a way to run webnative in nodejs for our own purposes, but it's not something we mean to support officially at the moment. That said, you can take a look at the It's technically also possible to more advanced things in nodejs, for example run data root updates or fetch the file system from an existing account. You can see more of that in the implementation of wnfs-migration. Hope this helps. |
Thanks for the reply. I had forgotten that I was doing this; so I'm getting re-acquainted with this also, and I don't remember all the context for this issue. To clarify one thing — this is actually running in a browser environment (electron). The test are using a utility called |
Ah interesting, that clarifies some things. Then you may be interested in the app-owned-login stuff that @bgins is working on right now. That should make it easier to initialise webnative in a way that doesn't run a redirect to https://auth.fission.codes, and instead makes it run independently, similar to what the auth lobby itself is doing. |
Hey @nichoth 👋 We have app-owned account registration (#330) and account linking (#335) available in the latest release of webnative (released today!). One thing that is missing that you may need is WNFS. Keep an eye on issue #368 where I'm currently working on that. With all those pieces, apps should be able to make an account, link devices, and have their own WNFS without using the auth lobby to set things up. |
Yes, and specifically I think nichoth would need WNFS support, but no account registration nor account linking, only WNFS (if that's possible?), because it's just for tests. |
It's much easier to run tests in NodeJS now, see webnative's tests. |
Summary
How do I set permissions/authenticate in a test context?
This is the repo I am working with: wn-blob . The example uses demo permissions, but returns an 'not authorized' response
Problem
Should be able to use
webnative
as a dependency in other repos.Impact
Can't run tests that use
webnative
Solution
Document how to mock permissions
The text was updated successfully, but these errors were encountered: