Skip to content

Commit 60d559e

Browse files
lightning-LturboFei
authored andcommitted
[KYUUBI #2763] Expected error code for invalid basic/spnego authentication should be SC_FORBIDDEN
### _Why are the changes needed?_ To close #2763 ### _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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2771 from lightning-L/kyuubi-2763. Closes #2763 03300aa [Tianlin Liao] [KYUUBI #2763] expected error code for invalid basic/spnego authentication should be SC_FORBIDDEN Authored-by: Tianlin Liao <tiliao@ebay.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
1 parent a827016 commit 60d559e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
package org.apache.kyuubi.server.http.authentication
1919

2020
import java.io.IOException
21+
import javax.security.sasl.AuthenticationException
2122
import javax.servlet.{Filter, FilterChain, FilterConfig, ServletException, ServletRequest, ServletResponse}
2223
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
2324

2425
import scala.collection.mutable.HashMap
2526

26-
import org.apache.hadoop.security.authentication.client.AuthenticationException
27-
2827
import org.apache.kyuubi.Logging
2928
import org.apache.kyuubi.config.KyuubiConf
3029
import org.apache.kyuubi.config.KyuubiConf.AUTHENTICATION_METHOD

kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiRestAuthenticationSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class KyuubiRestAuthenticationSuite extends RestFrontendTestHelper with Kerberiz
103103
.header(AUTHORIZATION_HEADER, s"BASIC $encodeAuthorization")
104104
.get()
105105

106-
assert(HttpServletResponse.SC_INTERNAL_SERVER_ERROR == response.getStatus)
106+
assert(HttpServletResponse.SC_FORBIDDEN == response.getStatus)
107107
}
108108

109109
test("test without authorization") {
@@ -135,7 +135,7 @@ class KyuubiRestAuthenticationSuite extends RestFrontendTestHelper with Kerberiz
135135
.header(AUTHORIZATION_HEADER, s"NEGOTIATE $encodeAuthorization")
136136
.get()
137137

138-
assert(HttpServletResponse.SC_INTERNAL_SERVER_ERROR == response.getStatus)
138+
assert(HttpServletResponse.SC_FORBIDDEN == response.getStatus)
139139
}
140140

141141
test("test with not supported auth scheme") {

0 commit comments

Comments
 (0)