This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 14bf56f64f [KYUUBI #6709] Fix seq and set equals check bug while check 
auth type in AuthenticationFilter.initAuthHandlers
14bf56f64f is described below

commit 14bf56f64f9b16066465553397a1621af59da8d9
Author: lifulong <[email protected]>
AuthorDate: Thu Sep 26 10:09:20 2024 -0700

    [KYUUBI #6709] Fix seq and set equals check bug while check auth type in 
AuthenticationFilter.initAuthHandlers
    
    # :mag: 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 :bookmark:
    
    - [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 :coffin:
    <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 :tada:
    <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
    
    850bda4f3 [lifulong] fix seq and set equals check bug while check auth type 
in AuthenticationFilter.initAuthHandlers
    
    Authored-by: lifulong <[email protected]>
    Signed-off-by: Wang, Fei <[email protected]>
---
 .../apache/kyuubi/server/http/authentication/AuthenticationFilter.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala
 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala
index 423d239be4..1b4df7e3fa 100644
--- 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala
+++ 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala
@@ -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

Reply via email to