Skip to content

Commit

Permalink
feat(headers): Internal rework and introduce HTTP Headers API
Browse files Browse the repository at this point in the history
  • Loading branch information
brasseld committed Jan 10, 2022
1 parent 5cc7592 commit b92e1dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

<properties>
<gravitee-bom.version>1.0</gravitee-bom.version>
<gravitee-gateway-api.version>1.26.0</gravitee-gateway-api.version>
<gravitee-gateway-api.version>1.31.0-SNAPSHOT</gravitee-gateway-api.version>
<gravitee-expression-language.version>1.8.0-SNAPSHOT</gravitee-expression-language.version>
<gravitee-policy-api.version>1.10.0</gravitee-policy-api.version>
<gravitee-common.version>1.18.0</gravitee-common.version>
<swagger-parser.version>2.0.14</swagger-parser.version>
Expand Down Expand Up @@ -72,6 +73,13 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.gravitee.el</groupId>
<artifactId>gravitee-expression-language</artifactId>
<version>${gravitee-expression-language.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.gravitee.common</groupId>
<artifactId>gravitee-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
*/
package io.gravitee.policy.requestvalidation;

import io.gravitee.common.http.HttpHeaders;
import io.gravitee.common.http.HttpStatusCode;
import io.gravitee.common.util.MultiValueMap;
import io.gravitee.el.TemplateEngine;
import io.gravitee.gateway.api.ExecutionContext;
import io.gravitee.gateway.api.Request;
import io.gravitee.gateway.api.Response;
import io.gravitee.gateway.api.el.EvaluableRequest;
import io.gravitee.gateway.api.http.HttpHeaders;
import io.gravitee.policy.api.PolicyChain;
import io.gravitee.policy.requestvalidation.configuration.RequestValidationPolicyConfiguration;
import io.gravitee.policy.requestvalidation.validator.*;
Expand Down Expand Up @@ -163,7 +163,7 @@ public void shouldValidateQueryParameter_multipleRules() {
when(request.parameters()).thenReturn(parameters);

HttpHeaders headers = mock(HttpHeaders.class);
when(headers.get("my-header")).thenReturn(Collections.singletonList("header-value"));
when(headers.getAll("my-header")).thenReturn(Collections.singletonList("header-value"));
when(request.headers()).thenReturn(headers);

// Prepare template engine
Expand Down Expand Up @@ -272,7 +272,7 @@ public void shouldValidateTheOrderOfViolationsWhenUsingMultipleRules() {
final String PATTERN = "^[0-9a-fA-F]{32}\\z";

HttpHeaders headers = mock(HttpHeaders.class);
when(headers.get("my-header")).thenReturn(null);
when(headers.getAll("my-header")).thenReturn(null);
when(request.headers()).thenReturn(headers);

// Prepare template engine
Expand Down

0 comments on commit b92e1dd

Please sign in to comment.