Skip to content

Commit 841a363

Browse files
committed
[KYUUBI #2549] Do not auth the request to load OpenApiConf
### _Why are the changes needed?_ <img width="1493" alt="image" src="https://user-images.githubusercontent.com/6757692/166658613-12f2f10a-65f7-41b3-82c8-ff2059786e10.png"> ### _How was this patch tested?_ - [x] 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](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2549 from turboFei/only_auth_v1. Closes #2549 db19ec6 [Fei Wang] only auth the v1 api 72c6f91 [Fei Wang] Only auth v1 Authored-by: Fei Wang <fwang12@ebay.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
1 parent 672e8e9 commit 841a363

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class KyuubiRestFrontendService(override val serverable: Serverable)
6262
private def startInternal(): Unit = {
6363
val contextHandler = ApiRootResource.getServletHandler(this)
6464
val holder = new FilterHolder(new AuthenticationFilter(conf))
65-
contextHandler.addFilter(holder, "/*", EnumSet.allOf(classOf[DispatcherType]))
65+
contextHandler.addFilter(holder, "/v1/*", EnumSet.allOf(classOf[DispatcherType]))
6666
val authenticationFactory = new KyuubiHttpAuthenticationFactory(conf)
6767
server.addHandler(authenticationFactory.httpHandlerWrapperFactory.wrapHandler(contextHandler))
6868

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ class KyuubiRestAuthenticationSuite extends RestFrontendTestHelper with Kerberiz
147147
test("test with non-authentication path") {
148148
val response = webTarget.path("swagger").request().get()
149149
assert(HttpServletResponse.SC_OK == response.getStatus)
150+
151+
val openApiResponse = webTarget.path("api/openapi.json").request().get()
152+
assert(HttpServletResponse.SC_OK == openApiResponse.getStatus)
150153
}
151154

152155
test("test with ugi wrapped open session") {

0 commit comments

Comments
 (0)