lohxx / tyk-gateway-poc

Poc to test the tyk gateway features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poc para testar os recursos do gateway tyk

Configurar

Para configurar esta poc, seu ambiente precisa ter os seguintes requisitos: 1. docker 2. docker-compose

Para iniciar a execução dos contêineres: docker compose up.

Configurar APIs tyk.

Para interagir com nossa mock api é necessário criá-la no tyk, para isso basta executar o script python: python utils.py setupapi.

Este script criará uma API chamada test e imprimirá as chaves que você pode usar para fazer chamadas.

python utils.py setupapi
usuário criado, chave: 1caf9578da40e41bbb20cc34895932f56
usuário criado, chave: 15f48e1b975284942a02e7c94eba27159

Fazendo chamadas

curl 'http://localhost:8080/test/' -H 'Authorization: Basic 15f48e1b975284942a02e7c94eba27159'
curl 'http://localhost:8080/test/' -H 'Authorization: Bearer 15f48e1b975284942a02e7c94eba27159'
curl 'http://localhost:8080/test/?api_key=1caf9578da40e41bbb20cc34895932f56'

Testes quota e rate limit

Para testar o limite de taxa configurado, chame o comando cli python utils.py callsratelimit.

Para testar as cotas configuradas, chame o comando cli python utils.py callsquota

About

Poc to test the tyk gateway features


Languages

Language:Python 95.3%Language:Dockerfile 4.7%