Skip to content

Commit 7c82ffa

Browse files
feature(#20): this commit introduces new routes in ocelot.json for client endpoints, including GET, POST, PUT, and DELETE methods. Each route has rate-limiting settings (5 requests per second per client) and QoS options (circuit breaker and timeout). All routes point to the downstream service.
1 parent e850ca8 commit 7c82ffa

1 file changed

Lines changed: 138 additions & 0 deletions

File tree

Applications/Proxy/Source/ocelot.json

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,144 @@
551551
"DurationOfBreak": 5000,
552552
"TimeoutValue": 25000
553553
}
554+
},
555+
{
556+
"UpstreamHttpMethod": [ "GET", "POST" ],
557+
"UpstreamPathTemplate": "/api/v1/clients",
558+
"DownstreamPathTemplate": "/api/v1/clients",
559+
"DownstreamScheme": "http",
560+
"DownstreamHostAndPorts": [
561+
{
562+
"Host": "localhost",
563+
"Port": 5286
564+
}
565+
],
566+
"RateLimitOptions": {
567+
"ClientIdHeader": "Client",
568+
"EnableRateLimiting": true,
569+
"Period": "1s",
570+
"Limit": 5
571+
},
572+
"QoSOptions": {
573+
"ExceptionsAllowedBeforeBreaking": 3,
574+
"DurationOfBreak": 5000,
575+
"TimeoutValue": 25000
576+
}
577+
},
578+
{
579+
"UpstreamHttpMethod": [ "PUT", "DELETE" ],
580+
"UpstreamPathTemplate": "/api/v1/clients/{id}",
581+
"DownstreamPathTemplate": "/api/v1/clients/{id}",
582+
"DownstreamScheme": "http",
583+
"DownstreamHostAndPorts": [
584+
{
585+
"Host": "localhost",
586+
"Port": 5286
587+
}
588+
],
589+
"RateLimitOptions": {
590+
"ClientIdHeader": "Client",
591+
"EnableRateLimiting": true,
592+
"Period": "1s",
593+
"Limit": 5
594+
},
595+
"QoSOptions": {
596+
"ExceptionsAllowedBeforeBreaking": 3,
597+
"DurationOfBreak": 5000,
598+
"TimeoutValue": 25000
599+
}
600+
},
601+
{
602+
"UpstreamHttpMethod": [ "GET", "POST" ],
603+
"UpstreamPathTemplate": "/api/v1/clients/{id}/permissions",
604+
"DownstreamPathTemplate": "/api/v1/clients/{id}/permissions",
605+
"DownstreamScheme": "http",
606+
"DownstreamHostAndPorts": [
607+
{
608+
"Host": "localhost",
609+
"Port": 5286
610+
}
611+
],
612+
"RateLimitOptions": {
613+
"ClientIdHeader": "Client",
614+
"EnableRateLimiting": true,
615+
"Period": "1s",
616+
"Limit": 5
617+
},
618+
"QoSOptions": {
619+
"ExceptionsAllowedBeforeBreaking": 3,
620+
"DurationOfBreak": 5000,
621+
"TimeoutValue": 25000
622+
}
623+
},
624+
{
625+
"UpstreamHttpMethod": [ "DELETE" ],
626+
"UpstreamPathTemplate": "/api/v1/clients/{id}/permissions/{permissionId}",
627+
"DownstreamPathTemplate": "/api/v1/clients/{id}/permissions/{permissionId}",
628+
"DownstreamScheme": "http",
629+
"DownstreamHostAndPorts": [
630+
{
631+
"Host": "localhost",
632+
"Port": 5286
633+
}
634+
],
635+
"RateLimitOptions": {
636+
"ClientIdHeader": "Client",
637+
"EnableRateLimiting": true,
638+
"Period": "1s",
639+
"Limit": 5
640+
},
641+
"QoSOptions": {
642+
"ExceptionsAllowedBeforeBreaking": 3,
643+
"DurationOfBreak": 5000,
644+
"TimeoutValue": 25000
645+
}
646+
},
647+
{
648+
"UpstreamHttpMethod": [ "POST" ],
649+
"UpstreamPathTemplate": "/api/v1/clients/{id}/audiences",
650+
"DownstreamPathTemplate": "/api/v1/clients/{id}/audiences",
651+
"DownstreamScheme": "http",
652+
"DownstreamHostAndPorts": [
653+
{
654+
"Host": "localhost",
655+
"Port": 5286
656+
}
657+
],
658+
"RateLimitOptions": {
659+
"ClientIdHeader": "Client",
660+
"EnableRateLimiting": true,
661+
"Period": "1s",
662+
"Limit": 5
663+
},
664+
"QoSOptions": {
665+
"ExceptionsAllowedBeforeBreaking": 3,
666+
"DurationOfBreak": 5000,
667+
"TimeoutValue": 25000
668+
}
669+
},
670+
{
671+
"UpstreamHttpMethod": [ "DELETE" ],
672+
"UpstreamPathTemplate": "/api/v1/clients/{id}/audiences/{audience}",
673+
"DownstreamPathTemplate": "/api/v1/clients/{id}/audiences/{audience}",
674+
"DownstreamScheme": "http",
675+
"DownstreamHostAndPorts": [
676+
{
677+
"Host": "localhost",
678+
"Port": 5286
679+
}
680+
],
681+
"RateLimitOptions": {
682+
"ClientIdHeader": "Client",
683+
"EnableRateLimiting": true,
684+
"Period": "1s",
685+
"Limit": 5
686+
},
687+
"QoSOptions": {
688+
"ExceptionsAllowedBeforeBreaking": 3,
689+
"DurationOfBreak": 5000,
690+
"TimeoutValue": 25000
691+
}
554692
}
555693
]
556694
}

0 commit comments

Comments
 (0)