Skip to content

Commit

Permalink
Merge pull request #86 from taboola/RequestHeadersSupplier
Browse files Browse the repository at this point in the history
Add RequestHeadersSupplier
  • Loading branch information
vladimanaev authored Sep 19, 2024
2 parents a23a401 + 2835b03 commit fa2e93b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.taboola</groupId>
<artifactId>backstage-api-java-client</artifactId>
<version>1.1.9</version>
<version>1.1.10</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>Backstage API Java Client</description>
Expand Down Expand Up @@ -53,7 +53,7 @@
<log4j.core.version>2.17.1</log4j.core.version>
<junit.version>4.13.1</junit.version>
<mockito.all.version>1.10.19</mockito.all.version>
<api.java.client.core.version>1.0.6</api.java.client.core.version>
<api.java.client.core.version>1.0.7</api.java.client.core.version>
</properties>

<dependencies>
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/taboola/backstage/Backstage.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import com.taboola.rest.api.model.CommunicationInterceptor;
import com.taboola.rest.api.model.NoOpCommunicationInterceptor;
import com.taboola.rest.api.model.RequestHeader;
import com.taboola.rest.api.model.RequestHeadersSupplier;

/**
* Backstage is the gateway object to all services.
Expand Down Expand Up @@ -183,7 +184,7 @@ public static class BackstageBuilder {
private static final String DEFAULT_BACKSTAGE_HOST = "https://backstage.taboola.com/backstage/";
private static final String DEFAULT_AUTH_BACKSTAGE_HOST = "https://authentication.taboola.com/authentication/";
private static final String DEFAULT_USER_AGENT = "Taboola Java Client";
private static final String VERSION = "1.1.9";
private static final String VERSION = "1.1.10";
private static final SerializationConfig DEFAULT_SERIALIZATION_CONFIG = new SerializationConfig();
private static final CommunicationInterceptor DEFAULT_COMMUNICATION_INTERCEPTOR = new NoOpCommunicationInterceptor();
private String baseUrl;
Expand All @@ -199,6 +200,7 @@ public static class BackstageBuilder {
private Boolean organizeDynamicColumns;
private SerializationConfig serializationConfig;
private Collection<RequestHeader> headers;
private RequestHeadersSupplier headersSupplier;
private CommunicationInterceptor communicationInterceptor;

public BackstageBuilder setBaseUrl(String baseUrl) {
Expand Down Expand Up @@ -266,6 +268,11 @@ public BackstageBuilder setHeaders(Collection<RequestHeader> headers){
return this;
}

public BackstageBuilder setHeadersSupplier(RequestHeadersSupplier headersSupplier){
this.headersSupplier = headersSupplier;
return this;
}

public BackstageBuilder setCommunicationInterceptor(CommunicationInterceptor communicationInterceptor) {
this.communicationInterceptor = communicationInterceptor;
return this;
Expand All @@ -284,6 +291,7 @@ public Backstage build() {
.setWriteTimeoutMillis(writeTimeoutMillis)
.setSerializationConfig(serializationConfig)
.setHeaders(headers)
.setHeadersSupplier(headersSupplier)
.setKeepAliveDurationMillis(keepAliveDurationMillis)
.setExceptionFactory(new BackstageAPIExceptionFactory(objectMapper))
.setUserAgentSuffix(userAgent)
Expand Down

0 comments on commit fa2e93b

Please sign in to comment.