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

Support more fields to the role editor #51458

Open
wants to merge 1 commit into
base: bl-nero/fieldinput-labelsinput
Choose a base branch
from

Conversation

bl-nero
Copy link
Contributor

@bl-nero bl-nero commented Jan 24, 2025

This PR adds the following fields:

  • DB service labels
  • Kubernetes users
  • where clause in access rules. I took liberty to call it "Condition" in the UI, so please voice your opinion on whether this is a good choice. My line of reasoning is that without understanding the underlying YAML model, the name "Where" would be confusing.

The intent behind this PR was to fully support the access role in the rich UI, but it turned out that one more field was added to it, so we still miss the target. However, I added warnings to the Go codebase now, so hopefully, this will make it easier to prevent these situations in future.

Screenshot 2025-01-24 at 13 59 46
Screenshot 2025-01-24 at 13 59 24
Screenshot 2025-01-24 at 13 59 07

Requires #51457

@bl-nero bl-nero changed the title Add remaining role fields to support the built-in roles in the editor Support more fields to the role editor Jan 24, 2025
@bl-nero bl-nero force-pushed the bl-nero/role-editor-more-fields branch from e946468 to 4ebf9db Compare January 24, 2025 13:07
@bl-nero bl-nero marked this pull request as ready for review January 24, 2025 13:07
@github-actions github-actions bot requested review from kimlisa and rudream January 24, 2025 13:08
@bl-nero bl-nero added the no-changelog Indicates that a PR does not require a changelog entry label Jan 24, 2025
<Text typography="body3" mb={1}>
Labels
</Text>
<FieldSelectCreatable
Copy link
Contributor

Choose a reason for hiding this comment

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

the inputs placeholder says Select..., are we supposed to have a list of users to select? or maybe replace with Start typing a user and press enter?

/>
</Box>
<LabelsInput
legend="Labels"
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also add a tooltip explaining labels as well?

/>
<LabelsInput
legend="Database Service Labels"
tooltipContent="The database service labels have no influence on which databases' access is controlled by this role. Instead, they control which database services are discoverable while enrolling a new database."
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead, they control which database services are discoverable while enrolling a new database.

tbh, i didn't understand what this means 😢, can we simplify it? The ai doc says:

image

@@ -112,6 +115,26 @@ const AccessRule = memo(function AccessRule({
value={verbs}
onChange={v => setRule({ ...value, verbs: v })}
rule={precomputed(validation.fields.verbs)}
/>
<FieldInput
label="Condition"
Copy link
Contributor

Choose a reason for hiding this comment

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

personally i think it's okay to label it this way, but i'd also double check with product team because we try to teach users consistent wording

Comment on lines +123 to +131
Additional condition, expressed using the{' '}
<Text
as="a"
href="https://goteleport.com/docs/reference/predicate-language/"
target="_blank"
color={theme.colors.interactive.solid.accent.default}
>
Teleport predicate language
</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

what about something like: Optional condition further limiting the scope for this rule expressed using the ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v17 no-changelog Indicates that a PR does not require a changelog entry size/md ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants