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

InternalRestClient respects kyuubi.engine.security.enabled to add HTTP auth header #5566

Closed
wants to merge 3 commits into from

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Oct 30, 2023

Why are the changes needed?

kyuubi.engine.security.enabled aims to control whether enabled security mechanism internal communication, but the current implementation is not symmetrical, the auth generator ignores the conf and always produces the auth header, but the auth header handler is only activated when conf is enabled, that causes authentication failure when kyuubi.engine.security.enabled=false(default value)

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

Was this patch authored or co-authored using generative AI tooling?

No.

@pan3793 pan3793 changed the title None auth InternalRestClient respects kyuubi.engine.security.enabled to add HTTP auth header Oct 30, 2023
@pan3793 pan3793 marked this pull request as ready for review October 30, 2023 17:22
@pan3793 pan3793 requested a review from turboFei October 31, 2023 01:58
@pan3793 pan3793 self-assigned this Oct 31, 2023
@pan3793 pan3793 added this to the v1.8.0 milestone Oct 31, 2023
@pan3793 pan3793 closed this in 5f53073 Oct 31, 2023
pan3793 added a commit that referenced this pull request Oct 31, 2023
…abled` to add HTTP auth header

### _Why are the changes needed?_

`kyuubi.engine.security.enabled` aims to control whether enabled security mechanism internal communication, but the current implementation is not symmetrical, the auth generator ignores the conf and always produces the auth header, but the auth header handler is only activated when conf is enabled, that causes authentication failure when `kyuubi.engine.security.enabled=false`(default value)

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No.

Closes #5566 from pan3793/none-auth.

Closes #5566

d42a4c3 [Cheng Pan] Revert "Extract AnonymousAuthenticationHandler from BasicAuthenticationHandler"
b544343 [Cheng Pan] Extract AnonymousAuthenticationHandler from BasicAuthenticationHandler
75c4b7d [Cheng Pan] InternalRestClient respects `kyuubi.engine.security.enabled` to add HTTP auth header

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 5f53073)
Signed-off-by: Cheng Pan <chengpan@apache.org>
@pan3793
Copy link
Member Author

pan3793 commented Oct 31, 2023

Merged to master/1.8

pan3793 added a commit to pan3793/kyuubi that referenced this pull request Nov 1, 2023
…ialized only when `kyuubi.engine.security.enabled` is true
pan3793 added a commit that referenced this pull request Nov 1, 2023
…d only when `kyuubi.engine.security.enabled` is true

### _Why are the changes needed?_

Internal REST client should work when `kyuubi.engine.security.enabled` is `true`/`false`.

The changes in #5566 is not sufficient.

`KyuubiRestAuthenticationSuite` covers the `true` case

`BatchesV1ResourceSuite` and `BatchesV2ResourceSuite` cover the `false` case

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No.

Closes #5601 from pan3793/5566-followup.

Closes #5566

abb7106 [Cheng Pan] test
3f9e735 [Cheng Pan] [KYUUBI #5566][FOLLOWUP] Check InternalSecurityAccessor is initialized only when `kyuubi.engine.security.enabled` is true

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
pan3793 added a commit that referenced this pull request Nov 1, 2023
…d only when `kyuubi.engine.security.enabled` is true

### _Why are the changes needed?_

Internal REST client should work when `kyuubi.engine.security.enabled` is `true`/`false`.

The changes in #5566 is not sufficient.

`KyuubiRestAuthenticationSuite` covers the `true` case

`BatchesV1ResourceSuite` and `BatchesV2ResourceSuite` cover the `false` case

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No.

Closes #5601 from pan3793/5566-followup.

Closes #5566

abb7106 [Cheng Pan] test
3f9e735 [Cheng Pan] [KYUUBI #5566][FOLLOWUP] Check InternalSecurityAccessor is initialized only when `kyuubi.engine.security.enabled` is true

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 28fb0a7)
Signed-off-by: Cheng Pan <chengpan@apache.org>
YesOrNo828 pushed a commit to YesOrNo828/kyuubi that referenced this pull request Nov 6, 2023
…ialized only when `kyuubi.engine.security.enabled` is true

### _Why are the changes needed?_

Internal REST client should work when `kyuubi.engine.security.enabled` is `true`/`false`.

The changes in apache#5566 is not sufficient.

`KyuubiRestAuthenticationSuite` covers the `true` case

`BatchesV1ResourceSuite` and `BatchesV2ResourceSuite` cover the `false` case

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No.

Closes apache#5601 from pan3793/5566-followup.

Closes apache#5566

abb7106 [Cheng Pan] test
3f9e735 [Cheng Pan] [KYUUBI apache#5566][FOLLOWUP] Check InternalSecurityAccessor is initialized only when `kyuubi.engine.security.enabled` is true

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
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.

None yet

2 participants