Skip to content

Commit a7dd6ce

Browse files
committed
fix conflicts when merging with main
2 parents 51e49d6 + f20b1f9 commit a7dd6ce

File tree

29 files changed

+126
-387
lines changed

29 files changed

+126
-387
lines changed

.github/workflows/generate-and-publish-sdk-sources.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ on:
1818

1919
jobs:
2020
generate-and-publish-sources:
21-
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20241126
21+
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20250203
2222
secrets: inherit
2323
with:
2424
name: rapid
2525
version: ${{ inputs.version }}
2626
transformations: "-th -te /v3 --operationIdsToTags"
2727
repository: 'ExpediaGroup/rapid-java-sdk'
28-
sdk_repo_ref: ${{ inputs.sdk_repo_ref }}
28+
sdk_repo_ref: ${{ inputs.sdk_repo_ref || 'v20250203' }}

.github/workflows/generate-docs-site.yml

Lines changed: 12 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2,97 +2,21 @@ name: Deploy Reference Documentation
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'Branch or tag to deploy reference docs from. Defaults to current branch.'
8+
type: string
9+
required: false
10+
default: ''
511

612
permissions:
713
id-token: write
814

915
jobs:
1016
deploy-reference-docs:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: Checkout "main" Branch
15-
uses: actions/checkout@v4
16-
with:
17-
ref: main
18-
19-
- name: Setup Java 21
20-
uses: actions/setup-java@v4
21-
with:
22-
distribution: 'corretto'
23-
java-version: '21'
24-
25-
- name: Configure Git
26-
run: |
27-
git config --global user.email "[email protected]"
28-
git config --global user.name "eg-oss-ci"
29-
git fetch --all
30-
31-
- name: Checkout "gh-pages" Branch
32-
run: git checkout gh-pages
33-
34-
- name: Extract and Store Latest Live Docs Version Number
35-
run: echo "LATEST_DOCS_VERSION=$(jq -r '.version' version.json)" >> $GITHUB_ENV
36-
37-
- name: Move Latest Docs to the "older" Directory (Archiving latest live release)
38-
run: |
39-
mkdir older/${{ env.LATEST_DOCS_VERSION }}
40-
mv images rapid-sdk scripts styles index.html navigation.html not-found-version.html version.json older/${{ env.LATEST_DOCS_VERSION }}
41-
42-
- name: Move the "older" and "assets" Directories to a Temporary Workspace
43-
run: mv older assets ${{ runner.temp }}
44-
45-
- name: Checkout "main" Branch
46-
run: git checkout main
47-
48-
- name: Generate New Release Reference Docs
49-
run: mvn -f code dokka:dokka -Ddokka-old-versions.location=${{ runner.temp }}/older -Ddokka-assets.location=${{ runner.temp }}/assets
50-
51-
- name: Extract and Store Newly Generated Docs Version Number
52-
run: echo "NEW_DOCS_VERSION=$(jq -r '.version' code/target/dokka/version.json)" >> $GITHUB_ENV
53-
54-
- name: Check the New Release Version
55-
run: |
56-
for dir in ${{ runner.temp }}/older/*; do
57-
if [ -d "$dir" ]; then
58-
DIR_NAME=$(basename "$dir")
59-
if [ "$DIR_NAME" == "${{ env.NEW_DOCS_VERSION }}" ]; then
60-
echo "Error: Reference Docs with version ${{env.NEW_DOCS_VERSION }} already exists."
61-
echo "Hint: Make sure to update the project version in the pom.xml file"
62-
exit 1
63-
fi
64-
fi
65-
done
66-
67-
- name: Move the Newly Generated Docs to a Temporary Workspace
68-
run: mv code/target/dokka ${{ runner.temp }}/${{ env.NEW_DOCS_VERSION }}
69-
70-
- name: Checkout "gh-pages" Branch
71-
run: git checkout gh-pages
72-
73-
- name: Cleanup Old Docs from the Repository's Root
74-
run: rm -rf code images older rapid-sdk scripts styles ui-kit index.html navigation.html not-found-version.html version.json
75-
76-
- name: Move Newly Generated Docs to the Repository Root
77-
run: mv ${{ runner.temp }}/${{ env.NEW_DOCS_VERSION }}/* .
78-
79-
- name: Commit the New Release
80-
run: |
81-
git add .
82-
git commit -m "chore: publishing docs for version ${{ env.NEW_DOCS_VERSION }}"
83-
84-
- name: Create Pull Request
85-
uses: peter-evans/create-pull-request@v7
86-
with:
87-
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
88-
commit-message: "chore: publishing docs for version ${{ env.NEW_DOCS_VERSION }}"
89-
body: "This PR adds the reference documentation for version ${{ env.NEW_DOCS_VERSION }}."
90-
title: "chore: reference docs update for version ${{ env.NEW_DOCS_VERSION }}"
91-
branch: "docs-update-${{ env.NEW_DOCS_VERSION }}"
92-
93-
94-
95-
96-
97-
98-
17+
uses: "ExpediaGroup/expediagroup-java-sdk/.github/workflows/generate-ref-docs.yaml@main"
18+
with:
19+
buildsystem: 'maven'
20+
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }}
21+
secrets:
22+
GITHUB_PAT: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

.github/workflows/release-sdk.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ on:
1111
default: ''
1212

1313
jobs:
14-
run-examples:
15-
strategy:
16-
matrix:
17-
jdk: [ 8, 11, 17, 21 ]
18-
uses: ./.github/workflows/run-examples.yaml
19-
secrets: inherit
20-
with:
21-
branch: ${{ inputs.branch }}
22-
jdk: ${{ matrix.jdk }}
14+
# run-examples:
15+
# strategy:
16+
# matrix:
17+
# jdk: [ 8, 11, 17, 21 ]
18+
# uses: ./.github/workflows/run-examples.yaml
19+
# secrets: inherit
20+
# with:
21+
# branch: ${{ inputs.branch }}
22+
# jdk: ${{ matrix.jdk }}
2323

2424
release-sdk:
25-
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20241126
26-
needs: [ run-examples ]
25+
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20250203
26+
# needs: [ run-examples ]
2727
secrets: inherit
2828
with:
2929
branch: ${{ inputs.branch }}

code/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<dependency>
66
<groupId>com.expediagroup</groupId>
77
<artifactId>rapid-sdk</artifactId>
8-
<version>5.3.0</version>
8+
<version>5.3.2</version>
99
</dependency>
1010
```
1111

code/pom.xml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.expediagroup</groupId>
66
<artifactId>rapid-sdk</artifactId>
7-
<version>5.3.0</version>
7+
<version>5.3.2</version>
88
<name>EG rapid-sdk for Java</name>
9-
<description>EG rapid-sdk v5.3.0</description>
9+
<description>EG rapid-sdk v5.3.2</description>
1010
<url>https://github.com/ExpediaGroup/test-sdk</url>
1111
<inceptionYear>2022</inceptionYear>
1212
<packaging>jar</packaging>
@@ -72,17 +72,17 @@
7272
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
7373
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
7474
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
75-
<ktlint-plugin.version>3.4.0</ktlint-plugin.version>
75+
<ktlint-plugin.version>3.5.0</ktlint-plugin.version>
7676
<jacoco-plugin.version>0.8.12</jacoco-plugin.version>
77-
<dokka-plugin.version>1.9.20</dokka-plugin.version>
77+
<dokka-plugin.version>2.0.0</dokka-plugin.version>
7878
<dokka-old-versions.location/> <!-- passed as a property when running dokka:dokka-->
7979
<properties.maven.plugin.version>1.2.1</properties.maven.plugin.version>
8080
<maven.licence.plugin.version>4.6</maven.licence.plugin.version>
8181
<flatten.maven.plugin.version>1.6.0</flatten.maven.plugin.version>
82-
<kotlin.version>2.0.21</kotlin.version>
83-
<kotlinx.coroutines.version>1.9.0</kotlinx.coroutines.version>
84-
<ktor.version>2.3.13</ktor.version>
85-
<kotlin-atomic.version>0.26.1</kotlin-atomic.version>
82+
<kotlin.version>2.1.0</kotlin.version>
83+
<kotlinx.coroutines.version>1.10.1</kotlinx.coroutines.version>
84+
<ktor.version>3.0.3</ktor.version>
85+
<kotlin-atomic.version>0.27.0</kotlin-atomic.version>
8686
<slf4j.version>2.0.16</slf4j.version>
8787
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
8888
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
@@ -138,12 +138,12 @@
138138
<dependency>
139139
<groupId>com.squareup.okio</groupId>
140140
<artifactId>okio-jvm</artifactId>
141-
<version>3.9.1</version>
141+
<version>3.10.2</version>
142142
</dependency>
143143
<dependency>
144144
<groupId>org.jetbrains</groupId>
145145
<artifactId>annotations</artifactId>
146-
<version>26.0.1</version>
146+
<version>26.0.2</version>
147147
</dependency>
148148
<dependency>
149149
<groupId>org.hibernate.validator</groupId>
@@ -449,6 +449,7 @@
449449
<plugin>
450450
<groupId>org.jetbrains.dokka</groupId>
451451
<artifactId>dokka-maven-plugin</artifactId>
452+
<version>${dokka-plugin.version}</version>
452453
<configuration>
453454
<sourceDirectories>
454455
<dir>${project.basedir}/src/main/kotlin/com/expediagroup/sdk/rapid</dir>
@@ -732,25 +733,25 @@
732733
<dependency>
733734
<groupId>org.apache.commons</groupId>
734735
<artifactId>commons-lang3</artifactId>
735-
<version>3.14.0</version>
736+
<version>3.17.0</version>
736737
</dependency>
737738

738739
<dependency>
739740
<groupId>org.apache.commons</groupId>
740741
<artifactId>commons-text</artifactId>
741-
<version>1.12.0</version>
742+
<version>1.13.0</version>
742743
</dependency>
743744

744745
<dependency>
745746
<groupId>com.ebay.ejmask</groupId>
746747
<artifactId>ejmask-api</artifactId>
747-
<version>1.2.1</version>
748+
<version>1.3.0</version>
748749
</dependency>
749750

750751
<dependency>
751752
<groupId>com.ebay.ejmask</groupId>
752753
<artifactId>ejmask-extensions</artifactId>
753-
<version>1.2.1</version>
754+
<version>1.3.0</version>
754755
</dependency>
755756
</dependencies>
756757

code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ abstract class BaseRapidClient(
4444
private val engine: HttpClientEngine =
4545
_configurationProvider.okHttpClient?.let {
4646
OkHttp.create {
47-
preconfigured = it
47+
config {
48+
preconfigured = it
49+
dispatcher(it.dispatcher)
50+
}
4851
}
4952
} ?: httpClientEngine
5053

code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ abstract class BaseXapClient(
4444
private val engine: HttpClientEngine =
4545
_configurationProvider.okHttpClient?.let {
4646
OkHttp.create {
47-
preconfigured = it
47+
config {
48+
preconfigured = it
49+
dispatcher(it.dispatcher)
50+
}
4851
}
4952
} ?: httpClientEngine
5053

code/src/main/kotlin/com/expediagroup/sdk/core/client/Client.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import okhttp3.Dispatcher
5454
import okhttp3.OkHttpClient
5555

5656
// Create a Dispatcher with limits
57-
val dispatcher =
57+
val configuredDispatcher =
5858
Dispatcher().apply {
5959
maxRequests = 10000 // Maximum number of concurrent requests
6060
maxRequestsPerHost = 1000
@@ -64,7 +64,7 @@ val DEFAULT_HTTP_CLIENT_ENGINE: HttpClientEngine =
6464
OkHttp.create {
6565
config {
6666
eventListenerFactory(OkHttpEventListener.FACTORY)
67-
dispatcher(dispatcher)
67+
dispatcher(configuredDispatcher)
6868
}
6969
}
7070

code/src/main/kotlin/com/expediagroup/sdk/core/client/ExpediaGroupClient.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,20 @@ abstract class ExpediaGroupClient(
6767
return self()
6868
}
6969
}
70+
71+
@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients.
72+
abstract class BuilderWithHttpClient<SELF : Client.BuilderWithHttpClient<SELF>> : Client.BuilderWithHttpClient<SELF>() {
73+
/** Sets the API auth endpoint to use for requests. */
74+
protected var authEndpoint: String? = null
75+
76+
/** Sets the API auth endpoint to use for requests.
77+
*
78+
* @param authEndpoint The API auth endpoint to use for requests.
79+
* @return The [Builder] instance.
80+
*/
81+
fun authEndpoint(authEndpoint: String): SELF {
82+
this.authEndpoint = authEndpoint
83+
return self()
84+
}
85+
}
7086
}

code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/XapConfigurationProvider.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
*/
1616
package com.expediagroup.sdk.core.configuration.provider
1717

18-
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.connectionTimeout
19-
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.endpoint
20-
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.name
21-
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.requestTimeout
22-
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.socketTimeout
2318
import com.expediagroup.sdk.core.constant.Constant
2419

2520
/**

code/src/main/kotlin/com/expediagroup/sdk/core/constant/Constant.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
*/
1616
package com.expediagroup.sdk.core.constant
1717

18-
import io.ktor.client.plugins.HttpTimeout
18+
import io.ktor.client.plugins.HttpTimeoutConfig
1919

2020
internal object Constant {
2121
const val EMPTY_STRING = ""
2222
const val TEN_SECONDS_IN_MILLIS = 10_000L
2323
const val FIFTEEN_SECONDS_IN_MILLIS = 15_000L
24-
const val INFINITE_TIMEOUT = HttpTimeout.INFINITE_TIMEOUT_MS
24+
const val INFINITE_TIMEOUT = HttpTimeoutConfig.INFINITE_TIMEOUT_MS
2525

2626
private const val SUCCESSFUL_STATUS_CODES_RANGE_START = 200
2727
private const val SUCCESSFUL_STATUS_CODES_RANGE_END = 299

code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingRegex.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
*/
1616
package com.expediagroup.sdk.core.constant
1717

18+
import com.expediagroup.sdk.core.constant.LoggingMessage.OMITTED
19+
1820
internal object LogMaskingRegex {
1921
val FIELD_REGEX = "^[a-zA-Z0-9-_]+$".toRegex()
2022

21-
val NUMBER_FIELD_REGEX = "(?<=[\"']?number[\"']?:\\s?[\"'])(\\s*\\d{15,16}\\s*)(?=[\"'])".toRegex()
23+
const val REPLACEMENT_TEMPLATE = "\"$1$2${OMITTED}\""
2224
}

code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LogMaskingRegexProvider.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,19 @@
1616
package com.expediagroup.sdk.core.constant.provider
1717

1818
internal object LogMaskingRegexProvider {
19-
fun getMaskedFieldsRegex(maskedBodyFields: Set<String>) = "(?<=[\"']?(${maskedBodyFields.joinToString("|")})[\"']?:\\s?[\"'])(\\s*[^\"']+\\s*)(?=[\"'])".toRegex()
19+
fun getMaskedFieldsRegex(
20+
maskedBodyFields: Set<String>,
21+
value: String = "[^\\\"]+"
22+
): Regex {
23+
val fields = maskedBodyFields.joinToString("|")
24+
return "\"($fields)(\\\\*\"\\s*:\\s*\\\\*\")$value(?:\\\\?\"|)".toRegex()
25+
}
26+
27+
fun getMaskedFieldsRegex(
28+
maskedBodyField: String,
29+
value: String = "[^\\\"]+"
30+
): Regex {
31+
val fields = setOf(maskedBodyField)
32+
return getMaskedFieldsRegex(fields, value)
33+
}
2034
}

0 commit comments

Comments
 (0)