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
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.
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.
Oh, it's a good idea! I'll do it.
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.
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.
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.
Looks like doxygen complains unless there's a \param for this
There was a problem hiding this comment.
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>
This PR removes C++ APIs deprecated in releases before January 1, 2025, following Arrow's deprecation policy (>1 year old deprecations). **Rationale for This Change** Cleans up deprecated APIs per maintainer request in apacheGH-49153. **What Changes Are Included in This PR?** 1. **ServerAuthHandler::IsValid() (old signature)** - **PR**: apache#35378 (merged May 2, 2023) - **Released**: v13.0.0 (August 17, 2023) - **Age**: 2.5 years old - **Removed**: Old IsValid(token, peer_identity) method - **Made pure virtual**: IsValid(context, token, peer_identity) signature - **Replacement**: Implement the new signature with ServerCallContext parameter 2. **decimal() factory function** - **PR**: apache#43957 (merged September 30, 2024) - **Released**: v18.0.0 (October 16, 2024) - **Age**: 1.3 years old - **Removed**: �rrow::decimal(precision, scale) function - **Replacement**: Use smallest_decimal(precision, scale) instead 3. **FlightSqlServerBase::CancelQuery()** - **PR**: apache#36009 (merged July 3, 2023) - **Released**: v13.0.0 (August 17, 2023) - **Age**: 2.5 years old - **Removed**: - CancelQuery() method - ActionCancelQueryRequest struct - CancelResult enum - kCancelQueryActionType action type - **Replacement**: Use CancelFlightInfo() instead 4. **FlightSqlClient::CancelQuery()** - **PR**: apache#36009 (merged July 3, 2023) - **Released**: v13.0.0 (August 17, 2023) - **Age**: 2.5 years old - **Removed**: Client-side CancelQuery() method - **Replacement**: Use CancelFlightInfo() instead **Are These Changes Tested?** Yes. Verified via codebase search that: - All removed symbols have zero remaining internal usages - Derived ServerAuthHandler classes use the new IsValid() signature - Tests already use the replacement APIs **Are There Any User-Facing Changes?** Yes (breaking changes for C++ users): - Code using deprecated APIs must migrate to documented replacements - No behavior changes for code already using replacement APIs Closes apache#49153
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