Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
453e9a48ef | ||
|
|
4353c673db |
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.inteligr8</groupId>
|
||||
<artifactId>common-rest-client</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>ReST API Client for Java</name>
|
||||
@@ -43,16 +43,15 @@
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
|
||||
<junit.version>5.12.0</junit.version>
|
||||
<spring.version>6.0.23</spring.version>
|
||||
<jackson.version>2.17.3</jackson.version>
|
||||
<spring.version>6.2.18</spring.version>
|
||||
<jackson.version>2.21.1</jackson.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
@@ -77,7 +76,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.17.0</version>
|
||||
<version>3.20.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
@@ -89,10 +88,11 @@
|
||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<version>5.14.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -110,35 +110,23 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh-release</id>
|
||||
<id>central-publish</id>
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
@@ -178,19 +166,20 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.14</version>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.10.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
<publishingServerId>central</publishingServerId>
|
||||
<autoPublish>true</autoPublish>
|
||||
</configuration>
|
||||
<!-- for some reason this is required... -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>ossrh-deploy</id>
|
||||
<id>deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals><goal>deploy</goal></goals>
|
||||
<goals><goal>publish</goal></goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
@@ -30,7 +30,7 @@ import jakarta.ws.rs.client.ClientRequestContext;
|
||||
*/
|
||||
public class HeaderAuthorizationFilter implements AuthorizationFilter {
|
||||
|
||||
private final MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
|
||||
private final MultiValueMap<String, Object> headers = new LinkedMultiValueMap<>();
|
||||
|
||||
/**
|
||||
* This constructor instantiates the filter with required fields.
|
||||
@@ -38,7 +38,7 @@ public class HeaderAuthorizationFilter implements AuthorizationFilter {
|
||||
* @param headerName A header name.
|
||||
* @param headerValue A header value.
|
||||
*/
|
||||
public HeaderAuthorizationFilter(String headerName, String headerValue) {
|
||||
public HeaderAuthorizationFilter(String headerName, Object headerValue) {
|
||||
this.headers.add(headerName, headerValue);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class HeaderAuthorizationFilter implements AuthorizationFilter {
|
||||
* @param headerValue A header value.
|
||||
* @return This class for fluent chaining.
|
||||
*/
|
||||
public HeaderAuthorizationFilter add(String headerName, String headerValue) {
|
||||
public HeaderAuthorizationFilter add(String headerName, Object headerValue) {
|
||||
this.headers.add(headerName, headerValue);
|
||||
return this;
|
||||
}
|
||||
@@ -61,8 +61,8 @@ public class HeaderAuthorizationFilter implements AuthorizationFilter {
|
||||
*/
|
||||
@Override
|
||||
public void filter(ClientRequestContext requestContext) throws UnsupportedEncodingException {
|
||||
for (Entry<String, List<String>> header : this.headers.entrySet())
|
||||
requestContext.getHeaders().addAll(header.getKey(), header.getValue());
|
||||
for (Entry<String, List<Object>> header : this.headers.entrySet())
|
||||
requestContext.getHeaders().put(header.getKey(), header.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user