FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-445: [Flight] Add middleware for auth2 bearer tokens by devinrsmith · Pull Request #503 · apache/arrow-java · GitHub

GH-445: [Flight] Add middleware for auth2 bearer tokens - #503

Open
devinrsmith wants to merge 1 commit into
apache:mainfrom
devinrsmith:add-bearer-middleware
Open

GH-445: [Flight] Add middleware for auth2 bearer tokens#503
devinrsmith wants to merge 1 commit into
apache:mainfrom
devinrsmith:add-bearer-middleware

Conversation

Copy link
Copy Markdown
Contributor

Rationale for this change

This makes it easier to work with auth2 from the Java client without needing to resort to ClientCookieMiddleware (ie, don't need to force the server to support a non-standard auth scheme). I think it could be highly beneficial for ease-of-use when directly creating a FlightClient, and I would expect that the various FlightSqlClient drivers (ADBC, JDBC) could benefit from supporting it as a configuration option.

What changes are included in this PR?

A new FlightClientMiddleware had been added.

Are these changes tested?

These changes have been manually tested; if more testing is necessary, I'm hoping another contributor can provide it or guide me through a test plan.

Note: this is a re-creation of #446, I think some codeowner logic was not in place when I originally created the PR.

lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this might be useful, but we probably need to sit down and sort out all the existing auth options...there are too many at this point and it's unclear how each of them work without having to go read every implementation (I think this PR does not overlap with any of them, but it's hard to make sure)

I think this needs at least a basic test using an in-process server. For instance the server could track the last token it received, and the test could assert that the client and the server see the 'correct' token as it is changed (on either side).


public static class Factory implements FlightClientMiddleware.Factory {

private volatile String bearerValue;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think AtomicReference would be more appropriate here

}

void setBearerValue(String bearerValue) {
// Avoid volatile write if the value hasn't changed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Doesn't this optimization introduce a TOC/TOU error?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL