You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/02/08 08:44:52 UTC

[GitHub] [apisix] zaunist commented on a change in pull request #6267: docs: add forward-auth zh document

zaunist commented on a change in pull request #6267:
URL: https://github.com/apache/apisix/pull/6267#discussion_r801385440



##########
File path: docs/zh/latest/plugins/forward-auth.md
##########
@@ -0,0 +1,140 @@
+---
+title: forward-auth
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 目录
+
+- [**名字**](#名字)
+- [**属性**](#属性)
+- [**数据定义**](#数据定义)
+- [**示例**](#示例)
+- [**测试插件**](#测试插件)
+- [**禁用插件**](#禁用插件)
+
+## 名字
+
+`forward-auth` 插件使用的是经典外部认证。在认证失败的时候,我们可以实现自定义错误或者重定向到认证页面。
+
+Forward Auth 巧妙地将认证和授权逻辑移到了一个专门的外部服务中,网关将用户的请求转发给认证服务并阻塞原始请求,并在认证服务以非 2xx 状态响应时替换结果。
+
+## 属性
+
+| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
+| -- | -- | -- | -- | -- | -- |
+| host | string | 必须 |  |  | 设置 `authorization` 服务的地址 (eg. https://localhost:9188) |
+| ssl_verify | boolean | 可选 | true |   | 是否验证证书 |
+| request_headers | array[string] | 可选 |  |  | 设置需要由 `client` 转发到 `authorization` 服务的请求头。未设置时,只有APISIX的(X-Forwarded-XXX)会被转发到 `authorization` 服务。 |
+| upstream_headers | array[string] | 可选 |  |  | 认证通过时,设置 `authorization` 服务转发至 `upstream` 的请求头。如果不设置则不转发任何请求头。
+| client_headers | array[string] | 可选 |  |  | 认证失败时,由 `authorization` 服务向 `client` 发送的响应头。如果不设置则不转发任何响应头。 |
+| timeout | integer | 可选 | 3000ms | [1, 60000]ms | `authorization` 服务请求超时时间 |
+| keepalive | boolean | 可选 | true |  | HTTP 长连接 |
+| keepalive_timeout | integer | 可选 | 60000ms | [1000, ...]ms | 长连接空闲时间 |
+| keepalive_pool | integer | 可选 | 5 | [1, ...]ms | 连接池大小 |
+
+## 数据定义
+
+request_headers属性中转发到 `authorization` 服务中的APISIX内容清单

Review comment:
       ```suggestion
   request_headers 属性中转发到 `authorization` 服务中的 Apache APISIX 内容清单
   ```
   There should be spaces between Chinese and English.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org