chore: Update dependencies and fix OpenAPI client generation
- Upgrade Spring Boot to 3.3.6 - Update swagger-codegen-maven-plugin to 3.0.64 - Add custom template for HttpBasicAuth - Fix mockwebserver version to 4.12.0 - Fix parent version reference in opensearch-store
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
<plugin>
|
||||
<groupId>io.swagger.codegen.v3</groupId>
|
||||
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
||||
<version>3.0.46</version>
|
||||
<version>3.0.64</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -100,6 +100,7 @@
|
||||
<inputSpec>${project.basedir}/src/main/resources/openapi.json</inputSpec>
|
||||
<language>java</language>
|
||||
<library>resttemplate</library>
|
||||
<templateDirectory>src/main/resources/handlebars/Java</templateDirectory>
|
||||
<apiPackage>org.springframework.ai.huggingface.api</apiPackage>
|
||||
<modelPackage>org.springframework.ai.huggingface.model</modelPackage>
|
||||
<invokerPackage>org.springframework.ai.huggingface.invoker</invokerPackage>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package {{invokerPackage}}.auth;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
{{>generatedAnnotation}}
|
||||
public class HttpBasicAuth implements Authentication {
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(MultiValueMap<String, String> queryParams, HttpHeaders headerParams) {
|
||||
if (username == null && password == null) {
|
||||
return;
|
||||
}
|
||||
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
|
||||
headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + java.util.Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
}
|
||||
3
pom.xml
3
pom.xml
@@ -169,7 +169,7 @@
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
|
||||
<!-- production dependencies -->
|
||||
<spring-boot.version>3.3.4</spring-boot.version>
|
||||
<spring-boot.version>3.3.6</spring-boot.version>
|
||||
<ST4.version>4.3.4</ST4.version>
|
||||
<azure-open-ai-client.version>1.0.0-beta.12</azure-open-ai-client.version>
|
||||
<jtokkit.version>1.1.0</jtokkit.version>
|
||||
@@ -233,6 +233,7 @@
|
||||
|
||||
<!-- testing dependencies -->
|
||||
<testcontainers.opensearch.version>2.0.1</testcontainers.opensearch.version>
|
||||
<okhttp3.version>4.12.0</okhttp3.version>
|
||||
|
||||
<!-- documentation dependencies -->
|
||||
<io.spring.maven.antora-version>0.0.4</io.spring.maven.antora-version>
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>mockwebserver</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-ollama</artifactId>
|
||||
<version>${parent.version}</version>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user