-
Notifications
You must be signed in to change notification settings - Fork 112
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
add support for request guards #47
Conversation
…e otherwise there would be duplicate json fields called name, add example of a custom apikey implementation with openapi
@ralpha I see you're maintaining this now, that's great! Any chance for a merge on this PR? |
This PR should be updated ideally, some people has left some patches for this on my forked version this: TotalKrill#3 |
I'm currently working on integrating this into the current master. (so no need to change PR) @TotalKrill where there any other changes regarding this I need to take a look at? And thanks for the PR :) This is a nice and needed feature to add. |
@ralpha Very happy to see this original project getting some well deserved attention again, nice work! there are no real new features otherwise in my fork, I just really needed that security_scheme thingy, and was tired of depending on the github repo. I know user @mentaljam is working on some nice refactorings in a draft, TotalKrill#4, but nothing to merge as of yet. Other than that there has not been any major changes, once this is in i will update my readme and publish a new version of my fork directing anyone who was using it back here again, as soon as these changes are pushed to crates.io that is. I know it takes a lot of effort maintaining this things, but if you feel like you are lagging behind, I do think its good to ask for help as soon as you feel that happening, there are a lot of good developers around, and publishing to crates.io semi-often means that users have an easy way to stick to a working version, if one of said developers do a bit to heavy breaking changes. I do not want to maintain a branch, nor this library (no offense), but I will if i have to since I am using it :) |
This time I had the benefit that this update was needed for work, so I created it during my work. But I'll probably finish this PR after work so I can get it finished sooner. But updates will most likely come in bursts, like this time (at least from my side). But if I need help I'll ask! |
@TotalKrill In you code you have the So this could never be happen. Or am I wrong in assuming this? Could you please explain? |
Which code are you looking at, my branch or this PR? Edit, nevermind, i was to quick to ask, understood the question now. The parameter Enum is there so that the in the case of someone wanting to provide a method in the Header section of an HTTP request, that is not a security scheme like JWT or other token, they could do so, that was the original thought of that part of the enum. Basically that would make a header value accessible inside of the route handler, and the swagger interface could provide this header positioned value. |
- Added feature flag for `secrets` (Re-exposing Rocket feature flag) - Added support for Request Guards and Security Scheme (aka Authentication and Authorization) (Closes: #47, #9, #3) - Added support for new `FromRequest` types (implemented `OpenApiFromRequest`). - Added `OpenApiFromRequest` derive macro. - Added `map!` macro for easy creation of `okapi::Map` objects. - Change `OAuthFlows` to better represent the different flows and allowed values within them. - Fixed casing in `SecuritySchemeData`.
- Added feature flag for `secrets` (Re-exposing Rocket feature flag) - Added support for Request Guards and Security Scheme (aka Authentication and Authorization) (Closes: #47, #9, #3) - Added support for new `FromRequest` types (implemented `OpenApiFromRequest`). - Added `OpenApiFromRequest` derive macro. - Added `map!` macro for easy creation of `okapi::Map` objects. - Change `OAuthFlows` to better represent the different flows and allowed values within them. - Fixed casing in `SecuritySchemeData`.
Okay made a bunch of changes and restructured a bunch of things. Also added support for al currently (Rocket 0.5.0-rc.1) items that currently implement Also added examples for all the most common authentication methods so people can easily figure out how to do this. Also allowed me to test everything. |
This adds support for defining and getting request guards to define security schemes
result can look something like this:
Will add an example for this soon