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

JS API authentication via Flight v2 #3371

Merged
merged 13 commits into from
Jan 27, 2023

Conversation

niloc132
Copy link
Member

@niloc132 niloc132 commented Jan 27, 2023

JS API changes necessary for #2564, moving from the deprecated SessionService.newSession call to Flight v2 authentication. Since the gRPC-web client in use doesn't support interceptors or even reading headers from requests, we only use FlightService.handshake to keep the session alive and rotate tokens, with a hand-written implementation rather than the generated version.

Documentation will follow when the rest of the ticket is closed.

Partial #2564

metadata().set("authorization", authorization);
CustomEventInit init = CustomEventInit.create();
init.setDetail(new JsRefreshToken(authorization.getAt(0), sessionTimeoutMs));
info.fireEvent(EVENT_REFRESH_TOKEN_UPDATED, init);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have not tested this part yet

vbabich
vbabich previously approved these changes Jan 27, 2023
@niloc132 niloc132 force-pushed the 2564-js-authentication branch from 47aa4d0 to c481992 Compare January 27, 2023 19:44
@niloc132 niloc132 merged commit 5d5c461 into deephaven:main Jan 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants