Files
pyGoEdge-UserPanel/reference/goedge 文档/HTTPAuthPolicyService.md
2025-11-18 03:36:49 +08:00

2.1 KiB
Raw Blame History

HTTPAuthPolicyService

服务认证策略服务


createHTTPAuthPolicy

创建策略

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPAuthPolicyService/createHTTPAuthPolicy
  • RPCrpc createHTTPAuthPolicy (CreateHTTPAuthPolicyRequest) returns (CreateHTTPAuthPolicyResponse);

请求对象 (CreateHTTPAuthPolicyRequest)

{
  "name": "string // 名称",
  "type": "string",
  "paramsJSON": "bytes"
}

响应对象 (CreateHTTPAuthPolicyResponse)

{
  "httpAuthPolicyId": "int64"
}

调用示例

curl -X POST "https://backend.dooki.cloud/HTTPAuthPolicyService/createHTTPAuthPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findEnabledHTTPAuthPolicy

查找策略信息

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPAuthPolicyService/findEnabledHTTPAuthPolicy
  • RPCrpc findEnabledHTTPAuthPolicy (FindEnabledHTTPAuthPolicyRequest) returns (FindEnabledHTTPAuthPolicyResponse);

请求对象 (FindEnabledHTTPAuthPolicyRequest)

{
  "httpAuthPolicyId": "int64"
}

响应对象 (FindEnabledHTTPAuthPolicyResponse)

{
  "httpAuthPolicy": "HTTPAuthPolicy"
}

调用示例

curl -X POST "https://backend.dooki.cloud/HTTPAuthPolicyService/findEnabledHTTPAuthPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

updateHTTPAuthPolicy

修改策略

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPAuthPolicyService/updateHTTPAuthPolicy
  • RPCrpc updateHTTPAuthPolicy (UpdateHTTPAuthPolicyRequest) returns (RPCSuccess);

请求对象 (UpdateHTTPAuthPolicyRequest)

{
  "httpAuthPolicyId": "int64",
  "name": "string // 名称",
  "paramsJSON": "bytes",
  "isOn": "bool // 是否启用"
}

响应对象 (RPCSuccess)

{}

调用示例

curl -X POST "https://backend.dooki.cloud/HTTPAuthPolicyService/updateHTTPAuthPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'