Skip to content

Conversation

@david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Nov 24, 2021

  • add "login" form at /login that's just buttons for
    • log in as privileged
    • log in as unprivileged
    • bad login request
    • logout
  • Update generated API to include login and logout endpoints from Console API: sessions + static assets omicron#384 (we'll merge that first and then we can update the commit here to be one on omicron main)

Demo

2021-11-23-nexus-console

@vercel
Copy link

vercel bot commented Nov 24, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/oxidecomputer/console-ui-storybook/7Ge8wTMreba44srfcbDeZ1eXGjVL
✅ Preview: https://console-ui-storybook-git-serve-from-nexus-oxidecomputer.vercel.app

@github-actions
Copy link
Contributor

Preview will be deployed at https://console-git-serve-from-nexus.internal.oxide.computer

@david-crespo david-crespo temporarily deployed to Preview VM November 24, 2021 03:37 Inactive
@jessfraz jessfraz temporarily deployed to Preview VM November 24, 2021 03:43 Inactive
@david-crespo david-crespo marked this pull request as ready for review November 24, 2021 16:13
Comment on lines +178 to +191
"post": {
"operationId": "spoof_login",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LoginParams"
}
}
},
"required": true
},
"responses": {}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming this eventually goes away? It seems like while we may still want the capability for dev, we definitely wouldn't want it in the public api spec.

Copy link
Collaborator Author

@david-crespo david-crespo Nov 24, 2021

Choose a reason for hiding this comment

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

Yes, that's correct. The demo login form is really only in the console bundle in the first place because of the convenience of using existing styles. Login will really be through the customer's IdP, but If Nexus does end up serving some kind of login form, e.g., for use by admins before the IdP is set up, I think that should be a separate bundle with minimal JS (ideally so minimal we could inline it in the HTML response) and it would not use the generated API client at all. It could even use an HTML form POST.

I'll make a comment about this in the LoginPage file.

onError: () => {
addToast({
title: 'Bad credentials',
icon: <Warning12Icon />,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd definitely like to update the icon apis a bit. This was the most expedient implementation, but eventually I'd like to at least have <WarningIcon size={12}/> where size is required and strictly typed.


<div className="space-x-4">
<Link to={`/orgs/${orgName}/projects/new`} className={buttonStyle()}>
<Link to="projects/new" className={buttonStyle()}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this because the link is relative to the current location?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Almost, it's relative to the parent node in the route tree, in this case /orgs/:orgName.

console/app/routes.tsx

Lines 71 to 73 in c1378a6

<Route path="orgs">
<Route path=":orgName" element={<RootLayout />} crumb={orgCrumb}>
<Route index element={<OrgPage />} />

Originally I did this because it made the link totally indifferent to the /c/ prefix, but even without that it's kind of cool not to have to explicitly build up the full route. On the other hand it's a layer of misdirection because in order to know where this link goes, you have to know what route is rendering this page. So I'm open to changing it back.

Comment on lines 25 to 31
# if [ "$CURRENT_API_VERSION" != "$PINNED_API_VERSION" ]; then
# echo -e "\nERROR: Omicron version pinned in console does not match HEAD\n" >&2
# echo -e " pinned: $PINNED_API_VERSION" >&2
# echo -e " HEAD: $CURRENT_API_VERSION\n" >&2
# echo -e "Check out the pinned commit and try again.\n" >&2
# exit 1
# fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Why comment this out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

forgot to undo it

Copy link
Contributor

@just-be-dev just-be-dev left a comment

Choose a reason for hiding this comment

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

Overall looks good. I'm pretty excited for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants