Skip to content

Commit da576b2

Browse files
authored
Merge pull request #59 from xdev-software/develop
Release 1.1.3
2 parents 8ffaa94 + 7fae81c commit da576b2

File tree

7 files changed

+31
-14
lines changed

7 files changed

+31
-14
lines changed

.github/workflows/checkBuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
fi
5757
5858
- name: Upload demo files
59-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v4
6060
with:
6161
name: demo-files-java-${{ matrix.java }}
6262
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
164164

165165
- name: Upload licenses - Upload Artifact
166-
uses: actions/upload-artifact@v3
166+
uses: actions/upload-artifact@v4
167167
with:
168168
name: dependencies-licenses
169169
path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/site

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.1.3
2+
* Updated dependencies
3+
14
# 1.1.2
25
* Removed unused dependency ``com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider``
36

sessionize-java-client-demo/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<mainClass>software.xdev.Application</mainClass>
2727

28-
<log4j2-version>2.22.0</log4j2-version>
28+
<log4j2-version>2.22.1</log4j2-version>
2929
</properties>
3030

3131
<dependencies>
@@ -56,7 +56,7 @@
5656
<plugin>
5757
<groupId>org.apache.maven.plugins</groupId>
5858
<artifactId>maven-compiler-plugin</artifactId>
59-
<version>3.11.0</version>
59+
<version>3.12.1</version>
6060
<configuration>
6161
<release>${maven.compiler.release}</release>
6262
<compilerArgs>

sessionize-java-client/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<dependency>
9797
<groupId>com.fasterxml.jackson</groupId>
9898
<artifactId>jackson-bom</artifactId>
99-
<version>2.16.0</version>
99+
<version>2.16.1</version>
100100
<type>pom</type>
101101
<scope>import</scope>
102102
</dependency>
@@ -108,7 +108,7 @@
108108
<dependency>
109109
<groupId>org.apache.httpcomponents.client5</groupId>
110110
<artifactId>httpclient5</artifactId>
111-
<version>5.2.3</version>
111+
<version>5.3</version>
112112
</dependency>
113113

114114
<!-- JSON processing: jackson -->
@@ -175,7 +175,7 @@
175175
<plugin>
176176
<groupId>org.apache.maven.plugins</groupId>
177177
<artifactId>maven-compiler-plugin</artifactId>
178-
<version>3.11.0</version>
178+
<version>3.12.1</version>
179179
<configuration>
180180
<release>${maven.compiler.release}</release>
181181
<compilerArgs>
@@ -325,7 +325,7 @@
325325
<plugin>
326326
<groupId>org.openapitools</groupId>
327327
<artifactId>openapi-generator-maven-plugin</artifactId>
328-
<version>7.1.0</version>
328+
<version>7.2.0</version>
329329
<executions>
330330
<execution>
331331
<goals>

sessionize-java-client/src/generated/java/software/xdev/sessionize/client/ApiClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import java.util.Arrays;
5656
import java.util.ArrayList;
5757
import java.util.Date;
58+
import java.util.function.Supplier;
5859
import java.util.TimeZone;
5960
import java.util.regex.Matcher;
6061
import java.util.regex.Pattern;
@@ -66,6 +67,7 @@
6667
import java.io.IOException;
6768
import java.io.UnsupportedEncodingException;
6869
import java.nio.charset.Charset;
70+
import java.nio.charset.StandardCharsets;
6971
import java.nio.charset.UnsupportedCharsetException;
7072
import java.nio.file.Files;
7173
import java.nio.file.StandardCopyOption;
@@ -639,7 +641,7 @@ public HttpEntity serialize(Object obj, Map<String, Object> formParams, ContentT
639641
String mimeType = contentType.getMimeType();
640642
if (isJsonMime(mimeType)) {
641643
try {
642-
return new StringEntity(objectMapper.writeValueAsString(obj), contentType);
644+
return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8));
643645
} catch (JsonProcessingException e) {
644646
throw new ApiException(e);
645647
}

sessionize-java-client/src/generated/java/software/xdev/sessionize/client/auth/HttpBearerAuth.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515

1616
import software.xdev.sessionize.client.Pair;
1717

18-
import java.util.Map;
1918
import java.util.List;
19+
import java.util.Map;
20+
import java.util.Optional;
21+
import java.util.function.Supplier;
2022

2123
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
2224
public class HttpBearerAuth implements Authentication {
2325
private final String scheme;
24-
private String bearerToken;
26+
private Supplier<String> tokenSupplier;
2527

2628
public HttpBearerAuth(String scheme) {
2729
this.scheme = scheme;
@@ -33,7 +35,7 @@ public HttpBearerAuth(String scheme) {
3335
* @return The bearer token
3436
*/
3537
public String getBearerToken() {
36-
return bearerToken;
38+
return tokenSupplier.get();
3739
}
3840

3941
/**
@@ -42,12 +44,22 @@ public String getBearerToken() {
4244
* @param bearerToken The bearer token to send in the Authorization header
4345
*/
4446
public void setBearerToken(String bearerToken) {
45-
this.bearerToken = bearerToken;
47+
this.tokenSupplier = () -> bearerToken;
48+
}
49+
50+
/**
51+
* Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
52+
*
53+
* @param tokenSupplier The supplier of bearer tokens to send in the Authorization header
54+
*/
55+
public void setBearerToken(Supplier<String> tokenSupplier) {
56+
this.tokenSupplier = tokenSupplier;
4657
}
4758

4859
@Override
4960
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
50-
if(bearerToken == null) {
61+
String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
62+
if (bearerToken == null) {
5163
return;
5264
}
5365

0 commit comments

Comments
 (0)