-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-35377: [C++][FlightRPC] Add a ServerCallContext parameter to arrow::flight::ServerAuthHandler methods
#35378
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
GH-35377: [C++][FlightRPC] Add a ServerCallContext parameter to arrow::flight::ServerAuthHandler methods
#35378
Conversation
|
|
…to `arrow::flight::ServerAuthHandler` methods Because they are also RPC calls to like other `ListFlights()`, `DoGet()` and so on.
48b71e7 to
b8bfd16
Compare
lidavidm
left a comment
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.
LGTM.
cpp/src/arrow/flight/server_auth.h
Outdated
| /// If this version is implemented, the deprecated Authentication() | ||
| /// without ServerCallContext version isn't used. So we can | ||
| /// implement the deprecated version like the following: | ||
| /// | ||
| /// Status Authenticate(ServerAuthSender* outgoing, | ||
| /// ServerAuthReader* incoming) override { | ||
| /// return Status::NotImplemented("This version is never used"); | ||
| /// } |
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.
We could change the deprecated overload from pure virtual to just virtual, and add a default no-op/always-failing implementation. That way people who only implement the new overload won't have to update code when we remove the deprecated overload. What do you think?
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.
Oh, it's a good idea! I'll do it.
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.
Done.
cpp/src/arrow/flight/server_auth.h
Outdated
| /// \return Status OK if this authentication is succeeded. | ||
| /// \deprecated Deprecated since 13.0.0. Implement the Authentication() | ||
| /// with ServerCallContext version instead. | ||
| virtual Status Authenticate(ServerAuthSender* outgoing, ServerAuthReader* incoming) = 0; |
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 suppose we can't mark this as deprecated to the compiler without triggering a bunch of warnings on ourselves, can we...
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.
We can mark this as deprecated but client codes that overrides this don't receive any deprecated warning from their compiler. Because client codes don't call this method. Our server implementations call this method instead.
Anyway, I've added ARROW_DEPRECATED() because a -Wdocumentation-deprecated-sync warning is reported without it: https://github.com/kou/arrow/actions/runs/4849400904/jobs/8641350382#step:9:1437
/Users/runner/work/arrow/arrow/cpp/src/arrow/flight/server_auth.h:83:8: error: declaration is marked with '\deprecated' command but does not have a deprecation attribute [-Werror,-Wdocumentation-deprecated-sync]
/// \deprecated Deprecated since 13.0.0. Implement the Authentication()
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/runner/work/arrow/arrow/cpp/src/arrow/flight/server_auth.h:85:3: note: add a deprecation attribute to the declaration to silence this warning
virtual Status Authenticate(ServerAuthSender* outgoing, ServerAuthReader* incoming) = 0;
^
| /// authentication method supports it. | ||
| /// \return Status OK if the token is valid, any other status if | ||
| /// validation failed | ||
| virtual Status IsValid(const ServerCallContext& context, const std::string& token, |
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.
Looks like doxygen complains unless there's a \param for this
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.
Good catch!
I forgot to add it...
|
Benchmark runs are scheduled for baseline = be12888 and contender = 42527e1. 42527e1 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
|
['Python', 'R'] benchmarks have high level of regressions. |
…to `arrow::flight::ServerAuthHandler` methods (apache#35378) ### Rationale for this change Because they are also RPC calls to like others such as `ListFlights()` and `DoGet()`. ### What changes are included in this PR? Add with `ServerCallContext` versions. Old signature versions still exist for keeping backward compatibility. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * C++ API: Don't include any breaking changes. * C GLib API: Includes a breaking change. `context` argument is added. * Closes: apache#35377 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…to `arrow::flight::ServerAuthHandler` methods (apache#35378) ### Rationale for this change Because they are also RPC calls to like others such as `ListFlights()` and `DoGet()`. ### What changes are included in this PR? Add with `ServerCallContext` versions. Old signature versions still exist for keeping backward compatibility. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * C++ API: Don't include any breaking changes. * C GLib API: Includes a breaking change. `context` argument is added. * Closes: apache#35377 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Rationale for this change
Because they are also RPC calls to like others such as
ListFlights()andDoGet().What changes are included in this PR?
Add with
ServerCallContextversions.Old signature versions still exist for keeping backward compatibility.
Are these changes tested?
Yes.
Are there any user-facing changes?
Yes.
This PR includes breaking changes to public APIs.
C++ API: Don't include any breaking changes.
C GLib API: Includes a breaking change.
contextargument is added.Closes: [C++][FlightRPC] Add a
ServerCallContextparameter toarrow::flight::ServerAuthHandlermethods #35377