Skip to content

Conversation

@aiguofer
Copy link

@aiguofer aiguofer commented Jan 15, 2025

We need the authentication request to include all of the headers that get set as connection properties as those can affect the authentication flow.

I'm not sure if moving this call has any unintended consequences.

Antropovi and others added 2 commits January 14, 2025 14:28
FlightClient::Connect(location, client_options, &flight_client));

PopulateMetadataSettings(properties);
PopulateCallOptions(properties);
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense. The properties object never changes.
However there is a subtle behavioral change around the call options.

In the original implementation, call options added by the authentication method are added to the front of the headers list, then extra headers are added after. Now, the extra headers are first, then auth-generated headers are added after.

This likely matters for headers that conflict, which shouldn't really happen.

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC in JDBC we separated out headers returned by authentication from headers supplied by the user, and when making requests, always combined them with auth-generated headers, user-headers second.

Copy link
Author

Choose a reason for hiding this comment

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

ahhh yeah didn't think about ordering or headers returned by the server. That probably means we still also need to make the PopulateCallOptions call AFTER the auth call. Alternatively, do something smarter to ensure the correct ordering if you think that's an issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think what you might want to do is headers into "connection-string-supplied" vs. "auth-generated". Supply the connection-string-supplied ones to the auth functions.

Then when building the final set of headers, start with the auth-generated ones then the connection-string ones.

Wondering if there's a scenario where the auth-process can mutate the connection-string-supplied headers, but that can be solved later if we run into it.

Copy link
Author

Choose a reason for hiding this comment

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

That makes sense! Any chance you can make those changes? I've never really worked with C++ and it's not immediately obvious how to make those changes.

Copy link

@altay13 altay13 Jan 27, 2025

Choose a reason for hiding this comment

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

Hey guys, is there plan of shipping this PR? Also I am interested if you will publish a new ODBC Driver with those changes? We are stuck right now because of headers issue
Thank you

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Antropovi
❌ aiguofer
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants