Skip to content

Commit 1190667

Browse files
committed
adjust readme
Signed-off-by: gang.liu <[email protected]>
1 parent e705ee6 commit 1190667

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

README.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# envoy-extproc-payloadlimit-demo-go
1+
# envoy-extproc-anti-replay-demo-go
22

3-
This repository contains a demo applicationw written in Go that demonstrates the usage of Envoy's External Processor (ExtProc) filter to do `payload limit` for POST request.
3+
This repository contains a demo application written in Go that demonstrates the usage of Envoy's External Processor (ExtProc) filter to do `anti-replay` for HTTP request.
44

55
## Overview
66

@@ -19,7 +19,7 @@ To get started with the demo application, follow these steps:
1919

2020
1. Clone the repository:
2121
```
22-
git clone https://github.com/projectsesame/envoy-extproc-payloadlimit-demo-go.git
22+
git clone https://github.com/projectsesame/envoy-extproc-anti-replay-demo-go.git
2323
```
2424
2525
2. Build the Go application:
@@ -29,9 +29,36 @@ To get started with the demo application, follow these steps:
2929
3030
3. Run the application:
3131
```
32-
./envoy-extproc-payloadlimit-demo-go payload-limit --log-stream --log-phases payload-limit 32
32+
./envoy-extproc-anti-replay-demo-go anti-replay --log-stream --log-phases timespan 450
3333
```
34+
4. Do request:
35+
```shell
36+
curl --request POST \
37+
--url https://https.projectcontour.io:8443/post \
38+
--data '{
39+
"key": "value",
40+
"key2": "",
41+
"sign": "659876b30987883efdf178e69f062896",
42+
"nonce": "6062",
43+
"timestamp": "1712480920"
44+
}'
3445
46+
```
47+
48+
Field Description:
49+
1. sign: MD5(k1=v1&k2=v2&...kN=vN) # order by key's ascending alphabetical, **skip the zero value**.
50+
51+
eg:
52+
53+
```shell
54+
sign= MD5("key=value&nonce=6062&timestamp=1712480920") = 659876b30987883efdf178e69f062896
55+
```
56+
2. nonce: the uuid that can only be used once within a timespan.
57+
58+
3. timestamp: the current timestamp.
59+
60+
PS:
61+
1. The use of the md5 here is only as a demo, in product,please use the signature algorithm likes **SHA256WithRSA**.
3562
3663
## Usage
3764

0 commit comments

Comments
 (0)