Skip to content

Commit

Permalink
[KYUUBI #6623] Support bearer token authentication on swagger UI
Browse files Browse the repository at this point in the history
# 🔍 Description
## Issue References 🔗

This pull request fixes #6623

## Describe Your Solution 🔧

This is a subtask of #6590
Followup of #6591

## Types of changes 🔖

- [ ] 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 ⚰️

#### Behavior With This Pull Request 🎉

#### 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

d94f950 [George314159] retest
7c38c63 [George314159] Support authorization on swagger UI

Authored-by: George314159 <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
  • Loading branch information
George314159 authored and turboFei committed Aug 17, 2024
1 parent a4390a7 commit 0165d5e
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand Down

0 comments on commit 0165d5e

Please sign in to comment.