-
-
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
Enable Middleware Support for Blueprint Groups #1399
Enable Middleware Support for Blueprint Groups #1399
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1399 +/- ##
==========================================
- Coverage 91.45% 90.78% -0.67%
==========================================
Files 17 18 +1
Lines 1731 1900 +169
Branches 330 377 +47
==========================================
+ Hits 1583 1725 +142
- Misses 123 151 +28
+ Partials 25 24 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the documentation related to blueprints before we merge this.
@sjsadowski I am working on adding the documents. I will update the PR with the changes shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a more comprehensive number of tests, with parameters in both the route
and url_prefix
? Also, add tests with other HTTP methods such as POST
and OPTIONS
, so everything can be checked successfully.
@vltr Sure. Consider it done. |
@sjsadowski I added the basic documentation on usage and tested a local @vltr I've added additional unit test cased with few more HTTP methods as well as |
@harshanarayana thanks. This won't go in to 18.12 but it will go in after that. Appreciate your help. |
@sjsadowski I'm OK with this getting merged into any version you see fit. No issues from my side. Just give me a heads-up if anything else needs to be addressed in this PR. |
7e86025
to
c652f7f
Compare
c652f7f
to
fa4260a
Compare
@yunstanford Are you good with this one? |
This commit will enable the users to implement a middleware at the blueprint group level whereby enforcing the middleware automatically to each of the available Blueprints that are part of the group. This will eanble a simple way in which a certain set of common features and criteria can be enforced on a Blueprint group. i.e. authentication and authorization This commit will address the feature request raised as part of Issue sanic-org#1386 Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
Signed-off-by: Harsha Narayana <[email protected]>
fa4260a
to
4f92e37
Compare
@huge-success/sanic-core-devs Can you please take a look at this and let me know if there are any other changes required to be done on this PR? |
@harshanarayana The only code issue I see is the use of The way I've usually implemented this kind of functionality is to create a method called |
@ashleysommer Thank you very much for the review and suggestions.
The idea was to keep almost all the existing behaviors of
That sounds like a really good thing to do. Let me get that change sorted. |
…nstead of properly to add blueprint to group Signed-off-by: Harsha Narayana <[email protected]>
Yeah, it's a good implementation. I didn't mean to suggest it might cause breaking changes. I don't think that. I just mean that some plugins will need to be BlueprintGroup aware, specifically if it is a middleware-based plugin and it wants to apply its plugin/middleware functionality to blueprint groups. |
Sorry if my message came across that way. I wasn't meaning that. After you mentioned, I realized that there might be some breaking changes wrt these plugins if they are doing an |
@sjsadowski |
Ugh. It has to do with how projects work. I closed all the PRs that looked like they were merged from the project screen. Gotta go fix now... |
Stale review, looks like we should be good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this, even though it could break some projects (known)
* enable blueprint group middleware support This commit will enable the users to implement a middleware at the blueprint group level whereby enforcing the middleware automatically to each of the available Blueprints that are part of the group. This will eanble a simple way in which a certain set of common features and criteria can be enforced on a Blueprint group. i.e. authentication and authorization This commit will address the feature request raised as part of Issue sanic-org#1386 Signed-off-by: Harsha Narayana <[email protected]> * enable indexing of BlueprintGroup object Signed-off-by: Harsha Narayana <[email protected]> * rename blueprint group file to fix spelling error Signed-off-by: Harsha Narayana <[email protected]> * add documentation and additional unit tests Signed-off-by: Harsha Narayana <[email protected]> * cleanup and optimize headers in unit test file Signed-off-by: Harsha Narayana <[email protected]> * fix Bluprint Group iteratable method Signed-off-by: Harsha Narayana <[email protected]> * add additional unit test to check StopIteration condition Signed-off-by: Harsha Narayana <[email protected]> * cleanup iter protocol implemenation for blueprint group and add slots Signed-off-by: Harsha Narayana <[email protected]> * fix blueprint group middleware invocation identification Signed-off-by: Harsha Narayana <[email protected]> * feat: enable list behavior on blueprint group object and use append instead of properly to add blueprint to group Signed-off-by: Harsha Narayana <[email protected]> add port to url_for, and update doc for it, reset scheme and external if server not specified in url_for add port to url_for, and update doc for it, reset scheme and external if server not specified in url_for Revert "add port to url_for, and update doc for it, reset scheme and external if server not specified in url_for" This reverts commit b073dfa.
I agree. I think this is a positive breaking change. |
This commit will enable the users to implement a middleware at the blueprint group level whereby enforcing the middleware automatically to each of the available Blueprints that are part of the group.
This will enable a simple way in which a certain set of common features and criteria can be enforced on a Blueprint group. i.e. authentication and authorization
This commit will address the feature request raised as part of Issue #1386