mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-28 16:58:31 +01:00
Explain how SSO sign-in restrictions combine (#4803)
**Explain how SSO sign-in restrictions combine** Replace the editor's blanket blank-group claim with one rule all three lists can share visually and in their accessible descriptions. Preserve each field's entry syntax and distinguish role assignment from sign-in. Contract-Neutral: Existing SSO editor guidance and accessibility descriptions only; sign-in filters, roles, provider settings, and mutation behaviour are unchanged. **Keep SSO field guidance in its existing space** The first comparison showed a new row displacing the disclosure on phones and input labels elsewhere. Use the existing group hint for the rule, referencing its first sentence from Domains and Emails. Keep role advice compact in its existing hint. Contract-Neutral: Guidance placement and accessible descriptions only; no SSO rules, provider data, API, or request changes. **Record matched browser proof for SSO access guidance** Bind the production Settings comparison, including the final compact phone layout, to the reviewed runtime bytes. **Describe SSO role mappings in short sentences** The frontend copy audit rejected the semicolon in the reviewed guidance. Keep role assignment separate from the sign-in checks, and preserve the mapping format, separators and spaces in group names. Contract-Neutral: Wording and accessible-description expectation only; provider settings, SSO checks, role assignment and save behavior are unchanged. **Record browser verification for the corrected SSO guidance** Bind the matched desktop and phone comparisons to the final editor copy on the assigned main. --- Fleet candidate `20261121T001213Z-web-product` from the `web-product` lane. Reviewed tip `feb60f47a4a95db3c54ce076f88faa86b5c49b92` on `main`. [How Pulse handles triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
This commit is contained in:
34
frontend-modern/browser-verification/997ddd667c6d8ab9.json
Normal file
34
frontend-modern/browser-verification/997ddd667c6d8ab9.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"version": 1,
|
||||
"base_sha": "8ad0a821ec35425a9dbcadaf61ac224d37edab53",
|
||||
"verified_at": "2026-11-20T22:37:44Z",
|
||||
"result": "passed",
|
||||
"changed_paths": [
|
||||
"frontend-modern/src/components/Settings/SSOProvidersPanel.tsx"
|
||||
],
|
||||
"content_sha256": {
|
||||
"frontend-modern/src/components/Settings/SSOProvidersPanel.tsx": "40f0d4996c590fd4f72117dbc887b0971659d7ebe66d5e3fbcf7209517a064a8"
|
||||
},
|
||||
"routes": [
|
||||
"/settings/security-sso"
|
||||
],
|
||||
"viewports": [
|
||||
{
|
||||
"width": 1280,
|
||||
"height": 800
|
||||
},
|
||||
{
|
||||
"width": 320,
|
||||
"height": 620
|
||||
}
|
||||
],
|
||||
"states": [
|
||||
"Production-mode Settings at the existing Single Sign-On route with synthetic provider inventory and details; Playwright 1.56.1, desktop Chromium 141/light and touch-emulated WebKit 26/dark.",
|
||||
"Six inspected before/after pairs for saved OIDC (blank groups, populated domain and email) and SAML (all lists populated), including the restrictions and phone role-mapping reading positions.",
|
||||
"A blank list skips just its check and mappings describe role assignment separately. Phone field and footer geometry remain unchanged at matched reading positions. Desktop scopes and certificate labels, group claim, access disclosure and all controls remain visible in the same frames."
|
||||
],
|
||||
"interactions": [
|
||||
"182 assertions in the final browser run. Open and expand by keyboard or touch; the first tab target is unchanged. All three lists have an accessible description of the matching rule without changing saved values or accepted entry syntax.",
|
||||
"The existing saved callback/metadata copy control, Save and Cancel remain available; cancel a draft and reopen the original saved values. A read-only principal has no editor; no provider or session mutation or real IdP request."
|
||||
]
|
||||
}
|
||||
34
frontend-modern/browser-verification/b615886ab3020e2e.json
Normal file
34
frontend-modern/browser-verification/b615886ab3020e2e.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"version": 1,
|
||||
"base_sha": "07df1cf59bede1db4c3d7337f30e0c94b0aed897",
|
||||
"verified_at": "2026-11-21T00:32:09Z",
|
||||
"result": "passed",
|
||||
"changed_paths": [
|
||||
"frontend-modern/src/components/Settings/SSOProvidersPanel.tsx"
|
||||
],
|
||||
"content_sha256": {
|
||||
"frontend-modern/src/components/Settings/SSOProvidersPanel.tsx": "92fbc299b64e9a1833084fd1d27ead0d4be358954b1a974bdfc0eee9cca52789"
|
||||
},
|
||||
"routes": [
|
||||
"/settings/security-sso"
|
||||
],
|
||||
"viewports": [
|
||||
{
|
||||
"width": 1280,
|
||||
"height": 800
|
||||
},
|
||||
{
|
||||
"width": 320,
|
||||
"height": 620
|
||||
}
|
||||
],
|
||||
"states": [
|
||||
"Matched before and after captures of the actual Settings page via offline Vite preview, using Playwright 1.56.1 with light Chromium desktop and dark WebKit phone.",
|
||||
"Saved OIDC with blank groups and configured domain and email, and saved SAML with all three filters configured. Six inspected comparisons include both phone reading positions, with the role instructions in full.",
|
||||
"The rule describes only the filter skipped by a blank list. Group claim and scopes, SAML certificate and attributes, saved filters and both footer actions remain available."
|
||||
],
|
||||
"interactions": [
|
||||
"253 candidate checks. Open the saved editor and disclose restrictions with keyboard or touch. The expected field follows the disclosure in keyboard order. All three field descriptions explain the matching rule.",
|
||||
"Copy the URL from the opened provider details on desktop, cancel an unsaved change and reopen to the saved mapping. A read-only account sees the inventory with edit controls disabled. No writes to a provider or live IdP interaction."
|
||||
]
|
||||
}
|
||||
@@ -123,6 +123,7 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
|
||||
const testResultSummaryId = `${summaryIdPrefix}-test-summary`;
|
||||
const testResultId = `${summaryIdPrefix}-test-result`;
|
||||
const testResultTitleId = `${summaryIdPrefix}-test-result-title`;
|
||||
const signInRestrictionsId = `${summaryIdPrefix}-sign-in-restrictions`;
|
||||
// The server checks only URL format on the manual SAML path. Either
|
||||
// metadata source takes precedence, even when the draft also has an SSO URL.
|
||||
const isSamlUrlFormatCheck = () =>
|
||||
@@ -1000,10 +1001,18 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
|
||||
onInput={(e) => setForm('allowedGroups', e.currentTarget.value)}
|
||||
placeholder="admin, sso-users"
|
||||
textareaBaseClass={controlClass('min-h-[60px]')}
|
||||
help="Comma- or newline-separated. Group names may contain spaces. Empty allows all."
|
||||
help={
|
||||
<>
|
||||
<span id={signInRestrictionsId}>
|
||||
Each filled list needs a match. Blank skips only that check.
|
||||
</span>{' '}
|
||||
Use commas or new lines. Names can have spaces.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<FormTextarea
|
||||
label="Allowed Domains"
|
||||
aria-describedby={signInRestrictionsId}
|
||||
rows={2}
|
||||
value={form.allowedDomains}
|
||||
onInput={(e) => setForm('allowedDomains', e.currentTarget.value)}
|
||||
@@ -1013,6 +1022,7 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
|
||||
/>
|
||||
<FormTextarea
|
||||
label="Allowed Emails"
|
||||
aria-describedby={signInRestrictionsId}
|
||||
rows={2}
|
||||
value={form.allowedEmails}
|
||||
onInput={(e) => setForm('allowedEmails', e.currentTarget.value)}
|
||||
@@ -1026,7 +1036,7 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
|
||||
onInput={(e) => setForm('groupRoleMappings', e.currentTarget.value)}
|
||||
placeholder="admins=admin, ops=operator"
|
||||
textareaBaseClass={controlClass('min-h-[60px]')}
|
||||
help="Format: group=roleId. Separate mappings with commas or new lines. Group names may contain spaces."
|
||||
help="Assigns roles after sign-in checks. Enter group=roleId. Use commas or new lines. Names can have spaces."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,6 +62,48 @@ afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
describe('SSO sign-in restrictions and role mapping guidance', () => {
|
||||
it.each([
|
||||
{ type: 'oidc', groups: [] },
|
||||
{ type: 'saml', groups: ['Fleet Operators', 'Service Reviewers'] },
|
||||
] as const)('describes each $type filter even when one is blank', async ({ type, groups }) => {
|
||||
const provider = { ...saml, type };
|
||||
setup([provider], {
|
||||
...provider,
|
||||
allowedGroups: groups,
|
||||
allowedDomains: ['example.test'],
|
||||
allowedEmails: ['operator@example.test'],
|
||||
groupRoleMappings: { 'Fleet Operators': 'operator' },
|
||||
});
|
||||
render(() => <SSOProvidersPanel />);
|
||||
|
||||
const dialog = await edit(type.toUpperCase());
|
||||
expect(dialog.queryByRole('textbox', { name: 'Allowed Groups' })).toBeNull();
|
||||
fireEvent.click(
|
||||
dialog.getByRole('button', { name: 'Show access restrictions & role mapping' }),
|
||||
);
|
||||
const rule = 'Each filled list needs a match. Blank skips only that check.';
|
||||
const allowedGroups = dialog.getByRole('textbox', { name: 'Allowed Groups' });
|
||||
const allowedDomains = dialog.getByRole('textbox', { name: 'Allowed Domains' });
|
||||
const allowedEmails = dialog.getByRole('textbox', { name: 'Allowed Emails' });
|
||||
expect(allowedGroups).toHaveValue(groups.join(', '));
|
||||
expect(allowedDomains).toHaveValue('example.test');
|
||||
expect(allowedEmails).toHaveValue('operator@example.test');
|
||||
expect(allowedGroups).toHaveAccessibleDescription(
|
||||
`${rule} Use commas or new lines. Names can have spaces.`,
|
||||
);
|
||||
expect(allowedDomains).toHaveAccessibleDescription(`${rule} Email domains (without @)`);
|
||||
expect(allowedEmails).toHaveAccessibleDescription(rule);
|
||||
expect(
|
||||
dialog.getByRole('textbox', { name: 'Group Role Mappings' }),
|
||||
).toHaveAccessibleDescription(
|
||||
'Assigns roles after sign-in checks. Enter group=roleId. Use commas or new lines. Names can have spaces.',
|
||||
);
|
||||
expect(dialog.queryByText(/Empty allows all/)).toBeNull();
|
||||
readOnlyRequests();
|
||||
});
|
||||
});
|
||||
|
||||
describe('SSO editor registration authority', () => {
|
||||
it.each([metadata, 'https://pulse.lan:8443/api/saml/setup/metadata?view=full'])(
|
||||
'displays and copies the detail metadata URL exactly: %s',
|
||||
|
||||
Reference in New Issue
Block a user