-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[FEATURE/IDENTITY] Add bearer authentication to feature/identity #5611
[FEATURE/IDENTITY] Add bearer authentication to feature/identity #5611
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
@DarshitChanpura @cwperks This finally passed, but I am not thrilled about the license setup that I had to do. I thought that we could share licenses across modules so that authn and identity could use the same license but I could not get that to work so eventually just did it manually. If either of you know how to fix the sharing configuration let me know. Otherwise this should be all set. I can also squash the commits when doing this. |
@scrawfor99 It depends on which build.gradle file the dependency is in. The sha, LICENSE and NOTICE files should be in the In our case the For anyone reading this and wondering why there is both |
Hi @cwperks, thank you for the explanation. I was not sure what the difference between the two modules was myself so I appreciate you clearing that up. I will say that the dependencies are listed in both |
Gradle Check (Jenkins) Run Completed with:
|
Add bearer authentication to feature/identity Signed-off-by: Stephen Crawford <[email protected]> Update documentation Signed-off-by: Stephen Crawford <[email protected]> Spotless apply Jenkins fix Signed-off-by: Stephen Crawford <[email protected]> Add license file Signed-off-by: Stephen Crawford <[email protected]> Add sha Signed-off-by: Stephen Crawford <[email protected]> Rename License File Signed-off-by: Stephen Crawford <[email protected]> Add empty notice file Signed-off-by: Stephen Crawford <[email protected]>
874d100
to
891b9f1
Compare
Signed-off-by: Stephen Crawford <[email protected]>
Adds support for BearerToken for InternalRealm and skips credential matching for jwtToken Signed-off-by: Darshit Chanpura <[email protected]> Modifies bearer auth tests to test correct response Signed-off-by: Darshit Chanpura <[email protected]> Push before rebase Signed-off-by: Stephen Crawford <[email protected]> Fix public change Signed-off-by: Stephen Crawford <[email protected]> rename test case Signed-off-by: Stephen Crawford <[email protected]> Fix exceptions Signed-off-by: Stephen Crawford <[email protected]> remove unneeded method Signed-off-by: Stephen Crawford <[email protected]> Spotless Signed-off-by: Stephen Crawford <[email protected]> Remove old exception throw Signed-off-by: Stephen Crawford <[email protected]> Fix failing test Signed-off-by: Stephen Crawford <[email protected]> Remove throw from Subject Signed-off-by: Stephen Crawford <[email protected]> Rename fail statement Signed-off-by: Stephen Crawford <[email protected]> spotless Signed-off-by: Stephen Crawford <[email protected]> Remove dead throw and split into utility class Signed-off-by: Stephen Crawford <[email protected]> Add javadocs for utility methods Signed-off-by: Stephen Crawford <[email protected]> Changes requested Signed-off-by: Stephen Crawford <[email protected]> retry Signed-off-by: Stephen Crawford <[email protected]> Try to resolve build issue Signed-off-by: Stephen Crawford <[email protected]> Update shas Signed-off-by: Stephen Crawford <[email protected]> Update licenses Signed-off-by: Stephen Crawford <[email protected]> Retry license fix Signed-off-by: Stephen Crawford <[email protected]> Retry licenses Signed-off-by: Stephen Crawford <[email protected]> Spotless Signed-off-by: Stephen Crawford <[email protected]> Remove old sha Signed-off-by: Stephen Crawford <[email protected]> Add basic into identity dependencies Signed-off-by: Stephen Crawford <[email protected]> Update SHAs Signed-off-by: Stephen Crawford <[email protected]> Add licenses Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Stephen Crawford <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
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.
@scrawfor99 Thank you for addressing PR comments. Looks like there are some unintended changes in identity/build.gradle. Can you please address those?
sandbox/libs/authn/src/main/java/org/opensearch/authn/internal/InternalSubject.java
Outdated
Show resolved
Hide resolved
sandbox/libs/authn/src/main/java/org/opensearch/authn/realm/InternalRealm.java
Outdated
Show resolved
Hide resolved
sandbox/modules/identity/src/main/java/org/opensearch/identity/SecurityRestFilter.java
Show resolved
Hide resolved
MatcherAssert.assertThat(e.getResponse().getStatusLine().getStatusCode(), equalTo(401)); | ||
} | ||
} | ||
} |
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.
@cwperks @scrawfor99 This test suite seems like a mix of Unit (lines 32-91) and Integration (lines 93-159) tests. Should we separate them out into two classes. Thoughts?
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.
Whatever people think is best seems fine with me. I see why you would separate them by test type, but I also get why keeping all the tests related to Bearer Auth stuff together is nice. Whichever is preferred I can do.
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.
Upon further review, I think it is best to leave things as-is for now. The primary reason being the dependency handling between authn
and identity
. Right now, identity
is dependent on authn
but all of the JwtVendor*
classes are in identity
. In order to move the unit tests over to the AuthenticationTokenHandlerTests
class we would need to make authn
dependent on identity
or move the AuthenticationTokenHandlerTests
.
If we end up combining authn
and identity
then this will no longer be an issue but for the time being it seems best to merge as-is and revisit down the road.
Signed-off-by: Stephen Crawford <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
@peternied Can you please review and merge this change once you get a chance? |
@cwperks I'm not sure if all your comments were fully addressed, happy to review follow up PRs or follow up issues if you'd still like to see more changes. |
@peternied, I believe all of @cwperks have been addressed. The only unresolved one that I am aware of is the potential merging of the identity and authn substructures which will require a separate initiative. |
Signed-off-by: Stephen Crawford [email protected]
Description
Adds bearer authentication support to the feature/identity branch of OpenSearch core. This implementation is built off of the existing Basic Authentication framework and includes testing.
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.