All Products
Search
Document Center

2. Testing and results

Last Updated: Oct 23, 2018

This section describes the testing results.

Trigger function B

Use a Web browser to trigger function B. Since the IP address of your compute is not added to the whitelist in function B, an authentication error is returned.

  1. {
  2. # Return null when the authentication fails
  3. "protected_data": "",
  4. "white_list": [
  5. "127.0.0.1",
  6. "x.x.x.x"
  7. ],
  8. "authorized": false,
  9. # Return the IP address of the visitor
  10. "remote_ip": "y.y.y.y"
  11. }

Trigger function A

Use a Web browser to trigger function A. The following shows the result of function A invoking function B with and without using the proxy.

  1. {
  2. "query_with_proxy_result": {
  3. "secret_data": "Alibaba",
  4. "success": true,
  5. "data_service_raw_data": {
  6. "remote_ip": "x.x.x.x",
  7. "white_list": [
  8. "127.0.0.1",
  9. "x.x.x.x"
  10. ],
  11. "authorized": true,
  12. "protected_data": "Alibaba"
  13. }
  14. },
  15. "query_without_proxy_result": {
  16. "secret_data": "",
  17. "success": false,
  18. "data_service_raw_data": {
  19. "remote_ip": "yy.yy.yy.yy",
  20. "white_list": [
  21. "127.0.0.1",
  22. "x.x.x.x"
  23. ],
  24. "authorized": false,
  25. "protected_data": ""
  26. }
  27. }
  28. }

The result shows that the proxy has obtained the protected data.

The entire testing process is complete. You can reference the preceding process to test and make adjustments based on the actual service.