[KYUUBI #4622][UI] Session api use admin api for security

### _Why are the changes needed?_

Close #4622

Currently, we don't have a login for the UI, so we can't differentiate between users.

So, we currently maintain a cautious attitude towards the kyuubi ui open API(especially the ability to delete resources) and choose `AdminResource`, which helps us filter non-Admin requests (although the current strategy is not perfect, it is a safe and quick step).

Change api `api/v1/XXX` => `api/v1/admin/XXX`

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

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4631 from zwangsheng/KYUUBI_4622.

Closes #4622

3a611896f [zwangsheng] [KYUUBI #4622][UI] Session api use admin resource for security

Authored-by: zwangsheng <2213335496@qq.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
zwangsheng 2023-04-04 11:05:06 +08:00 committed by Cheng Pan
parent f0796ec078
commit 0c6ba94930
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D

View File

@ -19,14 +19,14 @@ import request from '@/utils/request'
export function getAllSessions() {
return request({
url: 'api/v1/sessions',
url: 'api/v1/admin/sessions',
method: 'get'
})
}
export function deleteSession(sessionId: string) {
return request({
url: `api/v1/sessions/${sessionId}`,
url: `api/v1/admin/sessions/${sessionId}`,
method: 'delete'
})
}