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

feat: [WD-16972] TLS user management spike. #1026

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kxiru
Copy link
Contributor

@Kxiru Kxiru commented Dec 10, 2024

Done

  • Created "Create Identity" Button
  • Create modal to create new TLS fine grained identities.
  • A few new functions and a new LXDTrustToken type.

User Management Spike

[✔️] A user needs to be able to create a TLS user (Creates a pending user)
[✔️] A user needs to be able to destroy a TLS user (WD-16894)
[] A user needs to be able to rename a TLS user
[] A user needs to be able to change a TLS user’s publicity
[Out of Scope] A user needs the UI to be able to generate the public/private key pair for them
[Out of Scope] A user needs to be able to use an existing public key that they already have
[Out of Scope] Once a user has a private key generated by the UI, they need to know how to install it on their client machine.

Fixes:

  • Inability to create TLS fine grained tokens through the UI.

QA

  1. Run the LXD-UI:
  2. Perform the following QA steps:
    • [List the steps to QA the new feature(s) or prove that a bug has been resolved]

Screenshots

image
Screenshot from 2024-12-10 22-47-10

@Kxiru Kxiru requested review from edlerd and mas-who December 10, 2024 14:10
@Kxiru Kxiru self-assigned this Dec 10, 2024
@webteam-app
Copy link

@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch from be0eaaf to 338503b Compare December 10, 2024 14:16
@Kxiru Kxiru changed the title feat: [WD-16972] TLS user management refinement spike. feat: [WD-16972] TLS user creation spike. Dec 10, 2024
@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch from 338503b to 73db4b1 Compare December 10, 2024 21:50
@Kxiru Kxiru changed the title feat: [WD-16972] TLS user creation spike. feat: [WD-16972] TLS user management spike. Dec 10, 2024
@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch 2 times, most recently from ee9df96 to 526c441 Compare December 11, 2024 01:13
Copy link
Collaborator

@mas-who mas-who left a comment

Choose a reason for hiding this comment

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

Made some comments, I agree with @edlerd that this PR can actually be merged after some improvements. Although I'm also happy to not merge it and keep the PR as a reference for future, depending on if you have time to take it to completion

src/api/auth-identities.tsx Outdated Show resolved Hide resolved
src/types/permissions.d.ts Outdated Show resolved Hide resolved
src/types/permissions.d.ts Outdated Show resolved Hide resolved
src/util/helpers.tsx Outdated Show resolved Hide resolved
src/sass/_instance_detail_page.scss Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch from 526c441 to e5f5f61 Compare December 11, 2024 14:04
@Kxiru Kxiru requested a review from mas-who December 11, 2024 14:05
src/types/permissions.d.ts Outdated Show resolved Hide resolved
@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch from e5f5f61 to 9c5f34b Compare December 11, 2024 22:31
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

This already works well. Some ideas below to streamline code and appearance.

src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/PermissionIdentities.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
src/pages/permissions/CreateIdentityModal.tsx Outdated Show resolved Hide resolved
Comment on lines +91 to +107
<Input
id="clientName"
type="text"
label="Client Name"
onBlur={formik.handleBlur}
onChange={formik.handleChange}
value={formik.values.clientName}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are creating an identity, this should be called "Identity name", where does the "client name" idea come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the terminology that the API and documentation uses. Yes, when the identity surfaces, it appears as the "Identity name", but I believe there is more to it than just the name and that staying true to the API may avoid potential issues in the future if the API changes against our mental model of "Identity name".

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right good points. I see why the docs are doing it. They are tailoring towards a new command line client. I think in the UI, the target audience is a bit different. A user might create the token for a new client, but it could also be for another person (think an admin creating the token for a colleague). In the API layer we use, this is just "name". I agree, a "Name" label would be confusing here when creating a token. The entity that is created is referred to as "Identity" in the UI. So maybe "Identity name" is the better description to cover all target use cases. Wdyt?

@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch from 9c5f34b to c5fdbcd Compare December 12, 2024 22:00
@Kxiru Kxiru force-pushed the TLSUser-Management-Spike branch from c5fdbcd to 67c3621 Compare December 12, 2024 22:01
@Kxiru Kxiru requested review from mas-who and edlerd December 12, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants