From ef42500e9d46049a2f1ada195e5ddc3fa6289972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Fri, 20 Dec 2024 13:45:19 +0000 Subject: [PATCH 1/3] fix(my-pages): Health - Organ donation string mix (#17326) --- .../health/src/screens/OrganDonation/OrganDonation.tsx | 4 ++-- .../src/screens/OrganDonation/components/RegistrationForm.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/portals/my-pages/health/src/screens/OrganDonation/OrganDonation.tsx b/libs/portals/my-pages/health/src/screens/OrganDonation/OrganDonation.tsx index 7ef00c370fb5..f99e0cf5b1a0 100644 --- a/libs/portals/my-pages/health/src/screens/OrganDonation/OrganDonation.tsx +++ b/libs/portals/my-pages/health/src/screens/OrganDonation/OrganDonation.tsx @@ -43,8 +43,8 @@ const OrganDonation = () => { iAmOrganDonorWithExceptionsText: formatMessage( m.iAmOrganDonorWithExceptionsText, ), - iAmNotOrganDonorText: formatMessage(m.iAmOrganDonorText), - iAmOrganDonorText: formatMessage(m.iAmNotOrganDonorText), + iAmNotOrganDonorText: formatMessage(m.iAmNotOrganDonorText), + iAmOrganDonorText: formatMessage(m.iAmOrganDonorText), iAmOrganDonorWithExceptions: formatMessage(m.iAmOrganDonorWithExceptions), iAmOrganDonor: formatMessage(m.iAmOrganDonor), iAmNotOrganDonor: formatMessage(m.iAmNotOrganDonor), diff --git a/libs/portals/my-pages/health/src/screens/OrganDonation/components/RegistrationForm.tsx b/libs/portals/my-pages/health/src/screens/OrganDonation/components/RegistrationForm.tsx index 4b4db5a87fcf..f06005e5afae 100644 --- a/libs/portals/my-pages/health/src/screens/OrganDonation/components/RegistrationForm.tsx +++ b/libs/portals/my-pages/health/src/screens/OrganDonation/components/RegistrationForm.tsx @@ -87,7 +87,7 @@ export const OrganRegistrationForm = () => { const formData = new FormData(e.currentTarget) const data = Object.fromEntries(formData.entries()) const idKey = 'selected-limitations-' - const otherLimitations = data['otherLimitatons'].toString() + const otherLimitations = data['otherLimitatons']?.toString() const limitations = Object.keys(data) .filter((key) => key.includes(idKey)) .map((key) => key.replace(idKey, '').toLowerCase()) From 73efe537b6daa434c0c224ffad882b612a8ed876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigr=C3=BAn=20Tinna=20Gissurard=C3=B3ttir?= <39527334+sigruntg@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:04:18 +0000 Subject: [PATCH 2/3] fix(register-new-macine): making street registration optional (#17332) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../templates/aosh/register-new-machine/src/lib/dataSchema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/application/templates/aosh/register-new-machine/src/lib/dataSchema.ts b/libs/application/templates/aosh/register-new-machine/src/lib/dataSchema.ts index 12432ed6ecf9..c921799ac33b 100644 --- a/libs/application/templates/aosh/register-new-machine/src/lib/dataSchema.ts +++ b/libs/application/templates/aosh/register-new-machine/src/lib/dataSchema.ts @@ -252,7 +252,7 @@ export const NewMachineAnswersSchema = z.object({ streetRegistration: z .object({ registerToTraffic: z.enum([YES, NO]), - size: z.enum(['1', '2', '3']), + size: z.enum(['1', '2', '3']).optional(), }) .optional(), }), From 18269879537a47ae8be7ba20a93b645e0e90a697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnlaugur=20Gu=C3=B0mundsson?= <34029342+GunnlaugurG@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:03:19 +0000 Subject: [PATCH 3/3] feat(auth-admin): Allow non super users to publish super user fields (#17290) --- .../app/v2/clients/test/me-clients.spec.ts | 24 ++++++++++++------- .../clients/admin/admin-clients.service.ts | 17 +------------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/apps/services/auth/admin-api/src/app/v2/clients/test/me-clients.spec.ts b/apps/services/auth/admin-api/src/app/v2/clients/test/me-clients.spec.ts index 58235d12f2b1..3e73048f6aca 100644 --- a/apps/services/auth/admin-api/src/app/v2/clients/test/me-clients.spec.ts +++ b/apps/services/auth/admin-api/src/app/v2/clients/test/me-clients.spec.ts @@ -431,23 +431,26 @@ describe('MeClientsController with auth', () => { slidingRefreshTokenLifetime: typeSpecificDefaults.slidingRefreshTokenLifetime ?? clientBaseAttributes.slidingRefreshTokenLifetime, - accessTokenLifetime: clientBaseAttributes.accessTokenLifetime, + accessTokenLifetime: + typeSpecificDefaults.accessTokenLifetime ?? + clientBaseAttributes.accessTokenLifetime, allowOfflineAccess: clientBaseAttributes.allowOfflineAccess, redirectUris: [], postLogoutRedirectUris: [], requireApiScopes: false, requireConsent: false, - requirePkce: true, - supportTokenExchange: false, + requirePkce: + typeSpecificDefaults.requirePkce ?? clientBaseAttributes.requirePkce, + supportTokenExchange: typeSpecificDefaults.supportTokenExchange, supportsCustomDelegation: false, supportsLegalGuardians: false, supportsPersonalRepresentatives: false, supportsProcuringHolders: false, promptDelegations: false, - customClaims: [], + customClaims: typeSpecificDefaults.customClaims ?? [], singleSession: false, supportedDelegationTypes: [], - allowedAcr: [defaultAcrValue], + allowedAcr: typeSpecificDefaults.allowedAcr ?? [defaultAcrValue], }) // Assert - db record @@ -468,9 +471,14 @@ describe('MeClientsController with auth', () => { absoluteRefreshTokenLifetime: typeSpecificDefaults.absoluteRefreshTokenLifetime ?? clientBaseAttributes.absoluteRefreshTokenLifetime, - accessTokenLifetime: clientBaseAttributes.accessTokenLifetime, - allowOfflineAccess: clientBaseAttributes.allowOfflineAccess, - requirePkce: clientBaseAttributes.requirePkce, + accessTokenLifetime: + typeSpecificDefaults.accessTokenLifetime ?? + clientBaseAttributes.accessTokenLifetime, + allowOfflineAccess: + typeSpecificDefaults.allowOfflineAccess ?? + clientBaseAttributes.allowOfflineAccess, + requirePkce: + typeSpecificDefaults.requirePkce ?? clientBaseAttributes.requirePkce, refreshTokenExpiration: translateRefreshTokenExpiration( typeSpecificDefaults.refreshTokenExpiration, ), diff --git a/libs/auth-api-lib/src/lib/clients/admin/admin-clients.service.ts b/libs/auth-api-lib/src/lib/clients/admin/admin-clients.service.ts index f919f1611294..474cf26dbee2 100644 --- a/libs/auth-api-lib/src/lib/clients/admin/admin-clients.service.ts +++ b/libs/auth-api-lib/src/lib/clients/admin/admin-clients.service.ts @@ -173,21 +173,6 @@ export class AdminClientsService { throw new BadRequestException('Invalid client id') } - // If user is not super admin, we remove the super admin fields from the input to default to the client base attributes - if (!this.isSuperAdmin(user)) { - clientDto = { - clientId: clientDto.clientId, - clientType: clientDto.clientType, - clientName: clientDto.clientName, - // Remove defined super admin fields - ...omit(clientDto, superUserFields), - // Remove personal representative from delegation types since it is not allowed for non-super admins - supportedDelegationTypes: delegationTypeSuperUserFilter( - clientDto.supportedDelegationTypes ?? [], - ), - } - } - const { customClaims, displayName, @@ -600,7 +585,7 @@ export class AdminClientsService { client.supportedDelegationTypes?.map( (clientDelegationType) => clientDelegationType.delegationType, ) ?? [], - allowedAcr: client.allowedAcr ?? [], + allowedAcr: client.allowedAcr.map((v) => v.toString()) ?? [], } }