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 0165d5e3a2 [KYUUBI #6623] Support bearer token authentication on
swagger UI
0165d5e3a2 is described below
commit 0165d5e3a26cc8353a9f7135e8fa4a9c4ae99e78
Author: George314159 <[email protected]>
AuthorDate: Fri Aug 16 21:33:45 2024 -0700
[KYUUBI #6623] Support bearer token authentication on swagger UI
# :mag: Description
## Issue References ๐
This pull request fixes #6623
## Describe Your Solution ๐ง
This is a subtask of #6590
Followup of #6591
## Types of changes :bookmark:
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
#### Related Unit Tests
---
# Checklist ๐
- [x] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6625 from George314159/swagger.
Closes #6623
d94f950c9 [George314159] retest
7c38c63fb [George314159] Support authorization on swagger UI
Authored-by: George314159 <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
---
.../apache/kyuubi/server/api/v1/KyuubiOpenApiResource.scala | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/KyuubiOpenApiResource.scala
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/KyuubiOpenApiResource.scala
index 37025eace5..e5f52c0fe3 100644
---
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/KyuubiOpenApiResource.scala
+++
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/KyuubiOpenApiResource.scala
@@ -105,8 +105,16 @@ class KyuubiOpenApiResource extends BaseOpenApiResource
with ApiRequestContext {
"BasicAuth",
new SecurityScheme()
.`type`(SecurityScheme.Type.HTTP)
- .scheme("Basic")))
- .addSecurityItem(new SecurityRequirement().addList("BasicAuth"))
+ .scheme("Basic"))
+ .addSecuritySchemes(
+ "BearerAuth",
+ new SecurityScheme()
+ .`type`(SecurityScheme.Type.HTTP)
+ .scheme("Bearer")
+ .bearerFormat("JWT")))
+ .addSecurityItem(new SecurityRequirement()
+ .addList("BasicAuth")
+ .addList("BearerAuth"))
}
}