Skip to content

Commit

Permalink
feat(async): allow use policy in async API
Browse files Browse the repository at this point in the history
APIM-7216
  • Loading branch information
michel-barret committed Dec 9, 2024
1 parent 9de727a commit fff624a
Show file tree
Hide file tree
Showing 21 changed files with 1,242 additions and 653 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 2.1
setup: true

orbs:
gravitee: gravitee-io/gravitee@2.5.0
gravitee: gravitee-io/gravitee@4.8.0

# our single workflow, that triggers the setup job defined above, filters on tag and branches are needed otherwise
# some workflow and job will not be triggered for tags (default CircleCI behavior)
Expand Down
42 changes: 23 additions & 19 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
{
"extends": ["config:base"],
"rebaseWhen": "conflicted",
"baseBranches": ["master"],
"packageRules": [
{
"matchDatasources": ["orb"],
"matchUpdateTypes": ["patch", "minor"],
"automerge": true,
"automergeType": "branch",
"semanticCommitType": "ci"
},
{
"matchDepTypes": ["test"],
"matchUpdateTypes": ["patch", "minor"],
"automerge": true,
"automergeType": "branch",
"semanticCommitType": "fix"
}
]
"extends": ["config:base", ":label(dependencies)"],
"rebaseWhen": "conflicted",
"packageRules": [
{
"matchDatasources": ["orb"],
"matchUpdateTypes": ["patch", "minor"],
"automerge": true,
"automergeType": "branch",
"semanticCommitType": "ci"
},
{
"matchDepTypes": ["provided", "test", "build", "import", "parent"],
"matchUpdateTypes": ["patch", "minor"],
"automerge": true,
"automergeType": "branch",
"semanticCommitType": "chore"
},
{
"matchDepTypes": ["provided", "test", "build", "import", "parent"],
"matchUpdateTypes": ["major"],
"semanticCommitType": "chore"
}
]
}
25 changes: 15 additions & 10 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,34 @@ Before you submit your pull request consider the following guidelines:

* Make your changes in a new git branch:

```shell
[source,shell]
----
git checkout -b issue/#<issue-id>-my-fix-branch master
```
----
Note : issue-id reference the id generated by GitHub (#issue-id).

* Create your patch, **including appropriate test cases**.
* Update the documentation if you create new features or think the documentation needs to be updated/completed.
* Commit your changes using a descriptive commit message.

```shell
[source,shell]
----
git commit -a
```
----

* Build your changes locally to **ensure all the tests pass**:

```shell
[source,shell]
----
mvn clean install
```
----

* Push your branch to GitHub:

```shell
[source,shell]
----
git push origin issue/#<issue-id>-my-fix-branch
```
----

* In GitHub, send a pull request to `<gravitee-io/gravitee-gateway>:master`.

Expand All @@ -59,10 +63,11 @@ git push origin issue/#<issue-id>-my-fix-branch

If the PR gets too outdated we may ask you to rebase and force push to update the PR:

```shell
[source,shell]
----
git rebase master
git push origin issue/#<issue-id>-my-fix-branch -f
```
----

And That's it! You've just contributed to the project and we really appreciate it ! You can still find help, news and information on our https://groups.google.com/forum/#!forum/graviteeio[forum].

Expand Down
20 changes: 18 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ endif::[]

== Phase

=== V3 engine

[cols="2*", options="header"]
|===
^|onRequestContent
^|onResponseContent

^.^| X
^.^| X
|===

=== V4 engine

[cols="4*", options="header"]
|===
^|onRequest
^|onResponse
^|onMessageRequest
^|onMessageResponse

^.^| X
^.^| X
^.^| X
^.^| X
|===

== Description
Expand Down Expand Up @@ -82,9 +98,9 @@ It can inject processing report messages into request metrics for analytics.
|===
|Code |Message

.^| ```400```(Request scope)
.^| `400`(Request scope)

```500```(Response scope)
`500`(Response scope)

| Sent in the following cases:

Expand Down
91 changes: 47 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2015 The Gravitee team (http://gravitee.io)
Copyright © 2015 The Gravitee team (http://gravitee.io)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -30,27 +30,17 @@
<parent>
<groupId>io.gravitee</groupId>
<artifactId>gravitee-parent</artifactId>
<version>21.0.0</version>
<version>22.2.3</version>
</parent>

<properties>
<gravitee-gateway-api.version>2.1.0</gravitee-gateway-api.version>
<gravitee-policy-api.version>1.11.0</gravitee-policy-api.version>
<gravitee-gateway-buffer.version>3.20.0</gravitee-gateway-buffer.version>
<gravitee-bom.version>4.0.1</gravitee-bom.version>
<gravitee-apim.version>4.6.0-SNAPSHOT</gravitee-apim.version>
<gravitee-reactor-message.version>5.0.0-alpha.11</gravitee-reactor-message.version>

<json-schema-validator.version>2.2.14</json-schema-validator.version>
<swagger-parser.version>2.1.13</swagger-parser.version>
<rhino.version>1.7.12</rhino.version>
<mockito.version>4.4.0</mockito.version>

<json-schema-generator-maven-plugin.version>1.3.0</json-schema-generator-maven-plugin.version>
<json-schema-generator-maven-plugin.outputDirectory>${project.build.directory}/schemas</json-schema-generator-maven-plugin.outputDirectory>

<maven-plugin-assembly.version>3.5.0</maven-plugin-assembly.version>
<maven-plugin-prettier.version>0.19</maven-plugin-prettier.version>
<maven-plugin-prettier.prettierjava.version>2.0.0</maven-plugin-prettier.prettierjava.version>
<maven-plugin-properties.version>1.1.0</maven-plugin-properties.version>
<maven-plugin-properties.version>1.2.1</maven-plugin-properties.version>

<publish-folder-path>graviteeio-apim/plugins/policies</publish-folder-path>
</properties>
Expand All @@ -59,9 +49,9 @@
<dependencies>
<!-- Import bom to properly inherit all dependencies -->
<dependency>
<groupId>io.gravitee</groupId>
<artifactId>gravitee-bom</artifactId>
<version>${gravitee-bom.version}</version>
<groupId>io.gravitee.apim</groupId>
<artifactId>gravitee-apim-bom</artifactId>
<version>${gravitee-apim.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -73,14 +63,12 @@
<dependency>
<groupId>io.gravitee.gateway</groupId>
<artifactId>gravitee-gateway-api</artifactId>
<version>${gravitee-gateway-api.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.gravitee.policy</groupId>
<artifactId>gravitee-policy-api</artifactId>
<version>${gravitee-policy-api.version}</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -109,7 +97,6 @@
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>${rhino.version}</version>
</dependency>

<dependency>
Expand All @@ -122,33 +109,65 @@
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<version>${swagger-parser.version}</version>
<scope>provided</scope>
</dependency>

<!-- Test scope -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.gravitee.apim.gateway</groupId>
<artifactId>gravitee-apim-gateway-buffer</artifactId>
<version>${gravitee-gateway-buffer.version}</version>
<version>${gravitee-apim.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gravitee.apim.gateway</groupId>
<artifactId>gravitee-apim-gateway-tests-sdk</artifactId>
<version>${gravitee-apim.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gravitee.apim.plugin.endpoint</groupId>
<artifactId>gravitee-apim-plugin-endpoint-mock</artifactId>
<version>${gravitee-apim.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gravitee.apim.plugin.entrypoint</groupId>
<artifactId>gravitee-apim-plugin-entrypoint-http-proxy</artifactId>
<version>${gravitee-apim.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gravitee.apim.plugin.endpoint</groupId>
<artifactId>gravitee-apim-plugin-endpoint-http-proxy</artifactId>
<version>${gravitee-apim.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.graviteesource.reactor</groupId>
<artifactId>gravitee-reactor-message</artifactId>
<version>${gravitee-reactor-message.version}</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -207,22 +226,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.hubspot.maven.plugins</groupId>
<artifactId>prettier-maven-plugin</artifactId>
<version>${maven-plugin-prettier.version}</version>
<configuration>
<prettierJavaVersion>${maven-plugin-prettier.prettierjava.version}</prettierJavaVersion>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
4 changes: 2 additions & 2 deletions src/assembly/policy-assembly.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--
Copyright (C) 2015 The Gravitee team (http://gravitee.io)
Copyright © 2015 The Gravitee team (http://gravitee.io)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Loading

0 comments on commit fff624a

Please sign in to comment.