Skip to content

Instantly share code, notes, and snippets.

View asoorm's full-sized avatar

Ahmet Soormally asoorm

View GitHub Profile
$ hey -c 20 -n 100000 http://localhost:8181/tyk-quickstart/
Summary:
Total: 14.4533 secs
Slowest: 0.8117 secs
Fastest: 0.0003 secs
Average: 0.0028 secs
Requests/sec: 6918.8426
Total data: 2000000 bytes
@asoorm
asoorm / preBodyToHeaders.js
Created July 31, 2018 20:46
jsvm - read xml request body, and pass credentials to b64 encoded Authorization header
marknote=function(){};marknote.constants={DOCTYPE_START:"<!DOCTYPE",CDATA_START:"<![CDATA[",CDATA_END:"]]>",COMMENT_START:"<!--",COMMENT_END:"-->",TAG_OPEN:"<",TAG_CLOSE:">",TAG_CLOSE_SELF_TERMINATING:"/>",ENDTAG_OPEN:"</",EQUALS:"=",SQUOTE:"'",DQUOTE:'"',PI_START:"<?",PI_END:"?>",BRACKET_OPEN:"[",BRACKET_CLOSE:"]",TOKENTYPE_BRACKET_OPEN:"bracketOpen",TOKENTYPE_TAG_OPEN:"tagOpen",TOKENTYPE_TAG_CLOSE:"tagClose",TOKENTYPE_ENDTAG_OPEN:"endTagOpen",TOKENTYPE_ENDTAG_CLOSE:"endTagClose",TOKENTYPE_SELF_TERMINATING:"closeTagSelfTerminating",TOKENTYPE_WHITESPACE:"whitespace",TOKENTYPE_ATTRIBUTE:"attribute",TOKENTYPE_QUOTE:"quote",TOKENTYPE_QUOTED:"quotedLiteral",TOKENTYPE_NORMAL:"normal",TOKENTYPE_COMMENT_START:"commentStart",TOKENTYPE_COMMENT_END:"commentEnd",TOKENTYPE_CDATA_START:"cdataStart",TOKENTYPE_CDATA_END:"cdataEnd",TOKENTYPE_PI_START:"piStart",TOKENTYPE_PI_END:"piEnd",TOKENTYPE_DOCTYPE_START:"docTypeStart",DATATYPE_ATTRIBUTE:"marknote.Attribute",DATATYPE_CDATA:"marknote.CDATA",DATATYPE_CLONER:"marknote.Clone
enable:
type: boolean
description: Enable or disable CORS middleware
example: true
allowed_origins:
type: array
description: A list of origin domains to allow access from
example: ["foo.com", "bar.com"]
@asoorm
asoorm / leaseholder_servicecharges.md
Created April 9, 2018 19:06
Leaseholder Service Charges - request template

Email: contactus@thh.org.uk Subject: Flat X: Leaseholder service charges detailed breakdown

Dear Sir / Madam

I am writing to request you send me an email / postal copy of a detailed breakdown of my service charges & estate repairs for 2015/2016 & 2016/2017 please?

With thanks

@asoorm
asoorm / docker-compose.yaml
Created March 26, 2018 21:12
example tyk-ce docker-compose.yaml file
version: '3'
services:
redis:
image: redis:latest
volumes:
- ./redis-data:/data
networks:
- tyk-ce
{
"api_id": "74ae1c83389e461c6fed419fa6a678d2",
"upstream_certificates": {},
"use_keyless": false,
"enable_coprocess_auth": false,
"custom_middleware": {
"pre": [],
"post": [],
"post_key_auth": [],
"auth_check": {
@asoorm
asoorm / session-token.json
Created March 4, 2018 12:05
Example Tyk CE session token
{
"allowance": 1000,
"rate": 1000,
"per": 60,
"expires": -1,
"quota_max": -1,
"quota_renews": 1406121006,
"quota_remaining": 0,
"quota_renewal_rate": 60,
"access_rights": {
@asoorm
asoorm / protected.json
Created March 4, 2018 12:04
Example Auth-Token Protected API Definition for Tyk API Gateway
{
"name": "AuthToken HttpBin",
"api_id": "1",
"org_id": "default",
"auth": {
"auth_header_name": "Authorization"
},
"version_data": {
"not_versioned": true,
"versions": {
@asoorm
asoorm / keyless.json
Created March 4, 2018 12:00
Example Keyless Tyk Gateway API Definition
{
"name": "Keyless HttpBin",
"api_id": "1",
"org_id": "default",
"use_keyless": true,
"auth": {
"auth_header_name": ""
},
"version_data": {
"not_versioned": true,
@asoorm
asoorm / path-match-with-regex.json
Created February 22, 2018 09:59
Tyk API Definition - Path Match With Regex
{
"name": "Path Match with Regex",
"active": true,
"api_id": "1",
"org_id": "1",
"slug": "path-match-with-regex",
"definition": {
"location": "",
"key": ""
},