kayx23 commented on code in PR #11601:
URL: https://github.com/apache/apisix/pull/11601#discussion_r1776292153


##########
docs/en/latest/terminology/credential.md:
##########
@@ -0,0 +1,151 @@
+---
+title: Credential
+keywords:
+  - APISIX
+  - API 网关
+  - 凭证
+  - Credential
+description: 本文介绍了 Apache APISIX Credential 对象的作用以及如何使用 Credential。
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+## Description
+
+Credential is the object that holds the [Consumer](./consumer.md) credential 
configuration.
+A Consumer can use multiple credentials of different types.
+Credentials are used when you need to configure multiple credentials for a 
Consumer.
+
+Currently, Credential can be configured with the authentication plugins 
`basic-auth`, `hmac-auth`, `jwt-auth`, and `key-auth`.
+
+### Configuration options
+
+The fields for defining a Credential are defined as below.
+
+| Field      | Required | Description                                          
                                                   |
+|---------|-----|---------------------------------------------------------------------------------------------------------|
+| desc    | 否   | Decriptiion of the Credential.                               
                                           |
+| labels  | 否   | Labels of the Credential.                                    
                                           |
+| plugins | 否   | The plugin configuration corresponding to Credential. For 
more information, see [Plugins](./plugin.md). |
+
+:::note
+
+如需了解更多关于 Consumer 对象的信息,你可以参考 [Admin API 
Credential](../admin-api.md#credential) 资源介绍。
+
+:::
+
+## Example
+
+[Consumer Example](./consumer.md#example) describes how to configure the auth 
plugin for Consumer and how to use it with other plugins.
+In this example, the Consumer has only one credential of type key-auth.
+Now suppose the user needs to configure multiple credentials for that 
Consumer, you can use Credential to support this.
+
+:::note
+You can fetch the `admin_key` from `config.yaml` and save to an environment 
variable with the following command:
+
+```bash
+admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 
's/"//g')
+```
+
+:::
+
+1. Create the Consumer without specifying the auth plug-n, but use Credential 
to configure the auth plugin later.
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H "X-API-KEY: $admin_key" -X PUT -d '
+    {
+        "username": "jack"
+    }'
+    ```
+
+2. Create 2 `key-auth` 的 Credentials for the Consumer.

Review Comment:
   <img width="959" alt="image" 
src="https://github.com/user-attachments/assets/940723d0-92ae-4906-88ad-c523c22e9b29";>
   
   Mix of Chinese and English throughout this doc.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to