diff --git a/apps/services/regulations-admin-backend/infra/regulations-admin-backend.ts b/apps/services/regulations-admin-backend/infra/regulations-admin-backend.ts index 5dbc4a161be7..1af574773a05 100644 --- a/apps/services/regulations-admin-backend/infra/regulations-admin-backend.ts +++ b/apps/services/regulations-admin-backend/infra/regulations-admin-backend.ts @@ -1,5 +1,9 @@ import { service, ServiceBuilder } from '../../../../infra/src/dsl/dsl' -import { Base, Client, NationalRegistry } from '../../../../infra/src/dsl/xroad' +import { + Base, + Client, + NationalRegistryB2C, +} from '../../../../infra/src/dsl/xroad' export const serviceSetup = (): ServiceBuilder<'regulations-admin-backend'> => service('regulations-admin-backend') @@ -25,12 +29,14 @@ export const serviceSetup = (): ServiceBuilder<'regulations-admin-backend'> => '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_PUBLISH', REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED', + NATIONAL_REGISTRY_B2C_CLIENT_SECRET: + '/k8s/api/NATIONAL_REGISTRY_B2C_CLIENT_SECRET', }) .resources({ limits: { cpu: '400m', memory: '512Mi' }, requests: { cpu: '100m', memory: '256Mi' }, }) - .xroad(Base, Client, NationalRegistry) + .xroad(Base, Client, NationalRegistryB2C) .readiness('/liveness') .liveness('/liveness') .grantNamespaces('islandis', 'download-service') diff --git a/apps/services/regulations-admin-backend/src/app/app.module.ts b/apps/services/regulations-admin-backend/src/app/app.module.ts index 9b3091ce8be0..bd954e9eb794 100644 --- a/apps/services/regulations-admin-backend/src/app/app.module.ts +++ b/apps/services/regulations-admin-backend/src/app/app.module.ts @@ -9,7 +9,7 @@ import { AuthModule } from '@island.is/auth-nest-tools' import { AuditModule } from '@island.is/nest/audit' import { environment } from '../environments' -import { NationalRegistryClientConfig } from '@island.is/clients/national-registry-v2' +import { NationalRegistryV3ClientConfig } from '@island.is/clients/national-registry-v3' import { RegulationsClientConfig } from '@island.is/clients/regulations' import { DraftRegulationModule } from './modules/draft_regulation' import { DraftRegulationChangeModule } from './modules/draft_regulation_change' @@ -31,7 +31,7 @@ import { SequelizeConfigService } from './sequelizeConfig.service' load: [ RegulationsClientConfig, XRoadConfig, - NationalRegistryClientConfig, + NationalRegistryV3ClientConfig, IdsClientConfig, ], }), diff --git a/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.module.ts b/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.module.ts index 775dbc200d59..841cc4acac67 100644 --- a/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.module.ts +++ b/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.module.ts @@ -7,7 +7,7 @@ import { DraftRegulationModel } from './draft_regulation.model' import { DraftRegulationChangeModule } from '../draft_regulation_change' import { DraftRegulationCancelModule } from '../draft_regulation_cancel' import { RegulationsService } from '@island.is/clients/regulations' -import { NationalRegistryClientModule } from '@island.is/clients/national-registry-v2' +import { NationalRegistryV3ClientModule } from '@island.is/clients/national-registry-v3' import { DraftAuthorModule } from '../draft_author' @Module({ @@ -16,7 +16,7 @@ import { DraftAuthorModule } from '../draft_author' DraftAuthorModule, DraftRegulationChangeModule, DraftRegulationCancelModule, - NationalRegistryClientModule, + NationalRegistryV3ClientModule, ], providers: [DraftRegulationService, RegulationsService], controllers: [DraftRegulationController], diff --git a/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.service.ts b/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.service.ts index a92b649e388f..4de5b6eacefd 100644 --- a/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.service.ts +++ b/apps/services/regulations-admin-backend/src/app/modules/draft_regulation/draft_regulation.service.ts @@ -30,7 +30,7 @@ import { } from '@island.is/regulations/admin' import { Kennitala, RegQueryName } from '@island.is/regulations' import * as kennitala from 'kennitala' -import { NationalRegistryClientService } from '@island.is/clients/national-registry-v2' +import { NationalRegistryV3ClientService } from '@island.is/clients/national-registry-v3' import type { User } from '@island.is/auth-nest-tools' const sortImpacts = ( @@ -54,7 +54,7 @@ export class DraftRegulationService { private readonly regulationsService: RegulationsService, @Inject(LOGGER_PROVIDER) private readonly logger: Logger, - private readonly nationalRegistryApi: NationalRegistryClientService, + private readonly nationalRegistryApi: NationalRegistryV3ClientService, ) {} async getAll(user?: User, page = 1): Promise { @@ -337,12 +337,14 @@ export class DraftRegulationService { if (!author) { try { - const person = await this.nationalRegistryApi.getIndividual( + const person = await this.nationalRegistryApi.getAllDataIndividual( nationalId, + false, ) - if (person?.name) { + + if (person?.nafn) { author = { - name: person.name, + name: person.nafn, authorId: nationalId, } await this.draftAuthorService.create(author) diff --git a/charts/islandis/values.dev.yaml b/charts/islandis/values.dev.yaml index 037e9e7201fe..c8fbd907f529 100644 --- a/charts/islandis/values.dev.yaml +++ b/charts/islandis/values.dev.yaml @@ -1865,15 +1865,15 @@ regulations-admin-backend: IDENTITY_SERVER_CLIENT_ID: '@island.is/clients/regulations-admin-api' IDENTITY_SERVER_ISSUER_URL: 'https://identity-server.dev01.devland.is' LOG_LEVEL: 'info' + NATIONAL_REGISTRY_B2C_CLIENT_ID: 'b464afdd-056b-406d-b650-6d41733cfeb7' + NATIONAL_REGISTRY_B2C_ENDPOINT: 'https://skraidentitydev.b2clogin.com/skraidentitydev.onmicrosoft.com/b2c_1_midlun_flow/oauth2/v2.0/token' + NATIONAL_REGISTRY_B2C_PATH: 'IS-DEV/GOV/10001/SKRA-Cloud-Protected/Midlun-v1' + NATIONAL_REGISTRY_B2C_SCOPE: 'https://skraidentitydev.onmicrosoft.com/midlun/.default' NODE_OPTIONS: '--max-old-space-size=460 -r dd-trace/init' SERVERSIDE_FEATURES_ON: '' XROAD_BASE_PATH: 'http://securityserver.dev01.devland.is' XROAD_BASE_PATH_WITH_ENV: 'http://securityserver.dev01.devland.is/r1/IS-DEV' XROAD_CLIENT_ID: 'IS-DEV/GOV/10000/island-is-client' - XROAD_NATIONAL_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.5fzau3.euw1.cache.amazonaws.com:6379"]' - XROAD_NATIONAL_REGISTRY_SERVICE_PATH: 'IS-DEV/GOV/10001/SKRA-Protected/Einstaklingar-v1' - XROAD_TJODSKRA_API_PATH: '/SKRA-Protected/Einstaklingar-v1' - XROAD_TJODSKRA_MEMBER_CODE: '10001' XROAD_TLS_BASE_PATH: 'https://securityserver.dev01.devland.is' XROAD_TLS_BASE_PATH_WITH_ENV: 'https://securityserver.dev01.devland.is/r1/IS-DEV' grantNamespaces: @@ -1941,6 +1941,7 @@ regulations-admin-backend: CONFIGCAT_SDK_KEY: '/k8s/configcat/CONFIGCAT_SDK_KEY' DB_PASS: '/k8s/regulations-admin-backend/DB_PASSWORD' IDENTITY_SERVER_CLIENT_SECRET: '/k8s/services-regulations-admin/IDENTITY_SERVER_CLIENT_SECRET' + NATIONAL_REGISTRY_B2C_CLIENT_SECRET: '/k8s/api/NATIONAL_REGISTRY_B2C_CLIENT_SECRET' REGULATIONS_API_URL: '/k8s/api/REGULATIONS_API_URL' REGULATIONS_FILE_UPLOAD_KEY_DRAFT: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_DRAFT' REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED' diff --git a/charts/islandis/values.prod.yaml b/charts/islandis/values.prod.yaml index a8633b01264a..92b9250b3f09 100644 --- a/charts/islandis/values.prod.yaml +++ b/charts/islandis/values.prod.yaml @@ -1733,15 +1733,15 @@ regulations-admin-backend: IDENTITY_SERVER_CLIENT_ID: '@island.is/clients/regulations-admin-api' IDENTITY_SERVER_ISSUER_URL: 'https://innskra.island.is' LOG_LEVEL: 'info' + NATIONAL_REGISTRY_B2C_CLIENT_ID: '2304d7ca-7ed3-4188-8b6d-e1b7e0e3df7f' + NATIONAL_REGISTRY_B2C_ENDPOINT: 'https://skraidentity.b2clogin.com/skraidentity.onmicrosoft.com/b2c_1_midlun_flow/oauth2/v2.0/token' + NATIONAL_REGISTRY_B2C_PATH: 'IS/GOV/6503760649/SKRA-Cloud-Protected/Midlun-v1' + NATIONAL_REGISTRY_B2C_SCOPE: 'https://skraidentity.onmicrosoft.com/midlun/.default' NODE_OPTIONS: '--max-old-space-size=460 -r dd-trace/init' SERVERSIDE_FEATURES_ON: 'driving-license-use-v1-endpoint-for-v2-comms' XROAD_BASE_PATH: 'http://securityserver.island.is' XROAD_BASE_PATH_WITH_ENV: 'http://securityserver.island.is/r1/IS' XROAD_CLIENT_ID: 'IS/GOV/5501692829/island-is-client' - XROAD_NATIONAL_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.whakos.euw1.cache.amazonaws.com:6379"]' - XROAD_NATIONAL_REGISTRY_SERVICE_PATH: 'IS/GOV/6503760649/SKRA-Protected/Einstaklingar-v1' - XROAD_TJODSKRA_API_PATH: '/SKRA-Protected/Einstaklingar-v1' - XROAD_TJODSKRA_MEMBER_CODE: '6503760649' XROAD_TLS_BASE_PATH: 'https://securityserver.island.is' XROAD_TLS_BASE_PATH_WITH_ENV: 'https://securityserver.island.is/r1/IS' grantNamespaces: @@ -1809,6 +1809,7 @@ regulations-admin-backend: CONFIGCAT_SDK_KEY: '/k8s/configcat/CONFIGCAT_SDK_KEY' DB_PASS: '/k8s/regulations-admin-backend/DB_PASSWORD' IDENTITY_SERVER_CLIENT_SECRET: '/k8s/services-regulations-admin/IDENTITY_SERVER_CLIENT_SECRET' + NATIONAL_REGISTRY_B2C_CLIENT_SECRET: '/k8s/api/NATIONAL_REGISTRY_B2C_CLIENT_SECRET' REGULATIONS_API_URL: '/k8s/api/REGULATIONS_API_URL' REGULATIONS_FILE_UPLOAD_KEY_DRAFT: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_DRAFT' REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED' diff --git a/charts/islandis/values.staging.yaml b/charts/islandis/values.staging.yaml index db15aaebed05..5fbb15a89a49 100644 --- a/charts/islandis/values.staging.yaml +++ b/charts/islandis/values.staging.yaml @@ -1607,15 +1607,15 @@ regulations-admin-backend: IDENTITY_SERVER_CLIENT_ID: '@island.is/clients/regulations-admin-api' IDENTITY_SERVER_ISSUER_URL: 'https://identity-server.staging01.devland.is' LOG_LEVEL: 'info' + NATIONAL_REGISTRY_B2C_CLIENT_ID: 'ca128c23-b43c-443d-bade-ec5a146a933f' + NATIONAL_REGISTRY_B2C_ENDPOINT: 'https://skraidentitydev.b2clogin.com/skraidentitystaging.onmicrosoft.com/b2c_1_midlun_flow/oauth2/v2.0/token' + NATIONAL_REGISTRY_B2C_PATH: 'IS-TEST/GOV/6503760649/SKRA-Cloud-Protected/Midlun-v1' + NATIONAL_REGISTRY_B2C_SCOPE: 'https://skraidentitystaging.onmicrosoft.com/midlun/.default' NODE_OPTIONS: '--max-old-space-size=460 -r dd-trace/init' SERVERSIDE_FEATURES_ON: '' XROAD_BASE_PATH: 'http://securityserver.staging01.devland.is' XROAD_BASE_PATH_WITH_ENV: 'http://securityserver.staging01.devland.is/r1/IS-TEST' XROAD_CLIENT_ID: 'IS-TEST/GOV/5501692829/island-is-client' - XROAD_NATIONAL_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.ab9ckb.euw1.cache.amazonaws.com:6379"]' - XROAD_NATIONAL_REGISTRY_SERVICE_PATH: 'IS-TEST/GOV/6503760649/SKRA-Protected/Einstaklingar-v1' - XROAD_TJODSKRA_API_PATH: '/SKRA-Protected/Einstaklingar-v1' - XROAD_TJODSKRA_MEMBER_CODE: '6503760649' XROAD_TLS_BASE_PATH: 'https://securityserver.staging01.devland.is' XROAD_TLS_BASE_PATH_WITH_ENV: 'https://securityserver.staging01.devland.is/r1/IS-TEST' grantNamespaces: @@ -1683,6 +1683,7 @@ regulations-admin-backend: CONFIGCAT_SDK_KEY: '/k8s/configcat/CONFIGCAT_SDK_KEY' DB_PASS: '/k8s/regulations-admin-backend/DB_PASSWORD' IDENTITY_SERVER_CLIENT_SECRET: '/k8s/services-regulations-admin/IDENTITY_SERVER_CLIENT_SECRET' + NATIONAL_REGISTRY_B2C_CLIENT_SECRET: '/k8s/api/NATIONAL_REGISTRY_B2C_CLIENT_SECRET' REGULATIONS_API_URL: '/k8s/api/REGULATIONS_API_URL' REGULATIONS_FILE_UPLOAD_KEY_DRAFT: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_DRAFT' REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED: '/k8s/api/REGULATIONS_FILE_UPLOAD_KEY_PRESIGNED'