-
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.
Validator service plus flytting av logikk
- Loading branch information
Showing
9 changed files
with
84 additions
and
29 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
27 changes: 27 additions & 0 deletions
27
ebms-provider/src/main/kotlin/no/nav/emottak/ebms/validation/DokumentValidator.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 |
---|---|---|
@@ -1,11 +1,38 @@ | ||
package no.nav.emottak.ebms.validation | ||
|
||
import kotlinx.coroutines.runBlocking | ||
import no.nav.emottak.ebms.HttpClientUtil | ||
import no.nav.emottak.ebms.getPublicSigningDetails | ||
import no.nav.emottak.ebms.model.EbMSDocument | ||
import no.nav.emottak.ebms.model.sjekkSignature | ||
import no.nav.emottak.melding.model.Header | ||
import no.nav.emottak.melding.model.Party | ||
import no.nav.emottak.melding.model.SignatureDetails | ||
|
||
class DokumentValidator { | ||
|
||
var httpClient = HttpClientUtil() | ||
|
||
|
||
fun validate(dokument: EbMSDocument) { | ||
|
||
val messageHeader = dokument.messageHeader() | ||
val signaturedetails: SignatureDetails = messageHeader.getPublicSigningDetails() | ||
val header = Header(messageHeader.messageData.messageId, | ||
messageHeader.conversationId, | ||
messageHeader.cpaId, | ||
Party(messageHeader.to.partyId.first().value!!,messageHeader.to.role!!), | ||
Party(messageHeader.from.partyId.first().value!!,messageHeader.from.role!!), | ||
messageHeader.service.value!!, | ||
messageHeader.action) | ||
runBlocking { | ||
httpClient.postValidate(header) | ||
} | ||
dokument.sjekkSignature(signaturedetails) | ||
|
||
|
||
|
||
|
||
|
||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...melding/model/SignatureDetailsResponse.kt → ...emottak/melding/model/SignatureDetails.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