moonming commented on code in PR #12551:
URL: https://github.com/apache/apisix/pull/12551#discussion_r2314728070


##########
t/plugin/proxy-rewrite2.t:
##########
@@ -27,6 +27,8 @@ add_block_preprocessor(sub {
     my $yaml_config = $block->yaml_config // <<_EOC_;
 apisix:
     node_listen: 1984
+    trusted_addresses:

Review Comment:
   ditto



##########
conf/config.yaml.example:
##########
@@ -141,6 +141,10 @@ apisix:
                                   # or (standalone mode) the config isn't 
loaded yet either via file or Admin API.
   # disable_upstream_healthcheck: false # A global switch for healthcheck. 
Defaults to false.
                                         # When set to true, it overrides all 
upstream healthcheck configurations and globally disabling healthchecks.
+# trusted_addresses:              # When enabled, APISIX will trust the 
`X-Forwarded-*` Headers
+#   - 127.0.0.1                   # passed in requests from the IP/CIDR in the 
list.
+#   - 0.0.0.0/0                   # CAUTION: When not configured, APISIX will 
remove `X-Forwarded-*` headers

Review Comment:
   No IP restriction is a bad example



##########
t/plugin/sls-logger.t:
##########
@@ -267,6 +267,8 @@ apisix:
         enable_encrypt_fields: true
         keyring:
             - edd1c9f0985e76a2
+    trusted_addresses:

Review Comment:
   ditto



##########
t/plugin/dubbo-proxy/upstream.t:
##########
@@ -51,6 +51,8 @@ _EOC_
 apisix:
     node_listen: 1984
     enable_admin: false
+    trusted_addresses:
+        - "127.0.0.1"

Review Comment:
   why change this test case?



##########
t/core/trusted-addresses.t:
##########
@@ -0,0 +1,219 @@
+#

Review Comment:
   Need to test the situation where trusted-addresses contain multiple IP 
addresses



##########
t/core/trusted-addresses.t:
##########
@@ -0,0 +1,219 @@
+#

Review Comment:
   and need test cases in plugins.



##########
conf/config.yaml.example:
##########
@@ -141,6 +141,10 @@ apisix:
                                   # or (standalone mode) the config isn't 
loaded yet either via file or Admin API.
   # disable_upstream_healthcheck: false # A global switch for healthcheck. 
Defaults to false.
                                         # When set to true, it overrides all 
upstream healthcheck configurations and globally disabling healthchecks.
+# trusted_addresses:              # When enabled, APISIX will trust the 
`X-Forwarded-*` Headers

Review Comment:
   ```suggestion
   # trusted_addresses:              # When enabled, APISIX will trust the 
`X-Forwarded-*` Headers
   ```
   how to disabled?



-- 
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