From 727c3367c3d4aafaa2cb6bfbd19bfa2632acb7b2 Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Mon, 28 Oct 2024 11:45:46 -0700 Subject: [PATCH 1/5] Add Group Attribute Name field to IdP view --- app/forms/idp/edit.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/forms/idp/edit.tsx b/app/forms/idp/edit.tsx index a5cbc1e07a..b27d1cf7e2 100644 --- a/app/forms/idp/edit.tsx +++ b/app/forms/idp/edit.tsx @@ -104,14 +104,13 @@ export function EditIdpSideModalForm() { control={form.control} disabled /> - {/* TODO: add group attribute name when it is added to the API - */} + {/* TODO: Email field, probably */} Date: Mon, 28 Oct 2024 11:53:32 -0700 Subject: [PATCH 2/5] Use text-balance to even out ragged field descriptions --- app/ui/lib/TextInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/lib/TextInput.tsx b/app/ui/lib/TextInput.tsx index 965433d857..31cff48273 100644 --- a/app/ui/lib/TextInput.tsx +++ b/app/ui/lib/TextInput.tsx @@ -101,7 +101,7 @@ export const TextInputHint = ({ id, children, className }: HintProps) => (
_a]:underline hover:[&_>_a]:text-default', + 'mt-1 text-balance text-sans-sm text-tertiary [&_>_a]:underline hover:[&_>_a]:text-default', className )} > From ce1c19da827dfe15749865490a1043825fbed262 Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Mon, 28 Oct 2024 11:59:01 -0700 Subject: [PATCH 3/5] add 'required' so we hide the 'optional' text --- app/forms/idp/edit.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/forms/idp/edit.tsx b/app/forms/idp/edit.tsx index b27d1cf7e2..766c8d24cb 100644 --- a/app/forms/idp/edit.tsx +++ b/app/forms/idp/edit.tsx @@ -108,6 +108,7 @@ export function EditIdpSideModalForm() { name="groupAttributeName" label="Group attribute name" description="Name of the SAML attribute sent by the IdP containing a comma-separated list of groups for the authenticated user" + required control={form.control} disabled /> From cc5f7fd6725276379082c646aa3cf4a6f9d3a6df Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Mon, 28 Oct 2024 13:48:09 -0700 Subject: [PATCH 4/5] Update help copy; undo text-balance --- app/forms/idp/create.tsx | 2 +- app/forms/idp/edit.tsx | 2 +- app/ui/lib/TextInput.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/forms/idp/create.tsx b/app/forms/idp/create.tsx index 4fa8e10fa7..079d9a0ed5 100644 --- a/app/forms/idp/create.tsx +++ b/app/forms/idp/create.tsx @@ -133,7 +133,7 @@ export function CreateIdpSideModalForm() { {/* TODO: Email field, probably */} diff --git a/app/forms/idp/edit.tsx b/app/forms/idp/edit.tsx index 766c8d24cb..b51d1d9043 100644 --- a/app/forms/idp/edit.tsx +++ b/app/forms/idp/edit.tsx @@ -107,7 +107,7 @@ export function EditIdpSideModalForm() { (
_a]:underline hover:[&_>_a]:text-default', + 'mt-1 text-sans-sm text-tertiary [&_>_a]:underline hover:[&_>_a]:text-default', className )} > From e057686fc4414ae7c1d3025094d25916cf66b866 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Mon, 28 Oct 2024 16:16:22 -0500 Subject: [PATCH 5/5] add group attribute name to the mock IdP and test it --- mock-api/silo.ts | 1 + test/e2e/silos.e2e.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mock-api/silo.ts b/mock-api/silo.ts index fb14ccd4c3..c764e0852d 100644 --- a/mock-api/silo.ts +++ b/mock-api/silo.ts @@ -85,6 +85,7 @@ export const samlIdp: Json = { slo_url: '', sp_client_id: '', technical_contact_email: '', + group_attribute_name: 'groups', } // This works differently from Nexus, but the result is the same. In Nexus, diff --git a/test/e2e/silos.e2e.ts b/test/e2e/silos.e2e.ts index b37b2e862a..3be8297cf1 100644 --- a/test/e2e/silos.e2e.ts +++ b/test/e2e/silos.e2e.ts @@ -186,6 +186,10 @@ test('Identity providers', async ({ page }) => { 'text="Single Logout (SLO) URL"', ]) + await expect(page.getByRole('textbox', { name: 'Group attribute name' })).toHaveValue( + 'groups' + ) + await page.getByRole('button', { name: 'Cancel' }).click() await expectNotVisible(page, ['role=dialog[name="Identity provider"]']) })