@@ -22,9 +22,12 @@ import no.nav.helse.mediator.TilgangskontrollørForReservasjon
22
22
import no.nav.helse.mediator.dokument.DokumentMediator
23
23
import no.nav.helse.mediator.oppgave.ApiOppgaveService
24
24
import no.nav.helse.mediator.oppgave.OppgaveService
25
+ import no.nav.helse.modell.automatisering.Stikkprøver
25
26
import no.nav.helse.modell.stoppautomatiskbehandling.StansAutomatiskBehandlinghåndtererImpl
26
27
import no.nav.helse.modell.varsel.VarselRepository
27
28
import no.nav.helse.rapids_rivers.RapidApplication
29
+ import no.nav.helse.spesialist.api.AzureConfig
30
+ import no.nav.helse.spesialist.api.bootstrap.SpeilTilgangsgrupper
28
31
import no.nav.helse.spesialist.api.graphql.settOppGraphQLApi
29
32
import no.nav.helse.spesialist.application.Reservasjonshenter
30
33
import no.nav.helse.spesialist.client.entraid.EntraIDAccessTokenGenerator
@@ -36,13 +39,62 @@ import no.nav.helse.spesialist.db.FlywayMigrator
36
39
import no.nav.helse.spesialist.db.bootstrap.DBModule
37
40
import org.slf4j.LoggerFactory
38
41
import java.lang.management.ManagementFactory
42
+ import java.net.URI
39
43
40
44
fun main () {
45
+ val env = System .getenv()
41
46
RapidApp .start(
42
- configuration = Configuration .fraEnv(System .getenv()),
47
+ configuration =
48
+ Configuration (
49
+ azureConfig =
50
+ AzureConfig (
51
+ clientId = env.getValue(" AZURE_APP_CLIENT_ID" ),
52
+ issuerUrl = env.getValue(" AZURE_OPENID_CONFIG_ISSUER" ),
53
+ jwkProviderUri = env.getValue(" AZURE_OPENID_CONFIG_JWKS_URI" ),
54
+ tokenEndpoint = env.getValue(" AZURE_OPENID_CONFIG_TOKEN_ENDPOINT" ),
55
+ ),
56
+ accessTokenGeneratorConfig =
57
+ EntraIDAccessTokenGenerator .Configuration (
58
+ clientId = env.getValue(" AZURE_APP_CLIENT_ID" ),
59
+ tokenEndpoint = env.getValue(" AZURE_OPENID_CONFIG_TOKEN_ENDPOINT" ),
60
+ privateJwk = env.getValue(" AZURE_APP_JWK" ),
61
+ ),
62
+ spleisClientConfig =
63
+ SpleisClient .Configuration (
64
+ spleisUrl = URI .create(env.getValue(" SPLEIS_API_URL" )),
65
+ spleisClientId = env.getValue(" SPLEIS_CLIENT_ID" ),
66
+ ),
67
+ krrConfig =
68
+ KRRClientReservasjonshenter .Configuration (
69
+ apiUrl = env.getValue(" KONTAKT_OG_RESERVASJONSREGISTERET_API_URL" ),
70
+ scope = env.getValue(" KONTAKT_OG_RESERVASJONSREGISTERET_SCOPE" ),
71
+ ),
72
+ dbConfig =
73
+ DBModule .Configuration (
74
+ jdbcUrl =
75
+ " jdbc:postgresql://" +
76
+ env.getValue(" DATABASE_HOST" ) +
77
+ " :" +
78
+ env.getValue(" DATABASE_PORT" ) +
79
+ " /" +
80
+ env.getValue(" DATABASE_DATABASE" ),
81
+ username = env.getValue(" DATABASE_USERNAME" ),
82
+ password = env.getValue(" DATABASE_PASSWORD" ),
83
+ ),
84
+ unleashFeatureToggles =
85
+ UnleashFeatureToggles .Configuration (
86
+ apiKey = env.getValue(" UNLEASH_SERVER_API_TOKEN" ),
87
+ apiUrl = env.getValue(" UNLEASH_SERVER_API_URL" ),
88
+ apiEnv = env.getValue(" UNLEASH_SERVER_API_ENV" ),
89
+ ),
90
+ versjonAvKode = env.getValue(" NAIS_APP_IMAGE" ),
91
+ tilgangsgrupper = SpeilTilgangsgrupper (env),
92
+ environmentToggles = EnvironmentTogglesImpl (env),
93
+ stikkprøver = Stikkpr øver.fraEnv(env),
94
+ ),
43
95
rapidsConnection =
44
96
RapidApplication .create(
45
- env = System .getenv() ,
97
+ env = env ,
46
98
meterRegistry = PrometheusMeterRegistry (PrometheusConfig .DEFAULT ).also (Metrics .globalRegistry::add),
47
99
builder = {
48
100
withKtorModule {
@@ -97,7 +149,12 @@ object RapidApp {
97
149
Kommandofabrikk (
98
150
oppgaveService = { oppgaveService },
99
151
godkjenningMediator = GodkjenningMediator (daos.opptegnelseDao),
100
- subsumsjonsmelderProvider = { Subsumsjonsmelder (configuration.versjonAvKode, meldingPubliserer) },
152
+ subsumsjonsmelderProvider = {
153
+ Subsumsjonsmelder (
154
+ configuration.versjonAvKode,
155
+ meldingPubliserer,
156
+ )
157
+ },
101
158
stikkprøver = configuration.stikkprøver,
102
159
featureToggles = featureToggles,
103
160
),
0 commit comments