-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: Logging out #1244
feat: Logging out #1244
Conversation
Getting an error when trying to import from
|
Codecov Report
@@ Coverage Diff @@
## main #1244 +/- ##
==========================================
- Coverage 45.69% 45.57% -0.12%
==========================================
Files 473 484 +11
Lines 33713 34077 +364
Branches 8457 8532 +75
==========================================
+ Hits 15404 15531 +127
- Misses 18258 18495 +237
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
df14a9d
to
8e15103
Compare
jest.config.base.cjs
Outdated
'react-transition-group': path.join( | ||
__dirname, | ||
'./__mocks__/react-transition-group.js' | ||
), |
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.
Hmm I'm not sure this should be needed based on the Jest docs. They say mocking node modules from __mocks__
adjacent to node_modules
is an automatic mock here. This is different from mocking user modules
It might be the way we have jest set up. Honestly, I'm not sure the jest projects is all that helpful even though we're running from the root. I'd be interested to see how often we use it as developers for more than disabling the linter tests. I think that I set it up that way b/c some packages had different Jest setup requirements, but now I think it's basically code-studio and then every other package shares a config basically
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.
Yea if we don't have this here the mock doesn't get applied and all the tests fail. Guess it's how we have jest set up.
The automatic mocking happens for __mocks__
folders next to the node_modules folders of our packages, but not at the root it would appear.
I'm not too invested in figuring it out beyond that, perhaps we switch to vitest
at some point.
- Just added what was already part of app-utils
- Add tests for AuthPluginBase - Add mock for react-transition-gruop
- Just cleaning up the ternary op
- Probably not a problem, as we write the cookie, but on the outside chance someone modified their cookies should handle it safely - Also refactored deleting the refresh token a bit
- Seems to work fine, not sure what the previous comment was complaining about
- Is imported by the PSK plugin, now it appears correctly.
- Deleted package-lock.json and then did an `npm install`
- Needed to pin a couple versions
- Just copied the original from main and then ran an npm install instead of deleting and re-generating
- Was causing some tests to fail.
packages/auth-plugins/src/Login.tsx
Outdated
@@ -1,5 +1,6 @@ | |||
import React from 'react'; | |||
import { RandomAreaPlotAnimation } from '@deephaven/components'; | |||
import Logo from './logo.png'; |
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 guess in DHC we won't allow changing the logo? Or we just recommend a custom auth plugin for that?
I know it's something we offer in DHE by just replacing the logo file.
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.
It is something we do with DHE, which has some server side configuration: https://github.com/deephaven-ent/iris/blob/d6950c95398cbe9a400eca8ba90e11201dcdae7c/web/server-frontend/src/main/java/com/illumon/iris/web/server/AbstractIrisWebServer.java#L170
We don't have that same configuration on the DHC side.
That being said, I'll wire it up the same on the client. Just means the logo is in 3 public paths (ide, embed-grid, embed-chart) instead of just being packaged with auth plugins.
And yes, a custom auth plugin would be able to customize whatever.
- Add a prop so you can set it
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.
Looks good. Just confirming we intentionally remove the PSK from the URL after PSK auth is complete? Still refreshes fine, just making sure that's intentional since I thought that before this change the key stayed in the URL
Correct. We actually remove it from the URL right away. It is stored as a cookie so refresh will work correctly. |
AuthPluginBase
useContextOrThrow
hookAuthPluginPsk
LoginAnimation
from Enterprise, renamed toRandomAreaPlotAnimation
Login
andLoginForm
components to allow others to reuse if desiredcanLogout
(since you can't logout when anonymous