Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-nero committed Jan 29, 2025
1 parent 1dd172a commit cdcd860
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('AccessRules', () => {
'list',
'read',
]);
await user.type(screen.getByLabelText('Condition'), 'some-condition');
await user.type(screen.getByLabelText('Filter'), 'some-filter');
expect(modelRef).toHaveBeenLastCalledWith([
{
id: expect.any(String),
Expand All @@ -70,7 +70,7 @@ describe('AccessRules', () => {
{ label: 'list', value: 'list' },
{ label: 'read', value: 'read' },
],
where: 'some-condition',
where: 'some-filter',
},
] as RuleModel[]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ const AccessRule = memo(function AccessRule({
rule={precomputed(validation.fields.verbs)}
/>
<FieldInput
label="Condition"
label="Filter"
toolTipContent={
<>
Additional condition, expressed using the{' '}
Optional condition that further limits the list of resources
affected by this rule, expressed using the{' '}
<Text
as="a"
href="https://goteleport.com/docs/reference/predicate-language/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export function ServerAccessSection({
<FieldSelectCreatable
isMulti
label="Logins"
placeholder="Type a login and press Enter"
isDisabled={isProcessing}
formatCreateLabel={label => `Login: ${label}`}
components={{
Expand Down Expand Up @@ -269,6 +270,7 @@ export function KubernetesAccessSection({
<FieldSelectCreatable
isMulti
label="Groups"
placeholder="Type a group name and press Enter"
isDisabled={isProcessing}
formatCreateLabel={label => `Group: ${label}`}
components={{
Expand All @@ -282,6 +284,7 @@ export function KubernetesAccessSection({
<FieldSelectCreatable
isMulti
label="Users"
placeholder="Type a user name and press Enter"
isDisabled={isProcessing}
formatCreateLabel={label => `User: ${label}`}
components={{
Expand Down Expand Up @@ -485,6 +488,7 @@ export function DatabaseAccessSection({
<Box mb={3}>
<LabelsInput
legend="Labels"
tooltipContent="Access to databases with these labels will be affected by this role"
disableBtns={isProcessing}
labels={value.labels}
setLabels={labels => onChange?.({ ...value, labels })}
Expand All @@ -494,6 +498,7 @@ export function DatabaseAccessSection({
<FieldSelectCreatable
isMulti
label="Database Names"
placeholder="Type a database name and press Enter"
toolTipContent={
<>
List of database names that this role is allowed to connect to.
Expand All @@ -512,6 +517,7 @@ export function DatabaseAccessSection({
<FieldSelectCreatable
isMulti
label="Database Users"
placeholder="Type a user name and press Enter"
toolTipContent={
<>
List of database users that this role is allowed to connect as.
Expand All @@ -530,6 +536,7 @@ export function DatabaseAccessSection({
<FieldSelectCreatable
isMulti
label="Database Roles"
placeholder="Type a role name and press Enter"
toolTipContent="If automatic user provisioning is available, this is the list of database roles that will be assigned to the database user after it's created"
isDisabled={isProcessing}
formatCreateLabel={label => `Database Role: ${label}`}
Expand All @@ -543,7 +550,7 @@ export function DatabaseAccessSection({
/>
<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."
tooltipContent="The database service labels control which Database Services (Teleport Agents) are visible to the user, which is required when adding Databases in the Enroll New Resource wizard. Access to Databases themselves is controlled by the Database Labels field."
disableBtns={isProcessing}
labels={value.dbServiceLabels}
setLabels={dbServiceLabels => onChange?.({ ...value, dbServiceLabels })}
Expand Down Expand Up @@ -573,6 +580,7 @@ export function WindowsDesktopAccessSection({
<FieldSelectCreatable
isMulti
label="Logins"
placeholder="Type a login and press Enter"
toolTipContent="List of desktop logins that this role is allowed to use"
isDisabled={isProcessing}
formatCreateLabel={label => `Login: ${label}`}
Expand Down

0 comments on commit cdcd860

Please sign in to comment.