Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor av dobbel validering ved kontonummerendring #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import no.nav.personopplysninger.consumer.norg2.Norg2Consumer
import no.nav.personopplysninger.consumer.pdl.PdlConsumer
import no.nav.personopplysninger.consumer.pdlmottak.PdlMottakConsumer
import no.nav.personopplysninger.endreopplysninger.EndreOpplysningerService
import no.nav.personopplysninger.endreopplysninger.idporten.IDPortenServiceImpl
import no.nav.personopplysninger.endreopplysninger.kafka.HendelseProducer
import no.nav.personopplysninger.institusjon.InstitusjonService
import no.nav.personopplysninger.kontaktinformasjon.KontaktinformasjonService
Expand All @@ -37,8 +38,7 @@ class ApplicationContext {
val tokendingsService = TokendingsServiceBuilder.buildTokendingsService()
val azureService = AzureServiceBuilder.buildAzureService()
val hendelseProducer = HendelseProducer(initializeKafkaProducer(env), env.varselHendelseTopic)

val idporten = setupIdporten(env)
val idportenService = IDPortenServiceImpl(setupIdporten(env), httpClient)

val institusjonConsumer = InstitusjonConsumer(httpClient, env, tokendingsService)
val kontaktinfoConsumer = KontaktinfoConsumer(httpClient, env, tokendingsService)
Expand All @@ -62,8 +62,8 @@ class ApplicationContext {
val kontaktinformasjonService = KontaktinformasjonService(kontaktinfoConsumer, kodeverkConsumer)
val personaliaService = PersonaliaService(kodeverkConsumer, norg2Consumer, kontoregisterConsumer, pdlConsumer)

private fun setupIdporten(env: Environment): IDPorten {
return IDPorten(
private fun setupIdporten(env: Environment): IDPortenConfig {
return IDPortenConfig(
redirectUri = env.redirectUri,
frontendUri = URLBuilder().takeFrom(env.frontendUri).build(),
wellKnownUrl = env.wellKnownUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fun Application.mainModule(appContext: ApplicationContext = ApplicationContext()
routing {
health(appContext.appMicrometerRegistry)
authenticate {
endreOpplysninger(appContext.endreOpplysningerService, appContext.metricsCollector, appContext.idporten)
endreOpplysninger(appContext.endreOpplysningerService, appContext.metricsCollector, appContext.idportenService)
institusjon(appContext.institusjonService)
medl(appContext.medlService)
personalia(appContext.personaliaService)
Expand Down
200 changes: 0 additions & 200 deletions src/main/kotlin/no/nav/personopplysninger/config/IDPorten.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package no.nav.personopplysninger.config

import io.ktor.http.Url
import javax.crypto.SecretKey

class IDPortenConfig(
val redirectUri: String,
val frontendUri: Url,
val wellKnownUrl: String,
val clientId: String,
val clientJwk: String,
val encryptionKey: SecretKey,
val acr: String = "idporten-loa-high",
val allowedAuthTimeSkewSeconds: Long = 5,
val secureCookie: Boolean = true,
)
Loading
Loading