-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Legg til endepunkter for å sende og motta klage
- Loading branch information
Showing
25 changed files
with
498 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/kotlin/no/nav/sosialhjelp/innsyn/klage/FiksIOConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package no.nav.sosialhjelp.innsyn.klage | ||
|
||
import no.ks.fiks.io.client.konfigurasjon.FiksIOKonfigurasjon | ||
import no.ks.fiks.io.client.konfigurasjon.KontoKonfigurasjon | ||
import no.ks.fiks.io.client.konfigurasjon.VirksomhetssertifikatKonfigurasjon | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.context.annotation.Profile | ||
import java.security.KeyStore | ||
import java.util.UUID | ||
|
||
@Configuration | ||
@Profile("!local") | ||
class FiksIOConfig( | ||
private val kontoKonfigurasjon: KontoKonfigurasjon, | ||
@Value("\${fiks-io.integrasjonspassord}") | ||
private val integrasjonspassord: String, | ||
@Value("\${fiks-io.integrasjonid}") | ||
private val integrasjonId: String, | ||
@Value("\${MASKINPORTEN_CLIENT_ID}") | ||
private val maskinportenClientId: String, | ||
) { | ||
|
||
private val virksomhetssertifikatKonfigurasjon = | ||
VirksomhetssertifikatKonfigurasjon.builder().keyStore(KeyStore.getInstance("pkcs12")).keyStorePassword("bogus").keyAlias("bogus").keyPassword("bogus").build() | ||
|
||
@Bean | ||
@Profile("!prod") | ||
fun fiksIOTestConfig(): FiksIOKonfigurasjon { | ||
val integrasjonId = UUID.fromString(integrasjonId) | ||
|
||
return FiksIOKonfigurasjon.defaultTestConfiguration( | ||
maskinportenClientId, integrasjonId, integrasjonspassord, | ||
kontoKonfigurasjon, | ||
virksomhetssertifikatKonfigurasjon | ||
) | ||
} | ||
|
||
@Bean | ||
@Profile("prod") | ||
fun fiksIOProdConfig(): FiksIOKonfigurasjon { | ||
val integrasjonId = UUID.fromString(integrasjonId) | ||
|
||
return FiksIOKonfigurasjon.defaultProdConfiguration( | ||
maskinportenClientId, integrasjonId, integrasjonspassord, | ||
kontoKonfigurasjon, | ||
virksomhetssertifikatKonfigurasjon | ||
) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/no/nav/sosialhjelp/innsyn/klage/FiksIoKontoConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package no.nav.sosialhjelp.innsyn.klage | ||
|
||
import no.ks.fiks.io.client.konfigurasjon.KontoKonfigurasjon | ||
import no.ks.fiks.io.client.model.KontoId | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.context.annotation.Profile | ||
import java.nio.file.Files | ||
import java.security.KeyFactory | ||
import java.security.spec.PKCS8EncodedKeySpec | ||
import java.util.UUID | ||
import kotlin.io.path.Path | ||
|
||
@Configuration | ||
@Profile("!local") | ||
class FiksIoKontoConfig( | ||
@Value("\${fiks-io.private-key-path}") | ||
private val privateKeyPath: String, | ||
@Value("\${fiks-io.kontoId}") | ||
private val kontoId: String, | ||
|
||
) { | ||
@Bean | ||
fun kontoKonfigurasjon(): KontoKonfigurasjon { | ||
val kontoId = KontoId(UUID.fromString(kontoId)) | ||
val key = Files.readAllBytes(Path(privateKeyPath)) | ||
val keySpec = PKCS8EncodedKeySpec(key) | ||
val privateKey = KeyFactory.getInstance("RSA").generatePrivate(keySpec) | ||
return KontoKonfigurasjon.builder().kontoId(kontoId).privatNokkel(privateKey).build() | ||
} | ||
} |
Oops, something went wrong.