Skip to content

Commit 87f8c56

Browse files
Merge pull request #1804 from renuka-fernando/interceptor
add interceptor service policy definition
2 parents a42180b + 1d6a50a commit 87f8c56

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

gateway/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ policies:
2424
gomodule: github.com/wso2/gateway-controllers/policies/dynamic-endpoint@v1
2525
- name: host-rewrite
2626
gomodule: github.com/wso2/gateway-controllers/policies/host-rewrite@v1
27+
- name: interceptor-service
28+
gomodule: github.com/wso2/gateway-controllers/policies/interceptor-service@v0
2729
- name: json-schema-guardrail
2830
gomodule: github.com/wso2/gateway-controllers/policies/json-schema-guardrail@v1
2931
- name: json-xml-mediator
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: interceptor-service
2+
version: v0.9.0
3+
description: |
4+
Calls a user-defined HTTP interceptor service for request and/or response
5+
phases. The interceptor can mutate headers, body, path, route to a dynamic
6+
endpoint, or short-circuit with a direct response.
7+
8+
parameters:
9+
type: object
10+
properties:
11+
endpoint:
12+
type: string
13+
x-wso2-policy-advanced-param: false
14+
description: |
15+
Base URL of the interceptor service (e.g. https://my-svc:8443/api/v1).
16+
The policy will POST to {endpoint}/handle-request and
17+
{endpoint}/handle-response.
18+
minLength: 1
19+
request:
20+
type: object
21+
x-wso2-policy-advanced-param: false
22+
description: Enable and configure the request-phase interception.
23+
properties:
24+
includeRequestHeaders:
25+
type: boolean
26+
default: true
27+
includeRequestBody:
28+
type: boolean
29+
default: true
30+
passthroughOnError:
31+
type: boolean
32+
default: false
33+
response:
34+
type: object
35+
x-wso2-policy-advanced-param: false
36+
description: Enable and configure the response-phase interception.
37+
properties:
38+
includeRequestHeaders:
39+
type: boolean
40+
default: false
41+
includeRequestBody:
42+
type: boolean
43+
default: false
44+
includeResponseHeaders:
45+
type: boolean
46+
default: true
47+
includeResponseBody:
48+
type: boolean
49+
default: true
50+
passthroughOnError:
51+
type: boolean
52+
default: false
53+
timeoutMillis:
54+
type: integer
55+
x-wso2-policy-advanced-param: true
56+
minimum: 100
57+
maximum: 60000
58+
default: 5000
59+
tlsSkipVerify:
60+
type: boolean
61+
x-wso2-policy-advanced-param: true
62+
description: Skip TLS verification for the interceptor service (dev only).
63+
default: false
64+
required:
65+
- endpoint
66+
anyOf:
67+
- required: [request]
68+
- required: [response]

0 commit comments

Comments
 (0)