Skip to content
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-38576: [Java] Change JDBC driver to optionally preserve cookies and auth tokens when getting streams #38580

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

jduo
Copy link
Member

@jduo jduo commented Nov 3, 2023

Rationale for this change

This change restores the original behavior of transmitting existing cookies and auth tokens when getting separate
streams returned by getFlightInfo after adding support for multiple endpoints.

These properties are now optional though.

What changes are included in this PR?

  • Change the JDBC driver to add new properties "retainCookies" and "retainAuth"
  • These properties allow internally spawned connections for getting streams to use the cookies and bearer tokens from the original connection.
  • Add tests for validating defaults from ArrowFlightSqlClient.Builder

Are these changes tested?

Unit tests have been added.

Are there any user-facing changes?

Yes. There are now properties and they are documented.

@jduo
Copy link
Member Author

jduo commented Nov 3, 2023

@lidavidm @aiguofer

@jduo jduo force-pushed the 38576-allow-preserve-cookies branch 2 times, most recently from 539e622 to 1b143a1 Compare November 6, 2023 15:20
Copy link
Contributor

@aiguofer aiguofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I like that the default will be to maintain previous behavior :)

credentialOptions.add(
ClientAuthenticationUtils.getAuthenticate(
client, username, password, authFactory, options.toArray(new CallOption[0])));
if (username != null && token == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also use isUsingUserPasswordAuth?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. Thanks!

@jduo jduo force-pushed the 38576-allow-preserve-cookies branch 2 times, most recently from c23d4be to a6b041a Compare November 6, 2023 20:54
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Nov 6, 2023
jduo added 2 commits November 6, 2023 13:34
…ies and auth tokens when getting streams

- Change the JDBC driver to add new properties "retainCookies" and "retainAuth"
- These properties allow internally spawned connections for getting streams to
use the cookies and bearer tokens from the original connection.
- Add tests for validating defaults from ArrowFlightSqlClient.Builder
@jduo jduo force-pushed the 38576-allow-preserve-cookies branch from a6b041a to 528b39c Compare November 6, 2023 21:35
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Nov 7, 2023
@lidavidm lidavidm merged commit fafd48c into apache:main Nov 7, 2023
15 of 16 checks passed
@lidavidm lidavidm removed the awaiting merge Awaiting merge label Nov 7, 2023
Copy link

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit fafd48c.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Nov 9, 2023
…ies and auth tokens when getting streams (apache#38580)

### Rationale for this change
This change restores the original behavior of transmitting existing cookies and auth tokens when getting separate
streams returned by getFlightInfo after adding support for multiple endpoints.

These properties are now optional though.

### What changes are included in this PR?
- Change the JDBC driver to add new properties "retainCookies" and "retainAuth"
- These properties allow internally spawned connections for getting streams to use the cookies and bearer tokens from the original connection.
- Add tests for validating defaults from ArrowFlightSqlClient.Builder

### Are these changes tested?
Unit tests have been added.

### Are there any user-facing changes?
Yes. There are now properties and they are documented.
* Closes: apache#38576

Authored-by: James Duong <james.duong@improving.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…ies and auth tokens when getting streams (apache#38580)

### Rationale for this change
This change restores the original behavior of transmitting existing cookies and auth tokens when getting separate
streams returned by getFlightInfo after adding support for multiple endpoints.

These properties are now optional though.

### What changes are included in this PR?
- Change the JDBC driver to add new properties "retainCookies" and "retainAuth"
- These properties allow internally spawned connections for getting streams to use the cookies and bearer tokens from the original connection.
- Add tests for validating defaults from ArrowFlightSqlClient.Builder

### Are these changes tested?
Unit tests have been added.

### Are there any user-facing changes?
Yes. There are now properties and they are documented.
* Closes: apache#38576

Authored-by: James Duong <james.duong@improving.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…ies and auth tokens when getting streams (apache#38580)

### Rationale for this change
This change restores the original behavior of transmitting existing cookies and auth tokens when getting separate
streams returned by getFlightInfo after adding support for multiple endpoints.

These properties are now optional though.

### What changes are included in this PR?
- Change the JDBC driver to add new properties "retainCookies" and "retainAuth"
- These properties allow internally spawned connections for getting streams to use the cookies and bearer tokens from the original connection.
- Add tests for validating defaults from ArrowFlightSqlClient.Builder

### Are these changes tested?
Unit tests have been added.

### Are there any user-facing changes?
Yes. There are now properties and they are documented.
* Closes: apache#38576

Authored-by: James Duong <james.duong@improving.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Java][FlightRPC] Add options to JDBC to reuse credentials and cookies in getStream sub-clients
3 participants