-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocelot crashes if there are same-named Catch-Alls e.g. foo/{bar}/{bar}
#683
Comments
Should probably be fixed in the initial reroute validators. |
…treamPathTemplate
…t crash on dispose and validate duplicate placeholders in UpstreamPathTemplate * initial commit for new feature #1077 allow to limit the number of concurrent tcp connection to a downstream service * protect code against value not in accurate range add unit test * Do not crash host on Dispose * Add test * Pin GitVersion.CommandLine package version * #683 validate if there are duplicated placeholders in UpstreamPathTemplate * Use registered scheme from Eureka (#1087) * extra test * very brief mention MaxConnectionsPerServer in docs * build develop like a PR * more docs Co-authored-by: jlukawska <[email protected]> Co-authored-by: buretjph <[email protected]> Co-authored-by: Jonathan Mezach <[email protected]> Co-authored-by: 彭伟 <[email protected]>
…namic behaviour * Make rate-limiting client whitelist dynamic * Refactor `RateLimitOptions.ClientWhiteList` * Fix typo in variable `enbleRateLimiting` * Fix case in variable `clientIdheader` author Taiwo Otubamowo <[email protected]> * fix 1045 * #492 log 500 with error log level, acceptance test, unit test * #492 minor changes * initial commit for new feature #1077 allow to limit the number of concurrent tcp connection to a downstream service * protect code against value not in accurate range add unit test * Do not crash host on Dispose * Add test * Pin GitVersion.CommandLine package version * #683 validate if there are duplicated placeholders in UpstreamPathTemplate * Use registered scheme from Eureka (#1087) * extra test * very brief mention MaxConnectionsPerServer in docs * build develop like a PR * more docs * test Co-authored-by: Taiwo O. <[email protected]> Co-authored-by: Catcher Wong <[email protected]> Co-authored-by: jlukawska <[email protected]> Co-authored-by: buretjph <[email protected]> Co-authored-by: Jonathan Mezach <[email protected]> Co-authored-by: 彭伟 <[email protected]>
@AlyHKafoury Your next coding challenge? 😉 |
foo/{bar}/{bar}
@raman-m please assign to me |
@AlyHKafoury You're assigned! |
@raman-m I working on the unit tests |
@AlyHKafoury |
@raman-m I will rebase to develop now and continue on this |
Yes, Rebase feature branch onto develop please and continue working... Thanks! |
Hello, Mr. Swinchatt! Yeah, the previous dev team and Tom missed it, and in my opinion, the valid template definition should have all placeholders with different names, and each upstream placeholder should be presented in downstream template too.
Make sense? Which design suits your usage scenarios best? @AlyHKafoury FYI And let's start discussing... |
Hello @raman-m, I'm no longer working with Ocelot but IIRC I was writing code to generate an Ocelot config by traversing Swagger documents and it had a bug that resulted in outputting duplicate placeholders. So you could say that my bug found your bug. To your question, I would probably go the route of crashing early, but I leave it to you. Thanks. |
@ChrisSwinchatt Thanks for your reply!
Since you are a big fan of Swagger, here is some useful information for you 👉
Do not you mind, if we will create separate discussion where we can start brainstorming an integration and Swagger support, and I will invite you also to the thread?
🆗 Today I realized that ignoring the route will not be good. To crash early we can generate early validation @AlyHKafoury FYI. |
@raman-m Continuing on it |
@raman-m So, we are gonna throw a Critical error in validation, and then start the application normally then throw an error when a route matching this route is called ? and we will not crash the application ? |
@AlyHKafoury , Regarding validation... The 2nd requirement to write extra record makes sense only if Ocelot won't crash. |
* add validation for downstream path also * add similiar route placeholders * Add unit tests * Refactor unit tests * IDE1006: Naming rule violation * IDE0028: Collection Initialization can be simplified * Merge into one theory * Less `IEnumerable<T>` usage to have less `IEnumerator<T>` objects in favor of the collection one * Refactor validation of duplicated placeholders * Finish unit testing * Publish hidden Service Fabric feature * Update acceptance tests * Update integration tests * Update release notes --------- The author: Aly Kafoury <@AlyHKafoury> Co-authored-by: Raman Maksimchuk <[email protected]>
Hi Chris! FYI: Bug fixed today!But we used not "an informative exception" solution and chose another solution based on Ocelot configuration validator adding more validation rules for route templates. With this bug fix Ocelot won't start because of validation errors in the log. And user must correct invalid routes with bad templates. This patch will be released soon... |
Expected Behavior
An informative exception which tells you you can't reuse catch-all names within a path.
Actual Behavior
This exception, which doesn't tell you what is wrong and looks like a bug in Ocelot:
Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: