From 9d9e77479010e0350ca4445eec455ae1b517a363 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 19 Aug 2022 13:57:25 +0200 Subject: [PATCH] converts attribute names (#3134) * converts attribute names fixes: #3092 * revert changes previosly failing test & unskip fixed one Co-authored-by: Ivan Khomyn --- cypress/e2e/clients_saml_test.spec.ts | 10 +--------- src/clients/keys/SamlKeys.tsx | 5 +++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/clients_saml_test.spec.ts b/cypress/e2e/clients_saml_test.spec.ts index 2d0f233f1d..3fa2261e7a 100644 --- a/cypress/e2e/clients_saml_test.spec.ts +++ b/cypress/e2e/clients_saml_test.spec.ts @@ -79,13 +79,6 @@ describe("Clients SAML tests", () => { it("should doesn't disable signature when cancel", () => { cy.findByTestId("clientSignature").click({ force: true }); - cy.findByTestId("generate").click(); - masthead.checkNotificationMessage( - "New key pair and certificate generated successfully" - ); - modalUtils.confirmModal(); - - cy.findByTestId("clientSignature").click({ force: true }); modalUtils .checkModalTitle('Disable "Client signature required"') .cancelModal(); @@ -93,8 +86,7 @@ describe("Clients SAML tests", () => { cy.findAllByTestId("certificate").should("have.length", 1); }); - // https://github.com/keycloak/keycloak-admin-ui/issues/3092 - it.skip("should disable client signature", () => { + it("should disable client signature", () => { cy.intercept( "admin/realms/master/clients/*/certificates/saml.signing" ).as("load"); diff --git a/src/clients/keys/SamlKeys.tsx b/src/clients/keys/SamlKeys.tsx index 9ee6914027..7d804c87b5 100644 --- a/src/clients/keys/SamlKeys.tsx +++ b/src/clients/keys/SamlKeys.tsx @@ -27,6 +27,7 @@ import { Certificate } from "./Certificate"; import { useConfirmDialog } from "../../components/confirm-dialog/ConfirmDialog"; import { useAlerts } from "../../components/alert/Alerts"; import { SamlImportKeyDialog } from "./SamlImportKeyDialog"; +import { convertAttributeNameToForm } from "../../util"; type SamlKeysProps = { clientId: string; @@ -38,12 +39,12 @@ export type KeyTypes = typeof KEYS[number]; const KEYS_MAPPING: { [key in KeyTypes]: { [index: string]: string } } = { "saml.signing": { - name: "attributes.saml.client.signature", + name: convertAttributeNameToForm("attributes.saml.client.signature"), title: "signingKeysConfig", key: "clientSignature", }, "saml.encryption": { - name: "attributes.saml.encrypt", + name: convertAttributeNameToForm("attributes.saml.encrypt"), title: "encryptionKeysConfig", key: "encryptAssertions", },