-
Notifications
You must be signed in to change notification settings - Fork 89
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 to the Web UI #3711
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration 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.
LGTM but can't currently build it to try it out because of missing 'react-toastify' and a mention of PeerInfo in the node mock.
@@ -34,7 +33,6 @@ func NewEndpoint(params EndpointParams) *Endpoint { | |||
// JSON group | |||
g := e.router.Group("/api/v1/orchestrator") | |||
g.Use(middleware.SetContentType(echo.MIMEApplicationJSON)) | |||
g.Use(echo_middleware.CORS()) |
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.
why did we need to remove this? I don't have a problem with the change - just curious
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.
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.
Previously this was done on a per-endpoint basis, but this isn't necessary – we can just blanket add it to all endpoints. This also has the added benefit that CORS requests will return successfully without needing to invoke the authz handler.
This commit hooks up the Web UI to use our authentication APIs. It can now query for a list of acceptable authentication methods and show the user a web form for filling out the required credentials. The UI will monitor requests and if it detects an Unauthorized status will immediately open the auth flow. So as with the CLI, auth happens automagically when required and not otherwise.
It builds now. |
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.
LGTM.
This commit hooks up the Web UI to use our authentication APIs. It can now query for a list of acceptable authentication methods and show the user a web form for filling out the required credentials.
The UI will monitor requests and if it detects an Unauthorized status will immediately open the auth flow. So as with the CLI, auth happens automagically when required and not otherwise.
With default authorization policy in place, which doesn't require authz to use read-only APIs, the user won't see any authentication because it is not required.
But, for example, with a username/password and non-anon policy in place, the user will be redirected to a page to provide credentials:
The system remains entirely flexible, and the required credentials is still controlled by the auth policy. So with the "shared secret" auth policy used by the Marketplace deployment, the user will see:
Resolves #3679
Resolves #3641
Resolves https://github.com/bacalhau-project/expanso-planning/issues/668
Resolves https://github.com/bacalhau-project/expanso-planning/issues/669