Skip to content

Instantly share code, notes, and snippets.

@fatmcgav
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatmcgav/85c60c938e850809bea2 to your computer and use it in GitHub Desktop.
Save fatmcgav/85c60c938e850809bea2 to your computer and use it in GitHub Desktop.
Tyk Middleware testing...
{
"api_definition": {
"active": true,
"allowed_ips": [],
"api_id": "714007cd6f1347906a9218a0a7ad2213",
"auth": {
"auth_header_name": "Authorization",
"use_param": false
},
"auth_provider": {
"meta": {},
"name": "",
"storage_engine": ""
},
"cache_options": {
"cache_all_safe_requests": false,
"cache_timeout": 0,
"enable_cache": false,
"enable_upstream_cache_control": false
},
"custom_middleware": {
"post": [
{
"name": "insertVersion",
"path": "middleware/insertVersion.js",
"require_session": true
}
],
"pre": []
},
"definition": {
"key": "version",
"location": "url-param"
},
"dont_set_quota_on_create": false,
"enable_batch_request_support": false,
"enable_ip_whitelisting": false,
"enable_signature_checking": false,
"event_handlers": {
"events": {}
},
"expire_analytics_after": 0,
"hmac_allowed_clock_skew": -1,
"id": "559f8b68ad28b60f43000002",
"name": "Catalogue Service",
"notifications": {
"oauth_on_keychange_url": "",
"shared_secret": ""
},
"oauth_meta": {
"allowed_access_types": [],
"allowed_authorize_types": [],
"auth_login_redirect": ""
},
"org_id": "559f87d8ad28b60f43000001",
"proxy": {
"listen_path": "/714007cd6f1347906a9218a0a7ad2213/",
"strip_listen_path": true,
"target_url": "http://192.168.250.20:8080/"
},
"response_processors": [],
"session_lifetime": 0,
"session_provider": {
"meta": null,
"name": "",
"storage_engine": ""
},
"slug": "catsvc",
"use_basic_auth": false,
"use_keyless": false,
"use_oauth2": false,
"version_data": {
"not_versioned": false,
"versions": {
"Default": {
"expires": "",
"extended_paths": {
"black_list": [],
"cache": [],
"ignored": [],
"transform": [],
"transform_headers": [],
"transform_response": [],
"transform_response_headers": [],
"white_list": []
},
"name": "Default",
"paths": {
"black_list": [],
"ignored": [],
"white_list": []
},
"use_extended_paths": true
},
"v1": {
"expires": "",
"extended_paths": {
"black_list": [],
"cache": [],
"ignored": [],
"transform": [],
"transform_headers": [],
"transform_response": [],
"transform_response_headers": [],
"white_list": [
{
"method_actions": {
"DELETE": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"PATCH": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"PUT": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues/{uuid}/products/{productId}/variants/{variantId}"
},
{
"method_actions": {
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"POST": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues/{uuid}/products/{productId}/variants"
},
{
"method_actions": {
"DELETE": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"PATCH": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"PUT": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues/{uuid}/products/{productId}"
},
{
"method_actions": {
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"POST": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues/{uuid}/products"
},
{
"method_actions": {
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues/{uuid}/history"
},
{
"method_actions": {
"DELETE": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"PATCH": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"PUT": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues/{uuid}"
},
{
"method_actions": {
"GET": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
},
"POST": {
"action": "no_action",
"code": 200,
"data": "",
"headers": {}
}
},
"path": "/catalogues"
}
]
},
"name": "v1",
"paths": {
"black_list": [],
"ignored": [],
"white_list": []
},
"use_extended_paths": true
}
}
}
},
"api_model": {},
"hook_references": []
}
curl -i -H 'Authorization: 559f87d8ad28b60f43000001db711b12fa07421475a699bbb35128e7' http://api.lt0772.local/714007cd6f1347906a9218a0a7ad2213/v1/catalogues\?version\=v1
HTTP/1.1 429 Too Many Requests
Date: Mon, 13 Jul 2015 15:21:33 GMT
Content-Type: application/json
Connection: keep-alive
X-Generator: tyk.io
Content-Length: 38
{
"error": "Rate limit exceeded"
}
[vagrant@tyk tyk]$ pwd
/opt/tyk
[vagrant@tyk tyk]$ ll middleware/
total 8
-rw-r--r--. 1 root tape 777 Jul 13 12:23 insertVersion.js
[vagrant@tyk tyk]$
// --- insertVersion.js ---
// Create a middleware object
var insertVersionMiddleware = new TykJS.TykMiddleware.NewMiddleware({});
// Initialise it with your functionality by passing a closure that accepts two objects
// into the NewProcessRequest() function:
insertVersionMiddleware.NewProcessRequest(function(request, session) {
// We got here!!!
log("Testing that the middleware logs something...");
// This will only work in a postprocessing MW
if (session.meta_data) {
log("Got a session.meta_data object!!!");
}
// Need to return request and session metadata
return insertVersionMiddleware.ReturnData(request, session.meta_data);
});
// Ensure init with a post-declaration log message
log("insertVersion middleware initialised");
{
"api_model":{
},
"key_id":"559f87d8ad28b60f43000001db711b12fa07421475a699bbb35128e7",
"data":{
"last_check":0,
"allowance":0,
"rate":0,
"per":0,
"expires":0,
"quota_max":0,
"quota_renews":1436800548,
"quota_remaining":0,
"quota_renewal_rate":0,
"access_rights":{
"714007cd6f1347906a9218a0a7ad2213":{
"api_name":"Catalogue Service",
"api_id":"714007cd6f1347906a9218a0a7ad2213",
"versions":[
"v1",
"Default"
],
"allowed_urls":[
]
}
},
"org_id":"559f87d8ad28b60f43000001",
"oauth_client_id":"",
"basic_auth_data":{
"password":""
},
"hmac_enabled":false,
"hmac_string":"",
"is_inactive":false,
"apply_policy_id":"55a3d15cad28b613e2000004",
"monitor":{
"trigger_limits":null
},
"meta_data":null
}
}
f {_id: "55a3d15cad28b613e2000004", id: "", org_id: "559f87d8ad28b60f43000001", rate: 1000, per: 60…}$promise: Objectcatch: (a){return this.then(null,a)}finally: (a){function b(a,c){var d=e();c?d.resolve(a):d.reject(a);return d.promise}function d(e,f){var h=null;try{h=(a||c)()}catch(g){return b(g,!1)}return h&&D(h.then)?h.then(function(){return b(e,f)},function(a){return b(a,!1)}):then: (b,f,h){var l=e(),H=function(d){try{l.resolve((D(b)?__proto__: Object$resolved: true_id: "55a3d15cad28b613e2000004"access_rights: Object714007cd6f1347906a9218a0a7ad2213: Objectallowed_urls: Array[0]length: 0__proto__: Array[0]concat: concat() { [native code] }constructor: Array() { [native code] }entries: entries() { [native code] }every: every() { [native code] }filter: filter() { [native code] }forEach: forEach() { [native code] }indexOf: indexOf() { [native code] }join: join() { [native code] }keys: keys() { [native code] }lastIndexOf: lastIndexOf() { [native code] }length: 0map: map() { [native code] }pop: pop() { [native code] }push: push() { [native code] }reduce: reduce() { [native code] }reduceRight: reduceRight() { [native code] }reverse: reverse() { [native code] }shift: shift() { [native code] }slice: slice() { [native code] }some: some() { [native code] }sort: sort() { [native code] }splice: splice() { [native code] }toLocaleString: toLocaleString() { [native code] }toString: toString() { [native code] }unshift: unshift() { [native code] }Symbol(Symbol.iterator): ArrayValues() { [native code] }Symbol(Symbol.unscopables): Object__proto__: Objectapi_id: "714007cd6f1347906a9218a0a7ad2213"api_name: "Catalogue Service"versions: Array[2]0: "v1"1: "Default"length: 2__proto__: Array[0]concat: concat() { [native code] }constructor: Array() { [native code] }entries: entries() { [native code] }every: every() { [native code] }filter: filter() { [native code] }forEach: forEach() { [native code] }indexOf: indexOf() { [native code] }join: join() { [native code] }keys: keys() { [native code] }lastIndexOf: lastIndexOf() { [native code] }length: 0map: map() { [native code] }pop: pop() { [native code] }push: push() { [native code] }reduce: reduce() { [native code] }reduceRight: reduceRight() { [native code] }reverse: reverse() { [native code] }shift: shift() { [native code] }slice: slice() { [native code] }some: some() { [native code] }sort: sort() { [native code] }splice: splice() { [native code] }toLocaleString: toLocaleString() { [native code] }toString: toString() { [native code] }unshift: unshift() { [native code] }Symbol(Symbol.iterator): ArrayValues() { [native code] }Symbol(Symbol.unscopables): Object__proto__: Object__proto__: Object__defineGetter__: __defineGetter__() { [native code] }__defineSetter__: __defineSetter__() { [native code] }__lookupGetter__: __lookupGetter__() { [native code] }__lookupSetter__: __lookupSetter__() { [native code] }constructor: Object() { [native code] }hasOwnProperty: hasOwnProperty() { [native code] }isPrototypeOf: isPrototypeOf() { [native code] }propertyIsEnumerable: propertyIsEnumerable() { [native code] }toLocaleString: toLocaleString() { [native code] }toString: toString() { [native code] }valueOf: valueOf() { [native code] }get __proto__: __proto__() { [native code] }set __proto__: __proto__() { [native code] }__proto__: Objectactive: truedate_created: "0001-01-01T00:00:00Z"hmac_enabled: falseid: ""is_inactive: falsename: "Default"org_id: "559f87d8ad28b60f43000001"per: 60quota_max: -1quota_renewal_rate: 60rate: 1000__proto__: f
INFO[24175] Setting ORGID
WARN[24175] map[]
[96 ms] 301 '/559f87d8ad28b60f43000001/portal/login'
INFO[24175] Setting ORGID
WARN[24175] map[]
[1195 μs] 200 '/559f87d8ad28b60f43000001/portal/member/'
INFO[24177] Setting ORGID
WARN[24177] map[]
[6 ms] 200 '/559f87d8ad28b60f43000001/portal/apis/'
INFO[24179] Setting ORGID
WARN[24179] map[]
[2 ms] 200 '/559f87d8ad28b60f43000001/portal/member/apis/714007cd6f1347906a9218a0a7ad2213/request'
INFO[24181] Setting ORGID
WARN[24181] map[]
[4 ms] 200 '/559f87d8ad28b60f43000001/portal/member/apis/714007cd6f1347906a9218a0a7ad2213/request'
WARN[24188] USING SORT: approved
[1052 μs] 200 '/api/portal/requests'
[812 μs] 200 '/api/portal/requests/55a3da49ad28b613e2000007'
[744 μs] 200 '/api/portal/catalogue'
[2 ms] 200 '/api/portal/developers/559ff023ad28b60f43000007'
[12 ms] 200 '/api/portal/requests/approve/55a3da49ad28b613e2000007'
DEBU[12181] Getting raw gkey set: tyk-system-analytics
DEBU[12181] keyName is: tyk-system-analytics
DEBU[12181] Input key was: analytics-tyk-system-analytics
DEBU[12181] Fixed keyname is: analytics-tyk-system-analytics
DEBU[12181] Returned: []
DEBU[12182] [STORE] Getting WAS: 559f87d8ad28b60f43000001
DEBU[12182] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[12182] [STORE] Getting: orgkey.559f87d8ad28b60f43000001
DEBU[12182] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[12182] Error trying to get value:redigo: nil returned
DEBU[12182] Key does not exist
DEBU[12182] [STORE] Getting WAS: 559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Input key was: apikey-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] [STORE] Getting: apikey-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Input key was: apikey-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Session has policy, checking
DEBU[12182] [RATELIMIT] Inbound raw key is: 559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] [RATELIMIT] Rate limiter key is: rate-limit-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Incrementing raw key: rate-limit-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] keyName is: rate-limit-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Now is:2015-07-13 15:46:40.046585085 +0100 BST
DEBU[12182] Then is: 2015-07-13 15:46:40.046585085 +0100 BST
DEBU[12182] Returned: 0
DEBU[12182] Num Requests: 0
DEBU[12182] [STORE] SET Raw key is: 559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Input key was: apikey-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] [STORE] Setting key: apikey-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] Input key was: apikey-559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f
DEBU[12182] SessionState: {0 0 0 0 0 0 1436798071 0 0 map[714007cd6f1347906a9218a0a7ad2213:{Catalogue Service 714007cd6f1347906a9218a0a7ad2213 [v1] []}] 559f87d8ad28b60f43000001 {} false false 55a3ba99ad28b613e2000002 0 {[]} <nil>}
INFO[12182] Key rate limit exceeded. key=559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f origin=127.0.0.1:54776 path=/714007cd6f1347906a9218a0a7ad2213/v1/catalogues
DEBU[12182] Returning error header
DEBU[12182] EVENT FIRED
DEBU[12182] Adding Healthcheck to: 714007cd6f1347906a9218a0a7ad2213.Throttle.1436798800048583236
DEBU[12182] Adding Healthcheck to: 714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436798800048671836
DEBU[12182] [STORE] SET Raw key is: 714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436798800048671836
DEBU[12182] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436798800048671836
DEBU[12182] [STORE] Setting key: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436798800048671836
DEBU[12182] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436798800048671836
DEBU[12182] [STORE] SET Raw key is: 714007cd6f1347906a9218a0a7ad2213.Throttle.1436798800048583236
DEBU[12182] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436798800048583236
DEBU[12182] [STORE] Setting key: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436798800048583236
DEBU[12182] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436798800048583236
DEBU[12182] Pushing to raw key set: tyk-system-analytics
DEBU[12182] Input key was: analytics-tyk-system-analytics
DEBU[12182] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436798800048583236
DEBU[12182] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436798800048671836
DEBU[12191] Getting raw gkey set: tyk-system-analytics
DEBU[12191] keyName is: tyk-system-analytics
DEBU[12191] Input key was: analytics-tyk-system-analytics
DEBU[12191] Fixed keyname is: analytics-tyk-system-analytics
DEBU[12191] Returned: [[222 0 18 166 65 80 73 75 101 121 217 56 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49 52 99 51 99 57 49 100 49 100 56 102 50 52 52 50 49 55 100 97 55 48 100 98 49 51 100 100 98 102 102 54 102 164 80 97 116 104 174 47 118 49 47 99 97 116 97 108 111 103 117 101 115 165 77 111 110 116 104 7 172 82 101 115 112 111 110 115 101 67 111 100 101 209 1 173 167 65 80 73 78 97 109 101 177 67 97 116 97 108 111 103 117 101 32 83 101 114 118 105 99 101 165 65 80 73 73 68 217 32 55 49 52 48 48 55 99 100 54 102 49 51 52 55 57 48 54 97 57 50 49 56 97 48 97 55 97 100 50 50 49 51 163 68 97 121 13 173 67 111 110 116 101 110 116 76 101 110 103 116 104 0 164 89 101 97 114 209 7 223 164 72 111 117 114 15 165 79 114 103 73 68 184 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49 171 82 101 113 117 101 115 116 84 105 109 101 0 166 77 101 116 104 111 100 163 71 69 84 169 84 105 109 101 83 116 97 109 112 146 210 85 163 207 80 210 2 225 66 241 170 65 80 73 86 101 114 115 105 111 110 162 118 49 167 79 97 117 116 104 73 68 160 168 69 120 112 105 114 101 65 116 146 211 0 0 0 1 17 155 237 80 210 2 225 101 77 169 85 115 101 114 65 103 101 110 116 171 99 117 114 108 47 55 46 51 55 46 49]]
DEBU[12191] Decoded Record: {GET /v1/catalogues 0 curl/7.37.1 13 July 2015 15 429 559f87d8ad28b60f430000014c3c91d1d8f244217da70db13ddbff6f 2015-07-13 15:46:40.048317169 +0100 BST v1 Catalogue Service 714007cd6f1347906a9218a0a7ad2213 559f87d8ad28b60f43000001 0 2115-06-19 14:46:40.048325965 +0000 GMT}
tyk]$ sudo ./tyk --conf=tyk.conf --debug
INFO[0000] Using tyk.conf for configuration
INFO[0000] Setting up analytics DB connection
INFO[0000] Using MongoDB cache purge
INFO[0000] Connecting to redis on: localhost:6379
WARN[0000] Notifier will not work in hybrid mode
INFO[0000] Connecting to redis on: localhost:6379
DEBU[0000] Enabling debug-level output
INFO[0000] Listening on port: 8080
INFO[0000] Initialising default org store
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Listening on [::]:8080
INFO[0000] Using App Configuration from Mongo DB
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Subscription started: tyk.cluster.notifications
DEBU[0000] INITIALISING EVENT HANDLERS
INFO[0000] Checking for transform paths...
INFO[0000] Checking for transform paths...
INFO[0000] Checking for transform paths...
INFO[0000] Checking for transform paths...
INFO[0000] Loading API configurations.
INFO[0000] Loading API Spec for: Catalogue Service
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Health Checker initialised.
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Loading Middleware
INFO[0000] Loading custom POST-PROCESSOR middleware: insertVersion
INFO[0000] Loading JS File: middleware/insertVersion.js
INFO[0000] JSVM LOG: insertVersion middleware initialised
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Loading policies
INFO[0000] No policy record name defined, skipping...
DEBU[0028] [STORE] Getting WAS: 559f87d8ad28b60f43000001
DEBU[0028] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[0028] [STORE] Getting: orgkey.559f87d8ad28b60f43000001
DEBU[0028] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[0028] Error trying to get value:redigo: nil returned
DEBU[0028] Key does not exist
DEBU[0028] Upstream request took (ms): 13.598332
DEBU[0028] Pushing to raw key set: tyk-system-analytics
DEBU[0028] Input key was: analytics-tyk-system-analytics
DEBU[0028] Adding Healthcheck to: 714007cd6f1347906a9218a0a7ad2213.Request.1436786451697534463
DEBU[0028] [STORE] SET Raw key is: 714007cd6f1347906a9218a0a7ad2213.Request.1436786451697534463
DEBU[0028] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436786451697534463
DEBU[0028] [STORE] Setting key: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436786451697534463
DEBU[0028] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436786451697534463
DEBU[0028] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436786451697534463
DEBU[0030] Getting raw gkey set: tyk-system-analytics
DEBU[0030] keyName is: tyk-system-analytics
DEBU[0030] Input key was: analytics-tyk-system-analytics
DEBU[0030] Fixed keyname is: analytics-tyk-system-analytics
DEBU[0030] Returned: [[222 0 18 166 77 101 116 104 111 100 163 71 69 84 163 68 97 121 13 169 84 105 109 101 83 116 97 109 112 146 210 85 163 159 19 210 41 131 13 236 165 65 80 73 73 68 217 32 55 49 52 48 48 55 99 100 54 102 49 51 52 55 57 48 54 97 57 50 49 56 97 48 97 55 97 100 50 50 49 51 165 77 111 110 116 104 7 165 79 114 103 73 68 184 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49 171 82 101 113 117 101 115 116 84 105 109 101 13 167 79 97 117 116 104 73 68 160 168 69 120 112 105 114 101 65 116 146 211 0 0 0 1 17 155 189 19 210 41 133 213 3 164 80 97 116 104 174 47 118 49 47 99 97 116 97 108 111 103 117 101 115 164 72 111 117 114 12 166 65 80 73 75 101 121 160 170 65 80 73 86 101 114 115 105 111 110 162 118 49 167 65 80 73 78 97 109 101 177 67 97 116 97 108 111 103 117 101 32 83 101 114 118 105 99 101 173 67 111 110 116 101 110 116 76 101 110 103 116 104 0 169 85 115 101 114 65 103 101 110 116 171 99 117 114 108 47 55 46 51 55 46 49 164 89 101 97 114 209 7 223 172 82 101 115 112 111 110 115 101 67 111 100 101 209 0 200]]
DEBU[0030] Decoded Record: {GET /v1/catalogues 0 curl/7.37.1 13 July 2015 12 200 2015-07-13 12:20:51.696454636 +0100 BST v1 Catalogue Service 714007cd6f1347906a9218a0a7ad2213 559f87d8ad28b60f43000001 13 2115-06-19 11:20:51.696636675 +0000 GMT}
WARN[1998] Tracked quota reset for key: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Setting: quota-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] SET Raw key is: quota-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-quota-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] Setting key: apikey-quota-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-quota-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] SET Raw key is: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] Setting key: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
INFO[1998] Generated new key - success. key=559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] Getting WAS: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] Getting: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
INFO[1998] Attempted key retrieval - success. key=559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] Getting WAS: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] [STORE] Getting: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[1998] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
INFO[1998] Attempted key retrieval - success. key=559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2000] Getting raw gkey set: tyk-system-analytics
DEBU[2000] keyName is: tyk-system-analytics
DEBU[2000] Input key was: analytics-tyk-system-analytics
DEBU[2000] Fixed keyname is: analytics-tyk-system-analytics
DEBU[2000] Returned: []
DEBU[2010] Getting raw gkey set: tyk-system-analytics
DEBU[2010] keyName is: tyk-system-analytics
DEBU[2010] Input key was: analytics-tyk-system-analytics
DEBU[2010] Fixed keyname is: analytics-tyk-system-analytics
DEBU[2010] Returned: []
DEBU[2020] Getting raw gkey set: tyk-system-analytics
DEBU[2020] keyName is: tyk-system-analytics
DEBU[2020] Input key was: analytics-tyk-system-analytics
DEBU[2020] Fixed keyname is: analytics-tyk-system-analytics
DEBU[2020] Returned: []
DEBU[2030] Getting raw gkey set: tyk-system-analytics
DEBU[2030] keyName is: tyk-system-analytics
DEBU[2030] Input key was: analytics-tyk-system-analytics
DEBU[2030] Fixed keyname is: analytics-tyk-system-analytics
DEBU[2030] Returned: []
DEBU[2039] [STORE] Getting WAS: 559f87d8ad28b60f43000001
DEBU[2039] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[2039] [STORE] Getting: orgkey.559f87d8ad28b60f43000001
DEBU[2039] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[2039] Error trying to get value:redigo: nil returned
DEBU[2039] Key does not exist
DEBU[2039] [STORE] Getting WAS: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] [STORE] Getting: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Session has policy, checking
DEBU[2039] [RATELIMIT] Inbound raw key is: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] [RATELIMIT] Rate limiter key is: rate-limit-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Incrementing raw key: rate-limit-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] keyName is: rate-limit-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Now is:2015-07-13 16:34:23.713760036 +0100 BST
DEBU[2039] Then is: 2015-07-13 16:34:23.713760036 +0100 BST
DEBU[2039] Returned: 0
DEBU[2039] Num Requests: 0
DEBU[2039] [STORE] SET Raw key is: 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] [STORE] Setting key: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] Input key was: apikey-559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22
DEBU[2039] SessionState: {0 0 0 0 0 0 1436801622 0 0 map[714007cd6f1347906a9218a0a7ad2213:{Catalogue Service 714007cd6f1347906a9218a0a7ad2213 [v1 Default] []}] 559f87d8ad28b60f43000001 {} false false 55a3d15cad28b613e2000004 0 {[]} <nil>}
INFO[2039] Key rate limit exceeded. key=559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22 origin=127.0.0.1:54870 path=/714007cd6f1347906a9218a0a7ad2213/v1/catalogues
DEBU[2039] Returning error header
DEBU[2039] EVENT FIRED
DEBU[2039] Adding Healthcheck to: 714007cd6f1347906a9218a0a7ad2213.Throttle.1436801663715350567
DEBU[2039] Adding Healthcheck to: 714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436801663715445083
DEBU[2039] [STORE] SET Raw key is: 714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436801663715445083
DEBU[2039] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436801663715445083
DEBU[2039] [STORE] Setting key: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436801663715445083
DEBU[2039] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436801663715445083
DEBU[2039] [STORE] SET Raw key is: 714007cd6f1347906a9218a0a7ad2213.Throttle.1436801663715350567
DEBU[2039] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436801663715350567
DEBU[2039] [STORE] Setting key: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436801663715350567
DEBU[2039] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436801663715350567
DEBU[2039] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.BlockedRequest.1436801663715445083
DEBU[2039] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Throttle.1436801663715350567
DEBU[2039] Pushing to raw key set: tyk-system-analytics
DEBU[2039] Input key was: analytics-tyk-system-analytics
DEBU[2040] Getting raw gkey set: tyk-system-analytics
DEBU[2040] keyName is: tyk-system-analytics
DEBU[2040] Input key was: analytics-tyk-system-analytics
DEBU[2040] Fixed keyname is: analytics-tyk-system-analytics
DEBU[2040] Returned: [[222 0 18 167 65 80 73 78 97 109 101 177 67 97 116 97 108 111 103 117 101 32 83 101 114 118 105 99 101 164 72 111 117 114 16 172 82 101 115 112 111 110 115 101 67 111 100 101 209 1 173 170 65 80 73 86 101 114 115 105 111 110 162 118 49 164 80 97 116 104 174 47 118 49 47 99 97 116 97 108 111 103 117 101 115 173 67 111 110 116 101 110 116 76 101 110 103 116 104 0 169 85 115 101 114 65 103 101 110 116 171 99 117 114 108 47 55 46 51 55 46 49 165 65 80 73 73 68 217 32 55 49 52 48 48 55 99 100 54 102 49 51 52 55 57 48 54 97 57 50 49 56 97 48 97 55 97 100 50 50 49 51 167 79 97 117 116 104 73 68 160 171 82 101 113 117 101 115 116 84 105 109 101 0 168 69 120 112 105 114 101 65 116 146 211 0 0 0 1 17 155 248 127 210 42 151 139 238 166 77 101 116 104 111 100 163 71 69 84 163 68 97 121 13 164 89 101 97 114 209 7 223 165 79 114 103 73 68 184 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49 165 77 111 110 116 104 7 166 65 80 73 75 101 121 217 56 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49 97 53 57 101 57 98 55 53 52 101 99 99 52 100 53 48 54 49 54 57 53 98 50 48 55 54 54 98 102 99 50 50 169 84 105 109 101 83 116 97 109 112 146 210 85 163 218 127 210 42 151 120 93]]
DEBU[2040] Decoded Record: {GET /v1/catalogues 0 curl/7.37.1 13 July 2015 16 429 559f87d8ad28b60f43000001a59e9b754ecc4d5061695b20766bfc22 2015-07-13 16:34:23.714569821 +0100 BST v1 Catalogue Service 714007cd6f1347906a9218a0a7ad2213 559f87d8ad28b60f43000001 0 2115-06-19 15:34:23.71457483 +0000 GMT}
[vagrant@tyk tyk]$ sudo ./tyk --conf=tyk.conf --debug
INFO[0000] Using tyk.conf for configuration
INFO[0000] Setting up analytics DB connection
INFO[0000] Using MongoDB cache purge
INFO[0000] Connecting to redis on: localhost:6379
WARN[0000] Notifier will not work in hybrid mode
INFO[0000] Connecting to redis on: localhost:6379
DEBU[0000] Enabling debug-level output
INFO[0000] Listening on port: 8080
INFO[0000] Initialising default org store
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Listening on [::]:8080
INFO[0000] Using App Configuration from Mongo DB
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Subscription started: tyk.cluster.notifications
DEBU[0000] INITIALISING EVENT HANDLERS
INFO[0000] Checking for transform paths...
INFO[0000] Checking for transform paths...
INFO[0000] Checking for transform paths...
INFO[0000] Checking for transform paths...
INFO[0000] Loading API configurations.
INFO[0000] Loading API Spec for: Catalogue Service
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Health Checker initialised.
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Loading Middleware
INFO[0000] Loading custom POST-PROCESSOR middleware: insertVersion
INFO[0000] Loading JS File: middleware/insertVersion.js
INFO[0000] JSVM LOG: insertVersion middleware initialised
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Rate limits available at: /714007cd6f1347906a9218a0a7ad2213/tyk/rate-limits/
INFO[0000] Loading policies
INFO[0000] Using Policies from Mongo DB
DEBU[0000] Searching in collection: tyk_policies
INFO[0000] Policies found: 1
DEBU[0000] Processing policy ID: 55a3d15cad28b613e2000004
DEBU[0008] [STORE] Getting WAS: 559f87d8ad28b60f43000001
DEBU[0008] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[0008] [STORE] Getting: orgkey.559f87d8ad28b60f43000001
DEBU[0008] Input key was: orgkey.559f87d8ad28b60f43000001
DEBU[0008] Error trying to get value:redigo: nil returned
DEBU[0008] Key does not exist
DEBU[0008] [STORE] Getting WAS: 559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Input key was: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] [STORE] Getting: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Input key was: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Session has policy, checking
DEBU[0008] Found policy, applying
DEBU[0008] [STORE] SET Raw key is: 559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Input key was: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] [STORE] Setting key: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Input key was: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Policy applied to key
DEBU[0008] [RATELIMIT] Inbound raw key is: 559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] [RATELIMIT] Rate limiter key is: rate-limit-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Incrementing raw key: rate-limit-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] keyName is: rate-limit-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Now is:2015-07-14 09:24:12.801914371 +0100 BST
DEBU[0008] Then is: 2015-07-14 09:23:12.801914371 +0100 BST
DEBU[0008] Returned: 0
DEBU[0008] Num Requests: 0
DEBU[0008] [STORE] SET Raw key is: 559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Input key was: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] [STORE] Setting key: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] Input key was: apikey-559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f
DEBU[0008] SessionState: {0 999 1000 60 0 -1 1436861992 0 60 map[714007cd6f1347906a9218a0a7ad2213:{Catalogue Service 714007cd6f1347906a9218a0a7ad2213 [v1 Default] []}] 559f87d8ad28b60f43000001 {} false false 55a3d15cad28b613e2000004 0 {[]} <nil>}
DEBU[0008] No allowed URLS
ERRO[0008] Failed to decode middleware request data on return from VM: invalid character 'u' looking for beginning of value
INFO[0008] undefined
DEBU[0008] Upstream request took (ms): 5.581263
DEBU[0008] Pushing to raw key set: tyk-system-analytics
DEBU[0008] Input key was: analytics-tyk-system-analytics
DEBU[0008] Adding Healthcheck to: 714007cd6f1347906a9218a0a7ad2213.Request.1436862252810232413
DEBU[0008] [STORE] SET Raw key is: 714007cd6f1347906a9218a0a7ad2213.Request.1436862252810232413
DEBU[0008] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436862252810232413
DEBU[0008] [STORE] Setting key: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436862252810232413
DEBU[0008] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436862252810232413
DEBU[0008] Input key was: apihealth.714007cd6f1347906a9218a0a7ad2213.Request.1436862252810232413
INFO[0010] Not connected to analytics store, connecting...
DEBU[0010] Getting raw gkey set: tyk-system-analytics
DEBU[0010] keyName is: tyk-system-analytics
DEBU[0010] Input key was: analytics-tyk-system-analytics
DEBU[0010] Fixed keyname is: analytics-tyk-system-analytics
DEBU[0010] Returned: [[222 0 18 164 80 97 116 104 174 47 118 49 47 99 97 116 97 108 111 103 117 101 115 172 82 101 115 112 111 110 115 101 67 111 100 101 209 0 200 166 65 80 73 75 101 121 217 56 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49 48 102 48 97 53 99 52 57 52 57 99 56 52 52 48 54 54 100 56 51 56 97 57 53 51 55 99 56 56 56 51 102 168 69 120 112 105 114 101 65 116 146 211 0 0 0 1 17 156 229 44 210 48 61 229 45 173 67 111 110 116 101 110 116 76 101 110 103 116 104 0 165 77 111 110 116 104 7 164 89 101 97 114 209 7 223 164 72 111 117 114 9 170 65 80 73 86 101 114 115 105 111 110 162 118 49 165 65 80 73 73 68 217 32 55 49 52 48 48 55 99 100 54 102 49 51 52 55 57 48 54 97 57 50 49 56 97 48 97 55 97 100 50 50 49 51 167 79 97 117 116 104 73 68 160 171 82 101 113 117 101 115 116 84 105 109 101 5 166 77 101 116 104 111 100 163 71 69 84 169 85 115 101 114 65 103 101 110 116 171 99 117 114 108 47 55 46 51 55 46 49 163 68 97 121 14 169 84 105 109 101 83 116 97 109 112 146 210 85 164 199 44 210 48 61 198 100 167 65 80 73 78 97 109 101 177 67 97 116 97 108 111 103 117 101 32 83 101 114 118 105 99 101 165 79 114 103 73 68 184 53 53 57 102 56 55 100 56 97 100 50 56 98 54 48 102 52 51 48 48 48 48 48 49]]
DEBU[0010] Decoded Record: {GET /v1/catalogues 0 curl/7.37.1 14 July 2015 9 200 559f87d8ad28b60f430000010f0a5c4949c844066d838a9537c8883f 2015-07-14 09:24:12.809354852 +0100 BST v1 Catalogue Service 714007cd6f1347906a9218a0a7ad2213 559f87d8ad28b60f43000001 5 2115-06-20 08:24:12.809362733 +0000 GMT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment