-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactoring for external auth. Vol II #66
Conversation
fde0bb8
to
989f04f
Compare
989f04f
to
6153480
Compare
Signed-off-by: dd di cesare <[email protected]>
6153480
to
87ddc45
Compare
upstream_name, | ||
RATELIMIT_SERVICE_NAME, | ||
RATELIMIT_METHOD_NAME, | ||
initial_metadata, |
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 guess this should be self.metadata
and initial_metadata
disappears from that method signature, right?
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've made the grpc_call
outside the impl
block so we can mock it in the tests, that's why it doesn't take a self
param. Should it be include it within the RateLimitService
impl?
src/service/rate_limit.rs
Outdated
|
||
const RATELIMIT_SERVICE_NAME: &str = "envoy.service.ratelimit.v3.RateLimitService"; | ||
const RATELIMIT_METHOD_NAME: &str = "ShouldRateLimit"; | ||
pub struct RateLimitService<'a> { |
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, if metadata
is the "headers", and in our case the tracing ones, you can just claim ownership of these str
and get rid of <'a>
Signed-off-by: dd di cesare <[email protected]>
Part of the work needed for #58
This PR follows the work done in #64, it aims to extract the grpc service logic.
With this refactor we now can build different implementations of
Service
in order to call external GRPC services to validate messages.