-
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.
Returnere detaljer fra simuleringsfeil (#252)
* Returnere detaljer fra simuleringsfeil * Ikke logg sensitivt
- Loading branch information
Showing
4 changed files
with
31 additions
and
3 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
18 changes: 18 additions & 0 deletions
18
apps/etterlatte-proxy/src/main/kotlin/config/SoapSecurityMaskSensitiveHelper.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,18 @@ | ||
package no.nav.etterlatte.config | ||
|
||
import org.apache.cxf.ext.logging.MaskSensitiveHelper | ||
import org.apache.cxf.message.Message | ||
import java.util.regex.Pattern | ||
|
||
/** | ||
* Handle tag with multiline content between opening and end. | ||
*/ | ||
internal class SoapSecurityMaskSensitiveHelper : MaskSensitiveHelper() { | ||
private val matchPatternXML = Pattern.compile("(<wsse:Security.*?>)([\\s\\S.]*?)(</wsse:Security>)") | ||
|
||
override fun maskSensitiveElements(message: Message, originalLogString: String): String { | ||
val resultString = matchPatternXML.matcher(originalLogString).replaceAll("$1***REDACTED***$3") | ||
|
||
return super.maskSensitiveElements(message, resultString) | ||
} | ||
} |
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