Skip to content

Commit

Permalink
[KYUUBI #6709] Fix seq and set equals check bug while check auth type…
Browse files Browse the repository at this point in the history
… in AuthenticationFilter.initAuthHandlers

# 🔍 Description
## Issue References 🔗

This pull request fixes #6709

## Describe Your Solution 🔧

transfer the type of authTypes from seq to set before do equals check

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪
test in our produce kyuubi env
#### Behavior Without This Pull Request ⚰️
<img width="1431" alt="image" src="https://github.com/user-attachments/assets/6fd40d49-8d6b-446a-8feb-70df8c92604d">
<img width="603" alt="image" src="https://github.com/user-attachments/assets/637e5788-bfe0-4bab-a2a5-f6a79fb93fa6">

always hint to login  in all sub tabs of management tab in kyuubi web ui, but can not login in actually, while use confkyuubi.authentication NOSASL, and our java version is 1.8 scala version is 2.12.18
#### Behavior With This Pull Request 🎉
<img width="1422" alt="image" src="https://github.com/user-attachments/assets/211b76ee-d937-456b-bed4-f94dd41896f0">

#### Related Unit Tests

none, no need i think
---

# Checklist 📝

- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6711 from lifulong/authentication_filter_auth_type_bug_fix.

Closes #6709

850bda4 [lifulong] fix seq and set equals check bug while check auth type in AuthenticationFilter.initAuthHandlers

Authored-by: lifulong <gglifulong@163.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
  • Loading branch information
lifulong authored and turboFei committed Sep 26, 2024
1 parent 9ef38b9 commit 14bf56f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
val authTypes = conf.get(AUTHENTICATION_METHOD).map(AuthTypes.withName)
val spnegoKerberosEnabled = authTypes.contains(KERBEROS)
val basicAuthTypeOpt = {
if (authTypes == Set(NOSASL)) {
if (authTypes.toSet == Set(NOSASL)) {
authTypes.headOption
} else {
authTypes.filterNot(_.equals(KERBEROS)).filterNot(_.equals(NOSASL)).headOption
Expand Down

0 comments on commit 14bf56f

Please sign in to comment.