-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.http
45 lines (33 loc) · 4.14 KB
/
test.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
### 查看所有数据
GET http://localhost:20010/data/
SECRET: 123456
########################## 规则管理
### 添加规则
POST http://localhost:20010/rule/
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
name=test&authorizer={"type":"JWT_SM2","config":"{\"expires\":30,\"private_key\":\"MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgW4DdWCEwKgZnZfFqG_IgJjGGOsT_JVej1V0i2MAJvBygCgYIKoEcz1UBgi2hRANCAARAMHHWBGrSyVL9VraTx73Hnt3XW1N1k6AWA5nseBAWgdWyrnrPQ5p8rHYoiWEz3OIlRyVhs2URGIjzKGWoCXzh\"}"}&updater={"type":"JWT_RS256","config":"{\"expires\":30,\"public_key\":\"MIGJAoGBAL_5UXg3yYOczjDdMZgXyh7x--D71lUMsIWLOD_xwES4m68iLwXgydSa90ObKnQRUTQ8Mu0fqo0nTAyBK7V6tXXoEiwIvLRPMUyL_B9rjNP7Je40ukPcxaXKN3fjTQenOOxT0TtgCuPXRb5ikBJLD0xsJT0K2xYUR1Q90w2fVk3lAgMBAAE\", \"private_key\":\"MIICXAIBAAKBgQC_-VF4N8mDnM4w3TGYF8oe8fvg-9ZVDLCFizg_8cBEuJuvIi8F4MnUmvdDmyp0EVE0PDLtH6qNJ0wMgSu1erV16BIsCLy0TzFMi_wfa4zT-yXuNLpD3MWlyjd3400HpzjsU9E7YArj10W-YpASSw9MbCU9CtsWFEdUPdMNn1ZN5QIDAQABAoGBAIpWJQkWWlZHFqZLnsNU0Ue_ZJxZnben70QscJpToRNkXHu1jGEV_RsBmJDVLaB6IiQcBS6ulP4mhTy1kEO0azGN5K5CWfnG8yn61DV-e0IJ3ge7eHnIn_qjUkhjKabRoBhE_iX55N833fOzKRs7_3VgUCbkTzTwkssxhxBZETE5AkEA6RqprZ8iy8c3D7Nm7n0q2si1cX-1WK830aD6v8H5h16OzcIE9cIxQEEyiSp4gY-zXYKcLEZYic0XqfWnt4cH2wJBANLUcm9dukW13GInshwn6QUhRT5uJQArccIuJuXYFYLq42j9uxfRrHtuQMxkwMGaIWEWWs8suzNKrSHVK4jDzT8CQFL-wUcmD9eKOJqIf6-ONUHskF224LSQvkkPDfhUcim2ixXLbMSrvalpDTs1Oe63YV9772r8KO33beN_qZV4qF0CQFa7gWxhQa1F-KkErZg5rvomSsc5Js2gEceRlvz9XTQjj3R01ZAh-PQ6UjwDwuyijNLVEHykaUrbkMgXWzaDXp8CQCfkctiTbg-2ztSCVuxCwX20NF0g2wLma_AZiX26GDxPJB3ZNLQrpD5LcwpVOeYMrL6xSUvXZZCEKf2WQnqCJxc\"}"}
### name=test&authorizer={"type":"JWT_HS256","config":"{\"expires\":30,\"secret\":\"123456\"}"}&updater={"type":"JWT_HS256","config":"{\"expires\":30,\"secret\":\"123456\"}"}
### 添加或替换规则
PUT http://localhost:20010/rule/dGVzdDI
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
authorizer={"type":"JWT_SM4","config":"{\"expires\":180,\"key\":\"abcdefghijklmnop\"}"}&updater={"type":"JWT_RS256","config":"{\"expires\":30,\"public_key\":\"MIGJAoGBAL_5UXg3yYOczjDdMZgXyh7x--D71lUMsIWLOD_xwES4m68iLwXgydSa90ObKnQRUTQ8Mu0fqo0nTAyBK7V6tXXoEiwIvLRPMUyL_B9rjNP7Je40ukPcxaXKN3fjTQenOOxT0TtgCuPXRb5ikBJLD0xsJT0K2xYUR1Q90w2fVk3lAgMBAAE\", \"private_key\":\"MIICXAIBAAKBgQC_-VF4N8mDnM4w3TGYF8oe8fvg-9ZVDLCFizg_8cBEuJuvIi8F4MnUmvdDmyp0EVE0PDLtH6qNJ0wMgSu1erV16BIsCLy0TzFMi_wfa4zT-yXuNLpD3MWlyjd3400HpzjsU9E7YArj10W-YpASSw9MbCU9CtsWFEdUPdMNn1ZN5QIDAQABAoGBAIpWJQkWWlZHFqZLnsNU0Ue_ZJxZnben70QscJpToRNkXHu1jGEV_RsBmJDVLaB6IiQcBS6ulP4mhTy1kEO0azGN5K5CWfnG8yn61DV-e0IJ3ge7eHnIn_qjUkhjKabRoBhE_iX55N833fOzKRs7_3VgUCbkTzTwkssxhxBZETE5AkEA6RqprZ8iy8c3D7Nm7n0q2si1cX-1WK830aD6v8H5h16OzcIE9cIxQEEyiSp4gY-zXYKcLEZYic0XqfWnt4cH2wJBANLUcm9dukW13GInshwn6QUhRT5uJQArccIuJuXYFYLq42j9uxfRrHtuQMxkwMGaIWEWWs8suzNKrSHVK4jDzT8CQFL-wUcmD9eKOJqIf6-ONUHskF224LSQvkkPDfhUcim2ixXLbMSrvalpDTs1Oe63YV9772r8KO33beN_qZV4qF0CQFa7gWxhQa1F-KkErZg5rvomSsc5Js2gEceRlvz9XTQjj3R01ZAh-PQ6UjwDwuyijNLVEHykaUrbkMgXWzaDXp8CQCfkctiTbg-2ztSCVuxCwX20NF0g2wLma_AZiX26GDxPJB3ZNLQrpD5LcwpVOeYMrL6xSUvXZZCEKf2WQnqCJxc\"}"}
### 删除规则
DELETE http://localhost:20010/rule/dGVzdA
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
########################## 授权管理
### 签发授权
POST http://localhost:20010/auth
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
name=test2&payload={"key": "value", "key2": "value2"}
### 验证授权
GET http://localhost:20010/auth?name=test2&token=eyJhbGciOiJTTTQiLCJ0eXAiOiJKV1QifQ.eyJleHBpcmVzIjoxNjAwMTQwNjk0fQ.1v4Ziecg7G7UzSL79qKwlXz1RH1RMIEeDx1P8isd2ReSFXFbNQxrSWnlmpKqalJCUH9ZaPs6akeuxbvu4GdgGoI2s-Qa0KFoHGI6YddHV0g
SECRET: 123456
### 刷新授权
PUT http://localhost:20010/auth
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
name=test2&refresh_token=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1OTk2MjI0NzQuNjU5Mjc2fQ.G2B0K82_C_R3Ql8_JWA-NxJz8bZm_H6ImCUHQor5YSCNUQA_uxXc3B7EGiLQfnOjrhGPBsWeItUsUyePyGJ_Zmcfa22VgqnjjD6-fP0KiMUzkjZUKUAn8Yyn1N5P7Y-FjsNpG4QyrujNvzPQpoVrwbqDQTHHX_0aAyTHWGqmxzk&token=eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1OTk1MzYxMDQuNjU5MTcxLCJwYXlsb2FkIjoie1wia2V5XCI6IFwidmFsdWVcIiwgXCJrZXkyXCI6IFwidmFsdWUyXCJ9In0.NQ5RfW6km1HWG9FjbifUMXFsvHhsFWifxzOSjVnhA-Y