Skip to content

Commit e5c911b

Browse files
authored
Merge pull request #2757 from emqx/1203-fix-auth-placeholder-desc
feat: add peerport authn/authz variable description; remove peername description
2 parents dfc06d5 + 7846fe9 commit e5c911b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

en_US/access-control/authn/authn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ EMQX currently supports the following placeholders:
187187

188188
- `${peerhost}`: It will be replaced with the client's IP address at runtime. EMQX supports [Proxy Protocol](http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt), that is, even if EMQX is deployed behind some TCP proxy or load balancer, users can still use this placeholder to get the real IP address.
189189

190-
- `${peername}`: It will be replaced with the client's IP address and port in runtime, and the format is `IP: PORT`.
190+
- `${peerport}`: It will be replaced with the client's IP port in runtime.
191191

192192
- `${cert_subject}`: It will be replaced by the subject of the client's TLS certificate at runtime. If the load balancer sends client certificate information to the TCP listener, ensure that Proxy Protocol v2 is in use.
193193

en_US/access-control/authz/authz.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The following placeholders are supported in query statements:
8989
* `${username}`: It is replaced with the username at runtime. The username comes from the `Username` field in the `CONNECT` packet. If `peer_cert_as_username` is enabled, it is overridden by the fields or the content of the certificate.
9090
* `${clientid}`: It is replaced by the client ID at runtime. The client ID is normally explicitly specified by the client in the `CONNECT` packet. If `use_username_as_clientid` or `peer_cert_as_clientid` is enabled, this field is overridden by the username, fields in the certificate, or the content of the certificate.
9191
* `${peerhost}`: It is replaced with the client's IP address at runtime. EMQX supports [Proxy Protocol](http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt), that is, even if EMQX is deployed behind some TCP proxy or load balancer, users can still use this placeholder to get the real IP address.
92-
* `${peername}`: It is replaced with the client's IP address and port in runtime, and the format is `IP: PORT`.
92+
- `${peerport}`: It will be replaced with the client's IP port in runtime.
9393
* `${cert_common_name}`: It is replaced by the Common Name of the client's TLS certificate at runtime. If the load balancer sends client certificate information to the TCP listener, ensure that Proxy Protocol v2 is in use.
9494
* `${cert_subject}`: It is replaced by the subject of the client's TLS certificate at runtime. If the load balancer sends client certificate information to the TCP listener, ensure that Proxy Protocol v2 is in use.
9595
* `${client_attrs.NAME}`: A client attribute. `NAME` will be replaced by an attribute name set based on predefined configurations at runtime. For details about the client attributes, see [MQTT Client Attributes](../../client-attributes/client-attributes.md).

zh_CN/access-control/authn/authn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ SELECT password_hash, salt FROM mqtt_user where username = 'emqx_u' LIMIT 1
173173

174174
- `${peerhost}`: 将在运行时被替换为客户端的 IP 地址。EMQX 支持 [Proxy Protocol](http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt),即使 EMQX 部署在某些 TCP 代理或负载均衡器之后,用户也可以使用此占位符获得真实 IP 地址。
175175

176-
- `${peername}`: 将在运行时被替换为客户端的 IP 地址和端口,格式为 `IP:PORT`
176+
- `${peerport}`: 它将在运行时被客户端的 IP 端口替换
177177

178178
- `${cert_subject}`: 将在运行时被替换为客户端 TLS 证书的主题(Subject)。如果证书信息是从负载均衡器发送到 EMQX 的 TCP 端口,需要确保负载均衡器使用的是 Proxy Protocol v2。
179179

zh_CN/access-control/authz/authz.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ EMQX 授权支持的数据查询占位符如下:
9090
- `${username}`: 将在运行时被替换为用户名。用户名来自 `CONNECT` 报文中的 `Username` 字段。如果启用了 `peer_cert_as_username`,则会在连接时被证书中的字段或证书内容所覆盖。
9191
- `${clientid}`: 将在运行时被替换为客户端 ID。客户端 ID 一般由客户端在 `CONNECT` 报文中显式指定,如果启用了 `use_username_as_clientid``peer_cert_as_clientid`,则会在连接时被用户名、证书中的字段或证书内容所覆盖。
9292
- `${peerhost}`: 将在运行时被替换为客户端的 IP 地址。EMQX 支持 [Proxy Protocol](http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt),即使 EMQX 部署在某些 TCP 代理或负载均衡器之后,用户也可以使用此占位符获得真实 IP 地址。
93-
- `${peername}`: 将在运行时被替换为客户端的 IP 地址和端口,格式为 `IP:PORT`
93+
- `${peerport}`: 它将在运行时被客户端的 IP 端口替换
9494
- `${cert_common_name}`: 将在运行时被替换为客户端 TLS 证书的通用名称(Common Name)。如果证书信息是从负载均衡器发送到 EMQX 的 TCP 端口,需要确保负载均衡器使用的是 Proxy Protocol v2。
9595
- `${cert_subject}`: 将在运行时被替换为客户端 TLS 证书的主题(Subject)。如果证书信息是从负载均衡器发送到 EMQX 的 TCP 端口,需要确保负载均衡器使用的是 Proxy Protocol v2。
9696
- `${client_attrs.NAME}`: 某个客户端属性。`NAME` 将在运行时根据预定义配置替换为属性名称。有客户端属性的详细信息,请参见 [MQTT 客户端属性](../../client-attributes/client-attributes.md)

0 commit comments

Comments
 (0)