-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add authentication plugin to embedded components #3298
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3298 +/- ##
==========================================
- Coverage 59.44% 59.38% -0.07%
==========================================
Files 736 736
Lines 28997 29037 +40
Branches 7017 7029 +12
==========================================
+ Hits 17238 17244 +6
- Misses 11513 11547 +34
Partials 246 246
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
configuration.type, | ||
initializeInternetAccount( | ||
internetAccountConfig: AnyConfigurationModel, | ||
initialSnapshot = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for changing it to take a config instead of id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the only place this is called, the calling code already has a handle the config. By passing it directly, we avoid having to call resolveIdentifier
with the ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will note that things like onAction listeners cannot handle full configuration objects, and this is one reason why e.g. showTrack take a trackId even if they have a full conf object to supply generally. Internet account would probably rarely be attached to a onAction listener but it's just a data point for the use of ids in the api
This comment was marked as outdated.
This comment was marked as outdated.
I'd tested this with |
added a small change to make it so that component_tests uses a built version of the auth plugin 6d6531b |
should be good to go? i wasn't sure what token to paste in the storybook example that @garrettjstevens added but seems ok :) |
Yep, this is good to go. |
This is a proposal that adds the ability to use internet accounts in the embedded React LGV and CGV. I've tested it with HTTP basic authentication.
The motivation for this is for use in
jbrowse-jupyter
(see this comment). There is a way to open local files (or at least files on the same machine as the jupyter/colab server) by taking advantage of the ability to invoke functions in the Python kernel from the notebook client. We can use that to read chunks of a file from disk instead of fetching them from a server. @teresam856 and I have been trying to think of a way to get this to work.The proposed workflow would be to add tracks that have a UriLocation with a different protocol (
file://
might work, but maybe it would have to be custom). Then for those tracks,jbrowse-jupyter
would use a plugin to add an internet account with a customgetFetcher
which would then invoke the Python kernel instead of fetching from a server.An alternative to doing this with an internet account would be to use a custom filehandle and invoke the Python kernel there, but @rbuels and I couldn't figure out a way for a plugin to add and use a custom filehandle.