Skip to content

Commit a3a7b2f

Browse files
committed
fix(front): add bearer token in racksdb request
Add missing bearer token in RacksDB infrastructure diagram request, it is now required by @check_jwt decorator on the gateway endpoint with RFL >= 1.3.0 to avoid HTTP/403 response. The token is removed from request headers for login (incl. anonymous) and login service message at the same time, as the client does not have JWT at this stage yet and the gateway does not enforce the presence of the bearer token for the corresponding endpoints. fix #471
1 parent 8a65597 commit a3a7b2f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [unreleased]
9+
10+
### Fixed
11+
- front: missing bearer token in RacksDB infrastructure diagram request (#471).
12+
813
## [4.1.0] - 2025-02-05
914

1015
### Added

frontend/src/composables/GatewayAPI.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ export function useGatewayAPI() {
456456

457457
async function login(idents: loginIdents): Promise<GatewayLoginResponse> {
458458
try {
459-
return (await restAPI.post('/login', idents)) as GatewayLoginResponse
459+
return (await restAPI.post('/login', idents, false)) as GatewayLoginResponse
460460
} catch (error: any) {
461461
/* Translate 401 APIServerError into AuthenticationError */
462462
if (error instanceof APIServerError && error.status == 401) {
@@ -468,7 +468,7 @@ export function useGatewayAPI() {
468468

469469
async function anonymousLogin(): Promise<GatewayAnonymousLoginResponse> {
470470
try {
471-
return (await restAPI.get('/anonymous')) as GatewayAnonymousLoginResponse
471+
return (await restAPI.get('/anonymous', false)) as GatewayAnonymousLoginResponse
472472
} catch (error: any) {
473473
/* Translate 401 APIServerError into AuthenticationError */
474474
if (error instanceof APIServerError && error.status == 401) {
@@ -479,7 +479,7 @@ export function useGatewayAPI() {
479479
}
480480

481481
async function message_login(): Promise<string> {
482-
return await restAPI.get<string>(`/messages/login`)
482+
return await restAPI.get<string>('/messages/login', false)
483483
}
484484

485485
async function clusters(): Promise<Array<ClusterDescription>> {
@@ -567,7 +567,7 @@ export function useGatewayAPI() {
567567
dimensions: { width: width, height: height },
568568
infrastructure: { equipment_labels: false, ghost_unselected: true }
569569
},
570-
false,
570+
true,
571571
'arraybuffer'
572572
)
573573
// parse multipart response with Response.formData()

0 commit comments

Comments
 (0)