├── .gitattributes ├── KONG-Persian-doc.docx ├── KONG-Plugins-List.txt ├── LICENSE ├── README.md ├── images ├── ACL │ ├── 0.JPG │ ├── 1.JPG │ ├── 10.JPG │ ├── 11.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── 6.JPG │ ├── 7.JPG │ ├── 8.JPG │ └── 9.JPG ├── Basic-authentication │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── 6.JPG │ ├── 7.JPG │ ├── 8.JPG │ ├── consumer 2.JPG │ └── consumer.JPG ├── Bot-Detection │ ├── 0.JPG │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ └── 5.JPG ├── IP-restriction │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── Plugin.JPG │ └── service-runnig.JPG ├── Key-Auth │ ├── 0.JPG │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4-5.JPG │ ├── 4.JPG │ ├── 5.JPG │ └── 6.JPG ├── Proxy-caching │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── 6.JPG │ ├── 7.JPG │ ├── 8.JPG │ └── 9.JPG ├── Rate-Limiter │ ├── 0.JPG │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── 6.JPG │ ├── 7.JPG │ └── 8.JPG ├── Request-Size-Limiting │ ├── 0.JPG │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ └── 5.JPG ├── Request-termination │ ├── 1-second consumer.JPG │ ├── 10.JPG │ ├── 11.JPG │ ├── 12.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── 6.JPG │ ├── 7.JPG │ ├── 8.JPG │ └── 9.JPG └── Response-rate-limiting │ ├── 1.JPG │ ├── 2.JPG │ ├── 3.JPG │ ├── 4.JPG │ ├── 5.JPG │ ├── 6.JPG │ ├── 7.JPG │ ├── 8.JPG │ └── 9.JPG ├── myservice.py ├── myservice2.py └── service.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /KONG-Persian-doc.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/KONG-Persian-doc.docx -------------------------------------------------------------------------------- /KONG-Plugins-List.txt: -------------------------------------------------------------------------------- 1 | Kiarash 2 | 1-IP restriction 3 | 2-basic Auth 4 | 3-request termination 5 | 4-Proxy caching 6 | 5-response rate limiting 7 | request transformer 8 | response transformer 9 | JWT 10 | file log 11 | http log 12 | 13 | 14 | Ahmad 15 | 6-Rate-limiting 16 | 7-bot-detection 17 | 8-requset-size-limiting 18 | 9-key-Auth 19 | 10-ACL 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Kiarash Rahmani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | # Kong-API-Gateway 7 | a simple project that shows how to use kong API Gateway service. 8 | ## Step 1: Docker 9 | download Docker and install it on your system. 10 | ## Step 2: Kong 11 | 12 | ### Pull the Docker image 13 | 14 | ```bash 15 | docker pull kong/kong-gateway:2.7.0.0-alpine 16 | ``` 17 | 18 | 19 | ### Step1: Create a Docker network 20 | 21 | ```bash 22 | docker network create kong-net 23 | ``` 24 | 25 | ### Step2: Start and prepare Postgres DB 26 | 27 | ```bash 28 | docker run -d --name kong-database --network=kong-net -e “POSTGRES_USER=kong” -e “POSTGRES_DB=kong” -e “POSTGRES_PASSWORD=kong” -p 5432:5432 postgres:9.6 29 | ``` 30 | 31 | ```bash 32 | docker run --rm --network=kong-net -e “KONG_DATABASE=postgres” -e “KONG_PG_HOST=kong-database” -e “KONG_PG_PASSWORD=kong” kong:latest kong migrations bootstrap 33 | ``` 34 | 35 | ### Step3: Start kong 36 | 37 | ```bash 38 | docker run -d --name kong --network=kong-net -e “KONG_DATABASE=postgres” -e “KONG_PG_HOST=kong-database” -e “KONG_PG_PASSWORD=kong” -e “KONG_PROXY_ACCESS_LOG=/dev/stdout” -e “KONG_ADMIN_ACCESS_LOG=/dev/stdout” -e “KONG_PROXY_ERROR_LOG=/dev/stderr” -e “KONG_ADMIN_ERROR_LOG=/dev/stderr” -e “KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl” -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444 -p 8002:8002 kong:latest 39 | ``` 40 | ## Step 3: Create a service 41 | In this step, you can use one of the services that I have built (myservice1.py or myservice2.py). Run one of these services locally on your PC. 42 | here is the code of myservice1.py: 43 | ```python 44 | from flask import Flask 45 | 46 | app = Flask(__name__) 47 | 48 | @app.route('/') 49 | def hello(): 50 | return "Hi, I'm service 1" 51 | 52 | if __name__ == '__main__': 53 | app.run(debug=True, host='0.0.0.0',port=5000) 54 | 55 | ``` 56 | When you type ``` http://yourip:5000/``` into your browser's address bar and hit enter, you will see that the service is running successfully. 57 | 58 | 59 | ![Local Image](/images/IP-restriction/service-runnig.JPG) 60 | 61 | *your service is running on port 5000 on your local IP* 62 | ## Step 4: Primary settings 63 | ### Step4-1: Adding your service in Kong 64 | type ``` http://yourip:8002/``` into your browser's address bar and hit enter, you will see the Kong Manager OSS on your browser. 65 | click on Gateway Services on the menu. 66 | add your service information and hit save button. 67 | 68 | #### image of creating service should be added 69 | 70 | ### Step4-2: Adding your route in Kong 71 | 72 | ### Step4-1: Adding your consumer in Kong 73 | 74 | 75 | ## Step 5:Installing plugins 76 | In this section, we guide you through the installation and usage of ten distinct plugins in Kong, providing step-by-step instructions for each 77 | ### Step 5-1: IP restriction plugin 78 | in this step you should go to Plugins section and enable IP Restriction plugin. 79 | 80 | ![Local Image](/images/IP-restriction/1.JPG) 81 | 82 | Please configure your plugin settings as shown in the image below. 83 | 84 | ![Local Image](/images/IP-restriction/2.JPG) 85 | 86 | 87 | ![Local Image](/images/IP-restriction/3.JPG) 88 | 89 | 90 | ![Local Image](/images/IP-restriction/4.JPG) 91 | *Adjust the settings according to your preferences.* 92 | then click on install button. 93 | Upon entering ``` http://yourip:8000/yourservicename``` into your browser's address bar and pressing enter, you will observe that access to the service is restricted for your IP. 94 | 95 | ![Local Image](/images/IP-restriction/5.JPG) 96 | 97 | *your service page* 98 | ### Step 5-2: Basic authentication plugin 99 | in this step you should go to Plugins section and enable Basic Authentication plugin. 100 | 101 | ![Local Image](/images/Basic-authentication/1.JPG) 102 | 103 | Please configure your plugin settings as shown in the image below. 104 | 105 | ![Local Image](/images/Basic-authentication/2.JPG) 106 | 107 | 108 | ![Local Image](/images/Basic-authentication/3.JPG) 109 | 110 | then click on install button. 111 | Once you've activated the plugin, proceed to create a new consumer (as previously explained). 112 | 113 | ![Local Image](/images/Basic-authentication/4.JPG) 114 | 115 | Subsequently, click on your designated consumer and navigate to the credentials section. You will notice the addition of the Basic Authentication section for your consumer. Click on ``` New Basic Auth Credential```. 116 | 117 | ![Local Image](/images/Basic-authentication/5.JPG) 118 | 119 | set a username and password for your consumer then click on create button. 120 | 121 | ![Local Image](/images/Basic-authentication/6.JPG) 122 | 123 | Upon entering ``` http://yourip:8000/yourservicename``` into your browser's address bar and pressing enter, you will observe that you need Username and password for accessing to your service. 124 | 125 | ![Local Image](/images/Basic-authentication/7.JPG) 126 | 127 | Upon entering the accurate username and password, you will gain access to your service content. 128 | 129 | ![Local Image](/images/Basic-authentication/8.JPG) 130 | 131 | ### Step 5-3: Request termination plugin 132 | Firstly, you should create your second consumer(as previously explained). 133 | then you should go to Plugins section and enable Request termination plugin. 134 | 135 | ![Local Image](/images/Request-termination/3.JPG) 136 | 137 | 138 | ![Local Image](/images/Request-termination/4.JPG) 139 | 140 | Please configure your plugin settings as shown in the image below. 141 | 142 | ![Local Image](/images/Request-termination/5.JPG) 143 | 144 | 145 | ![Local Image](/images/Request-termination/6.JPG) 146 | 147 | 148 | ![Local Image](/images/Request-termination/7.JPG) 149 | 150 | then click on install button. 151 | Subsequently, click on your designated consumer and navigate to the credentials section. You will notice the addition of the Basic Authentication section for your consumer. Click on ``` New Basic Auth Credential```. 152 | 153 | ![Local Image](/images/Request-termination/8.JPG) 154 | 155 | 156 | ![Local Image](/images/Request-termination/9.JPG) 157 | 158 | set a username and password for your consumer then click on create button. 159 | 160 | ![Local Image](/images/Request-termination/10.JPG) 161 | 162 | When you correctly input your username and password, you'll sign in. However, a message will be displayed, indicating that your request has been terminated. 163 | 164 | ![Local Image](/images/Request-termination/11.JPG) 165 | 166 | 167 | ![Local Image](/images/Request-termination/12.JPG) 168 | 169 | ### Step 5-4: Proxy caching plugin 170 | In the first step you should go to Plugins section and enable Proxy caching plugin. 171 | 172 | ![Local Image](/images/Proxy-caching/1.JPG) 173 | 174 | 175 | ![Local Image](/images/Proxy-caching/2.JPG) 176 | 177 | Please configure your plugin settings as shown in the image below. 178 | 179 | ![Local Image](/images/Proxy-caching/3.JPG) 180 | 181 | 182 | ![Local Image](/images/Proxy-caching/4.JPG) 183 | 184 | 185 | ![Local Image](/images/Proxy-caching/5.JPG) 186 | 187 | 188 | ![Local Image](/images/Proxy-caching/6.JPG) 189 | 190 | Now, using Thunder Client, or any other preferred service such as Postman, send a GET request to ``` http://yourip:8000/yourservicename```. With the plugin disabled, you should observe that everything is functioning correctly, but there is no evidence of caching, as depicted in the image below. 191 | 192 | ![Local Image](/images/Proxy-caching/7.JPG) 193 | 194 | Now enable your proxy caching plugin from Kong manager. 195 | 196 | ![Local Image](/images/Proxy-caching/7.JPG) 197 | 198 | Upon sending another GET request, you'll notice that the headers now include ``` x-cache-key``` and ```x-cache-status``` . 199 | 200 | ![Local Image](/images/Proxy-caching/9.JPG) 201 | 202 | ### Step 5-5: Response rate limiting plugin 203 | In the first step you should go to Plugins section and enable Response rate limiting plugin. 204 | 205 | ![Local Image](/images/Response-rate-limiting/1.JPG) 206 | 207 | 208 | ![Local Image](/images/Response-rate-limiting/2.JPG) 209 | 210 | Please configure your plugin settings as shown in the image below. 211 | 212 | ![Local Image](/images/Response-rate-limiting/3.JPG) 213 | 214 | 215 | ![Local Image](/images/Response-rate-limiting/4.JPG) 216 | 217 | 218 | ![Local Image](/images/Response-rate-limiting/5.JPG) 219 | 220 | 221 | ![Local Image](/images/Response-rate-limiting/6.JPG) 222 | 223 | 224 | ![Local Image](/images/Response-rate-limiting/7.JPG) 225 | 226 | Now, using Thunder Client, or any other preferred service such as Postman, send a GET request to ``` http://yourip:8000/yourservicename```.You'll notice that the headers now include ```x-ratelimit-limit-first-limit-seconds``` and```x-ratelimit-remaining-first-limit-seconds```. 227 | 228 | ![Local Image](/images/Response-rate-limiting/9.JPG) 229 | 230 | ### Step 5-6: Rate limiting plugin 231 | In the first step you should go to Plugins section and enable Response Rate limiting plugin. 232 | 233 | ![Local Image](/images/Rate-Limiter/1.JPG) 234 | 235 | Please configure your plugin settings as shown in the image below. 236 | ![Local Image](/images/Rate-Limiter/2.JPG) 237 | 238 | 239 | ![Local Image](/images/Rate-Limiter/3.JPG) 240 | 241 | 242 | ![Local Image](/images/Rate-Limiter/4.JPG) 243 | 244 | 245 | ![Local Image](/images/Rate-Limiter/5.JPG) 246 | 247 | 248 | ![Local Image](/images/Rate-Limiter/6.JPG) 249 | 250 | When you enter ``` http://yourip:8000/yourservicename``` in your browser's address bar and hit enter, attempting to exceed the rate limit will result in an error. 251 | 252 | ![Local Image](/images/Rate-Limiter/8.JPG) 253 | 254 | ### Step 5-7: Bot detection plugin 255 | In the first step you should go to Plugins section and enable Bot Detection plugin. 256 | 257 | ![Local Image](/images/Bot-Detection/1.JPG) 258 | 259 | Please configure your plugin settings as shown in the image below. 260 | 261 | ![Local Image](/images/Bot-Detection/2.JPG) 262 | 263 | 264 | ![Local Image](/images/Bot-Detection/3.JPG) 265 | 266 | When an attempt is made to access our service through Google Chrome, the system promptly identifies the user as a bot. Consequently, upon opening Google Chrome and entering ```http://yourip:8000/yourservicename``` into the browser's address bar, an error message explicitly stating "Forbidden" is displayed. This proactive measure plays a crucial role in recognizing and restraining potential automated bot activities. 267 | 268 | ![Local Image](/images/Bot-Detection/5.JPG) 269 | 270 | 271 | ### Step 5-8: Request size limiting plugin 272 | In the first step you should go to Plugins section and enable Request size limiting plugin. 273 | 274 | ![Local Image](/images/Request-Size-Limiting/1.JPG) 275 | 276 | Please configure your plugin settings as shown in the image below. 277 | 278 | ![Local Image](/images/Request-Size-Limiting/2.JPG) 279 | 280 | 281 | ![Local Image](/images/Request-Size-Limiting/3.JPG) 282 | 283 | Use Thunder Client, Postman, or your preferred service to send a GET request to ```http://yourip:8000/yourservicename```, ensuring that it remains within the size-limiting restrictions. Upon doing so, you will receive a standard response. 284 | 285 | ![Local Image](/images/Request-Size-Limiting/4.JPG) 286 | 287 | Conversely, if you surpass the size-limiting restrictions in your request, the response will notify you that your request exceeds the size-limiting range. 288 | 289 | ![Local Image](/images/Request-Size-Limiting/5.JPG) 290 | 291 | 292 | ### Step 5-9: Key auth restriction plugin 293 | 294 | In the first step you should go to Plugins section and enable Request size limiting plugin. 295 | 296 | ![Local Image](/images/Key-Auth/1.JPG) 297 | 298 | Please configure your plugin settings as shown in the image below. 299 | 300 | ![Local Image](/images/Key-Auth/2.JPG) 301 | 302 | ![Local Image](/images/Key-Auth/3.JPG) 303 | 304 | Use Thunder Client, Postman, or your preferred service to send a GET request to ```http://yourip:8000/yourservicename```. If an incorrect API key is used, as illustrated in the image below, a 401 Unauthorized error will be returned, indicating that the provided credentials are invalid and access to the requested resource is not permitted. 305 | 306 | ![Local Image](/images/Key-Auth/4-5.JPG) 307 | 308 | If a valid API key is utilized in the request, as demonstrated in the image below, a successful authentication will result in a 200 status code. In this case, the Authorization header of the response will contain your authentication information, confirming authorized access to the requested resource. 309 | 310 | ![Local Image](/images/Key-Auth/5.JPG) 311 | 312 | 313 | ### Step 5-10: ACL plugin 314 | 315 | In the first step you should go to Plugins section and enable Request size limiting plugin. 316 | 317 | ![Local Image](/images/ACL/1.JPG) 318 | 319 | Please configure your plugin settings as shown in the image below. 320 | 321 | ![Local Image](/images/ACL/2.JPG) 322 | 323 | ![Local Image](/images/ACL/3.JPG) 324 | 325 | After configuring your settings, follow the outlined steps to create two consumers, as previously explained. 326 | 327 | ![Local Image](/images/ACL/4.JPG) 328 | 329 | Alternatively, if you already have two consumers, navigate to the 'Consumers' section in your Kong panel. Then, proceed to the 'Credentials' section, where you can add ACL credentials for both consumers. 330 | 331 | ![Local Image](/images/ACL/5.JPG) 332 | 333 | ![Local Image](/images/ACL/6.JPG) 334 | 335 | now ensure that the Basic Authentication plugin is enabled in your configuration. 336 | 337 | ![Local Image](/images/ACL/7.JPG) 338 | 339 | Consequently, upon opening your browser and entering ```http://yourip:8000/yourservicename``` into the browser's address bar.After signing into your service, refer to the provided image below to observe that the admin consumer is granted access to the service. 340 | 341 | ![Local Image](/images/ACL/8.JPG) 342 | 343 | ![Local Image](/images/ACL/9.JPG) 344 | 345 | whereas the bot consumer is restricted from accessing it. 346 | 347 | ![Local Image](/images/ACL/10.JPG) 348 | 349 | ![Local Image](/images/ACL/11.JPG) 350 | 351 | # Collaborators 352 | This project represents a collaborative effort between Kiarash Rahmani and Ahmad Asadi. Working in tandem, we dedicated our efforts to developing a comprehensive and robust repository, designed to guide users in optimizing their experience with the Kong API gateway service. 353 | 354 | - [Kiarash Rahmani](https://github.com/kiarashrahmani) 355 | - [Ahmad Asadi](https://github.com/BlackAssassinCoder) 356 | 357 | # License 358 | This project is licensed under the MIT License. 359 | 360 | 361 | -------------------------------------------------------------------------------- /images/ACL/0.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/0.JPG -------------------------------------------------------------------------------- /images/ACL/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/1.JPG -------------------------------------------------------------------------------- /images/ACL/10.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/10.JPG -------------------------------------------------------------------------------- /images/ACL/11.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/11.JPG -------------------------------------------------------------------------------- /images/ACL/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/2.JPG -------------------------------------------------------------------------------- /images/ACL/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/3.JPG -------------------------------------------------------------------------------- /images/ACL/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/4.JPG -------------------------------------------------------------------------------- /images/ACL/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/5.JPG -------------------------------------------------------------------------------- /images/ACL/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/6.JPG -------------------------------------------------------------------------------- /images/ACL/7.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/7.JPG -------------------------------------------------------------------------------- /images/ACL/8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/8.JPG -------------------------------------------------------------------------------- /images/ACL/9.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/ACL/9.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/1.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/2.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/3.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/4.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/5.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/6.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/7.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/7.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/8.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/consumer 2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/consumer 2.JPG -------------------------------------------------------------------------------- /images/Basic-authentication/consumer.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Basic-authentication/consumer.JPG -------------------------------------------------------------------------------- /images/Bot-Detection/0.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Bot-Detection/0.JPG -------------------------------------------------------------------------------- /images/Bot-Detection/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Bot-Detection/1.JPG -------------------------------------------------------------------------------- /images/Bot-Detection/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Bot-Detection/2.JPG -------------------------------------------------------------------------------- /images/Bot-Detection/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Bot-Detection/3.JPG -------------------------------------------------------------------------------- /images/Bot-Detection/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Bot-Detection/4.JPG -------------------------------------------------------------------------------- /images/Bot-Detection/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Bot-Detection/5.JPG -------------------------------------------------------------------------------- /images/IP-restriction/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/1.JPG -------------------------------------------------------------------------------- /images/IP-restriction/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/2.JPG -------------------------------------------------------------------------------- /images/IP-restriction/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/3.JPG -------------------------------------------------------------------------------- /images/IP-restriction/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/4.JPG -------------------------------------------------------------------------------- /images/IP-restriction/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/5.JPG -------------------------------------------------------------------------------- /images/IP-restriction/Plugin.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/Plugin.JPG -------------------------------------------------------------------------------- /images/IP-restriction/service-runnig.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/IP-restriction/service-runnig.JPG -------------------------------------------------------------------------------- /images/Key-Auth/0.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/0.JPG -------------------------------------------------------------------------------- /images/Key-Auth/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/1.JPG -------------------------------------------------------------------------------- /images/Key-Auth/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/2.JPG -------------------------------------------------------------------------------- /images/Key-Auth/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/3.JPG -------------------------------------------------------------------------------- /images/Key-Auth/4-5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/4-5.JPG -------------------------------------------------------------------------------- /images/Key-Auth/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/4.JPG -------------------------------------------------------------------------------- /images/Key-Auth/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/5.JPG -------------------------------------------------------------------------------- /images/Key-Auth/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Key-Auth/6.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/1.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/2.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/3.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/4.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/5.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/6.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/7.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/7.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/8.JPG -------------------------------------------------------------------------------- /images/Proxy-caching/9.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Proxy-caching/9.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/0.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/0.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/1.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/2.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/3.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/4.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/5.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/6.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/7.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/7.JPG -------------------------------------------------------------------------------- /images/Rate-Limiter/8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Rate-Limiter/8.JPG -------------------------------------------------------------------------------- /images/Request-Size-Limiting/0.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-Size-Limiting/0.JPG -------------------------------------------------------------------------------- /images/Request-Size-Limiting/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-Size-Limiting/1.JPG -------------------------------------------------------------------------------- /images/Request-Size-Limiting/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-Size-Limiting/2.JPG -------------------------------------------------------------------------------- /images/Request-Size-Limiting/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-Size-Limiting/3.JPG -------------------------------------------------------------------------------- /images/Request-Size-Limiting/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-Size-Limiting/4.JPG -------------------------------------------------------------------------------- /images/Request-Size-Limiting/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-Size-Limiting/5.JPG -------------------------------------------------------------------------------- /images/Request-termination/1-second consumer.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/1-second consumer.JPG -------------------------------------------------------------------------------- /images/Request-termination/10.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/10.JPG -------------------------------------------------------------------------------- /images/Request-termination/11.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/11.JPG -------------------------------------------------------------------------------- /images/Request-termination/12.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/12.JPG -------------------------------------------------------------------------------- /images/Request-termination/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/2.JPG -------------------------------------------------------------------------------- /images/Request-termination/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/3.JPG -------------------------------------------------------------------------------- /images/Request-termination/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/4.JPG -------------------------------------------------------------------------------- /images/Request-termination/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/5.JPG -------------------------------------------------------------------------------- /images/Request-termination/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/6.JPG -------------------------------------------------------------------------------- /images/Request-termination/7.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/7.JPG -------------------------------------------------------------------------------- /images/Request-termination/8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/8.JPG -------------------------------------------------------------------------------- /images/Request-termination/9.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Request-termination/9.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/1.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/2.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/3.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/4.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/5.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/5.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/6.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/6.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/7.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/7.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/8.JPG -------------------------------------------------------------------------------- /images/Response-rate-limiting/9.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsadiAhmad/Kong-API-Gateway/bc0a387dcbc502b56640776ee39e8a927366ee6b/images/Response-rate-limiting/9.JPG -------------------------------------------------------------------------------- /myservice.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def hello(): 7 | return "Hi, I'm service 1" 8 | 9 | if __name__ == '__main__': 10 | app.run(debug=True, host='0.0.0.0',port=5000) 11 | -------------------------------------------------------------------------------- /myservice2.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def hello(): 7 | return "Hi, I'm service 2" 8 | 9 | if __name__ == '__main__': 10 | app.run(debug=True, host='0.0.0.0',port=4000) 11 | -------------------------------------------------------------------------------- /service.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def hello(): 7 | print("Received a request!") 8 | return 'This is rate limiting Plugin from KONG !' 9 | 10 | if __name__ == '__main__': 11 | app.run(host='0.0.0.0', port=3000) 12 | 13 | --------------------------------------------------------------------------------