Skip to content

Instantly share code, notes, and snippets.

View asoorm's full-sized avatar

Ahmet Soormally asoorm

View GitHub Profile
{
"api_id": "74ae1c83389e461c6fed419fa6a678d2",
"upstream_certificates": {},
"use_keyless": false,
"enable_coprocess_auth": false,
"custom_middleware": {
"pre": [],
"post": [],
"post_key_auth": [],
"auth_check": {
@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
@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

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 / 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
$ 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 / api_definition_preTransformContentType.json
Last active April 25, 2023 17:21
Tyk Gateway JSVM middleware to inspect the Content-Type Header, and if matches, transform it to something else.
{
"id": "5b6973533f03d3608d46cf8c",
"name": "httpbin",
"slug": "httpbin",
"api_id": "e69126ef8100421c4c81b9982b51eb80",
"org_id": "5b296ceb3f03d310fffc9b9d",
"use_keyless": true,
"use_oauth2": false,
"use_openid": false,
"openid_options": {
@asoorm
asoorm / docker-compose-mongo-replicaset.yml
Created September 14, 2018 19:00
Mongo Replica Set docker compose
version: "3"
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo:4.0-xenial
expose:
- 27017
ports:
- 27011:27017
@asoorm
asoorm / bench_script.sh
Created January 26, 2019 09:37
tyk gateway simple bench script
sudo systemctl enable docker
docker network create tyk
docker run -itd --name redis --restart on-failure --network tyk redis:5.0-alpine
# this is the upstream server that tyk will reverse proxy to
docker run -itd --name nginx --restart on-failure --network tyk nginx:1.15.8-alpine
mkdir apidefs

Keybase proof

I hereby claim:

  • I am asoorm on github.
  • I am asoorm (https://keybase.io/asoorm) on keybase.
  • I have a public key ASBhBNyXlsO6o8K7TTNTF7JPmAOgoeaulgQuRyBTTCUq1Ao

To claim this, I am signing this object: