Skip to content

chore: Publish v5.4.0-SNAPSHOT #288

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>5.3.2</version>
<version>5.4.0-SNAPSHOT</version>
</dependency>
```

Expand Down
14 changes: 7 additions & 7 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>5.3.2</version>
<version>5.4.0-SNAPSHOT</version>
<name>EG rapid-sdk for Java</name>
<description>EG rapid-sdk v5.3.2</description>
<description>EG rapid-sdk v5.4.0-SNAPSHOT</description>
<url>https://github.com/ExpediaGroup/test-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down Expand Up @@ -63,7 +63,7 @@
<sdk-title>${project.artifactId}</sdk-title>

<!-- Plugin Versions -->
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
<maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
<maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
Expand All @@ -79,9 +79,9 @@
<properties.maven.plugin.version>1.2.1</properties.maven.plugin.version>
<maven.licence.plugin.version>4.6</maven.licence.plugin.version>
<flatten.maven.plugin.version>1.6.0</flatten.maven.plugin.version>
<kotlin.version>2.1.0</kotlin.version>
<kotlin.version>2.1.10</kotlin.version>
<kotlinx.coroutines.version>1.10.1</kotlinx.coroutines.version>
<ktor.version>3.0.3</ktor.version>
<ktor.version>3.1.1</ktor.version>
<kotlin-atomic.version>0.27.0</kotlin-atomic.version>
<slf4j.version>2.0.16</slf4j.version>
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
Expand Down Expand Up @@ -131,7 +131,7 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.2</version>
<version>2.18.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -153,7 +153,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.18.2</version>
<version>2.18.3</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,38 @@
package com.expediagroup.sdk.core.constant.provider

internal object LogMaskingRegexProvider {
/**
* Generates a regex pattern to match specified fields in a JSON string.
*
* @param maskedBodyFields the set of fields to be masked
* @param valueToMatch regex pattern to match the value of the fields. Default: match any sequence of characters except double quotes.
* @return the regex pattern to match the specified fields and their values
*/
fun getMaskedFieldsRegex(
maskedBodyFields: Set<String>,
value: String = "[^\\\"]+"
valueToMatch: String = "[^\\\"]+"
): Regex {
val fields = maskedBodyFields.joinToString("|")
return "\"($fields)(\\\\*\"\\s*:\\s*\\\\*\")$value(?:\\\\?\"|)".toRegex()
// The pattern matches:
// - The field name (one of the specified fields) captured in group 1.
// - Optional backslash, closing double quotes, colon(:), optional whitespace, and opening double quotes.
// - The value of the field, matching the specified valueToMatch pattern.
// - Optional backslash, followed by a closing double quote
return "\"($fields)(\\\\?\"\\s*:\\s*\\\\*\")$valueToMatch(?:\\\\?\")".toRegex()
}

/**
* Generates a regex pattern to match a specified field in a JSON string.
*
* @param maskedBodyField the field to be masked
* @param valueToMatch regex pattern to match the value of the field. Default: match any sequence of characters except double quotes.
* @return the regex pattern to match the specified field and its value
*/
fun getMaskedFieldsRegex(
maskedBodyField: String,
value: String = "[^\\\"]+"
valueToMatch: String = "[^\\\"]+"
): Regex {
val fields = setOf(maskedBodyField)
return getMaskedFieldsRegex(fields, value)
return getMaskedFieldsRegex(fields, valueToMatch)
}
}
Loading