-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactor authentication into middleware #132
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 74.00% 74.04% +0.03%
==========================================
Files 403 406 +3
Lines 64198 64211 +13
==========================================
+ Hits 47508 47543 +35
+ Misses 16690 16668 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 think this is very good! One comment below on naming.
opensearch/src/http/middleware.rs
Outdated
request: Request, | ||
) -> BoxFuture<Result<Request, BoxError<'static>>> { | ||
Box::pin(future::ready(Ok(request))) | ||
} |
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.
The naming seems off. Is there some kind of Rust standard for middleware/callbacks? I would adopt either an event style on_before
, on_after
or a stack style configure
and call
?
ae804f4
to
b33e9c8
Compare
@Xtansia any interest in finishing this? |
@dblock Yes, I'm planning on coming back to this soon-ish, especially now that the aws deps have stabilised. |
Signed-off-by: Thomas Farr <[email protected]>
Have decided to split this into multiple smaller more specific PRs |
Description
Refactors the authentication handling of the transport out into a middleware concept. Allows pulling AWS SigV4 auth out to a separate crate.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.