-
Notifications
You must be signed in to change notification settings - Fork 20
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(login): auto-retry login with existing credentials #251
feat(login): auto-retry login with existing credentials #251
Conversation
7759efb
to
ac17de4
Compare
I started the backend first, then the frontend with the above commands. When I enter "user" and "pass", the cryostat logs show a
|
Oh, my mistake - you should also check out cryostatio/cryostat#664 for the backend. No need to build it since you're running an image I pushed to quay already which was built from this branch (plus a tweak to terminate connections periodically, which isn't in the branch). There is a small change to |
ac17de4
to
62691a2
Compare
How do I resolve an
|
62691a2
to
7fb7c48
Compare
I have a running cluster, logged in with
Also, how can I pass the above env vars to cryostat in CRC? |
I think for the first part, you wan to do something like For passing env vars to Cryostat running in CRC, I don't think there is an existing way to set the @ebaron is there any easier way to do the above? |
Actually, hold on. Even if you build the operator with the CORS variable hardcoded in, that may not work, because you'll still be behind the cluster's SSL by default, and that'll break the CORS and separate frontend setup too. Hmm. Easiest way to test in CRC may be to just build a custom Cryostat image with this frontend PR checked out in the web-client submodule, and then have the standard operator deploy that customized image by deploying the cryostat-operator-controller-manager deployment object. |
I have just pushed |
When I go to https://cryostat-sample-default.apps-crc.testing, I don't see the notifications icon or the gear icon. Is there another way to use your
|
I think what your setup has there is an operator-deployed Cryostat instance and then another one running separately via I would do |
After editing the yaml, the cryostat-sample-default testing URL looks the same as before. Here's the output of
|
|
@jan-law I think maybe that operator image is too old. I know we had to add some new things to support v2 Cryostat. |
This worked as expected for me, but is the disconnecting every 10s something temporary to illustrate this behaviour? |
Oh yes, the backend is disconnecting all clients every 10s on purpose to illustrate the behaviour. That's part of the custom image I made, not something upstream. I just took the background pruning task that rejects connections from unauthenticated clients every 10s and made it close all connections every 10s instead. ---- On Fri, 27 Aug 2021 16:49:54 -0700 ***@***.*** wrote ----
This worked as expected for me, but is the disconnecting every 10s something temporary to illustrate this behaviour?
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
|
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.
Seems good then!
Fixes #250
This PR enhances the login flow.
To test, start the backend as follows:
Start the frontend as usual:
$ yarn yarn:frzinstall && yarn start:dev
You should be presented with the Basic auth login form. Enter
user/pass
credentials and log in. Pay attention to the graphical notifications - there should be one that the connection was accepted here. After ~10s pass, the backend will terminate the WebSocket connection. A graphical notification should be displayed here as well, and you should be returned to the graphical login page momentarily. The login page should have the username and password fields pre-filled. After a very short delay, the login page should disappear and you should be returned back to the in-app page you were on previously. ~10s more later and you should again be disconnected. This will loop indefinitely. The web client should continuously reconnect itself after the connection is lost.Next, attempt the same procedure as above. However, some time after the first successful web client connection is established, you should forcibly kill the Cryostat backend (Ctrl-C). This should cause the web client to display a disconnection notification and the login page again. Wait some time (and observe in your browser's dev tools network tab that the client is attempting to reconnect via
POST /api/v1/auth
), then restart the Cryostat backend using the same command as the first time. Within a short time (Cryostat backend startup + ~5s or less), the web client should automatically reconnect to the newly restarted backend instance.Next, retry the above two procedures, but without setting the
CRYOSTAT_AUTH_MANAGER
env var when starting the backend. This will default it to theNoopAuthManager
, which does not require any authentication credentials. This test case should behave very similarly to the first case with Basic authentication enabled, however the delay between disconnect and successful reconnect is likely to be much shorter.Finally, the above scenarios can also be tested in CRC to exercise the Bearer authentication login flow. This should behave identically to the Basic authentication flow, albeit with only a single form field to fill, and perhaps a slower reconnection time due to a longer request latency to validate your supplied credentials.