API Debug Key Common to All Deployments

Customizing api_debug_key and api_debug_secret

You can customize the following properties in docker-deploy/properties/tml_tm_properties.json, before deploying the Mashery Local cluster.

"api_debug_key": "24NumbersAndOrCharacters",
"api_debug_secret": "10NumChars"
Note:
  • The api_debug_key is composed of 24 numbers and / or lower-case characters.
  • The api_debug_secret is composed of 10 numbers and / or lower-case characters

Generating API Debug Authentication Code

You can generate API debug authentication code using the following scripts:

php -r 'echo hash_hmac("sha256", "$api_debug_key", "$api_debug_secret");'; echo
that is,
php -r 'echo hash_hmac("sha256", "24NumbersAndOrCharacters", "10NumChars");'; echo
Sample output for reference is:
398c80380ad5cd32c06e8018108528a6119e33f99a639dfc965bb461392baf02

Using API Debug Authentication Code in Requests

You can use debug authentication codes in requests.

To enable API debug, use X-Mashery-Debug as the HTTP header. The value of X-Mashery-Debug can be obtained from the following sample code:
curl -v -H 'host: tml.mashery.com' -H 'X-Mashery-Debug: 398c80380ad5cd32c06e8018108528a6119e33f99a639dfc965bb461392baf02' http://$LB:80/mock?api_key=3rrgjz32q64ysm4t8ea4jzqa
An example of request and response is,
curl -v -H 'host: tml.mashery.com' -H 'X-Mashery-Debug: 398c80380ad5cd32c06e8018108528a6119e33f99a639dfc965bb461392baf02' http://$LB:80/mock?api_key=3rrgjz32q64ysm4t8ea4jzqa
*   Trying 35.222.3.8...
* TCP_NODELAY set
* Connected to 35.222.3.8 (35.222.3.8) port 80 (#0)
> GET /mock?api_key=3rrgjz32q64ysm4t8ea4jzqa HTTP/1.1
> host: tml.mashery.com
> User-Agent: curl/7.54.0
> Accept: */*
> X-Mashery-Debug: fd4778acb14aa2470a3f1cf7a6d77a2023d319f82cae270a545be66cfc7ac3d9
>
< HTTP/1.1 200 OK
< X-Mashery-Debug-path_info: /mock
< X-Mashery-Responder: tm-deploy-0-54bcd5489f-7qdkv
< Content-type: text/html
< Date: Sat, 26 Oct 2019 22:12:32 GMT
< X-Powered-By: PHP/5.3.3
< Content-Length: 25
< X-Mashery-Debug-Servlet-Bundle-Version-com.mashery.proxy.servlet: 1.0.0.v20191026-1954
< X-Mashery-Debug-Responder-Bundle-Version-com.mashery.proxy.responder: 1.0.0.v20190812-0255
< X-Mashery-Debug-Request-Method: GET
< X-Mashery-Debug-Endpoint-Sorted: [/mock]
< X-Mashery-Debug-Endpoint-Match-Checking0: /mock
< X-Mashery-Debug-Endpoint-Match: /mock
< X-Mashery-Debug-Key: GET tml.mashery.com/mock
< X-Mashery-Debug-Service-Key: 6t5mcv6aap3xzsyaf3qd5b4p::171230
< X-Mashery-Debug-Service-Revision-Number: 2
< X-Mashery-Debug-Adapter-Factory: com.mashery.proxy.responder.DefaultAdapter
< X-Mashery-Debug-Adapter-Bundle-Version-com.mashery.proxy.responder: 1.0.0.v20190812-0255
< X-Mashery-Debug-Split-Path-Method-Found:
< X-Mashery-Debug-Find-Mapi-Value-Data: [api_key=3rrgjz32q64ysm4t8ea4jzqa]
< X-Mashery-Debug-Mapi-Value-Key: api_key
< X-Mashery-Debug-PLAN-KEY: Plan_6310::171230::-1
< X-Mashery-Debug-PLAN-IS_UNDEFINED_METHOD_ALLOWED: true
< X-Mashery-Debug-Memcount-Timestamp: 1572127951
< X-Mashery-Debug-Plan-QPS-Limit: 2
< X-Mashery-Debug-QPS-Dev-Key: QPS_6310::PKG::3rrgjz32q64ysm4t8ea4jzqa::pid6310:31
< X-Mashery-Debug-Rate-Count-Component-Name: pid
< X-Mashery-Debug-Rate-Count: 2
< X-Mashery-Debug-Rate-Limit-Ceiling: 5000
< X-Mashery-Debug-Cache-Enabled: 0
< X-Mashery-Debug-Backend-Request: http://content.mock.mashery.com/?api_key=3rrgjz32q64ysm4t8ea4jzqa
< X-Mashery-Debug-Backend-Addresses-All: [content.mock.mashery.com/50.17.201.93, content.mock.mashery.com/54.204.22.178, content.mock.mashery.com/2406:da00:ff00:0:0:0:3211:c95d, content.mock.mashery.com/2406:da00:ff00:0:0:0:36cc:16b2]
< X-Mashery-Debug-Backend-Connect: content.mock.mashery.com/54.204.22.178:80
< X-Mashery-Debug-Backend-Address: content.mock.mashery.com/54.204.22.178:80
< X-Mashery-Debug-Default-Do-Filter: false
<
* Connection #0 to host 35.222.3.8 left intact