Skip to content

Commit

Permalink
slurm-web: add patch for racksdb bearer token bug
Browse files Browse the repository at this point in the history
For reference: rackslab/Slurm-web#471
  • Loading branch information
rezib committed Feb 11, 2025
1 parent 78a96a6 commit 5174cb3
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 3 deletions.
4 changes: 2 additions & 2 deletions slurm-web/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ derivatives:
main: 4.1.0
slurmweb-3: 3.2.0
rpm:
release: 1
release: 2
deb:
release: 1
release: 2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Author: Rémi Palancher <[email protected]>


diff --git a/slurmweb/apps/gateway.py b/slurmweb/apps/gateway.py
index eacf17d..a11331e 100644
index f7abbf1..6f90eaf 100644
--- a/slurmweb/apps/gateway.py
+++ b/slurmweb/apps/gateway.py
@@ -5,6 +5,7 @@
Expand Down
20 changes: 20 additions & 0 deletions slurm-web/patches/3.2.0/0002-racksdb-bearer-token
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Send bearer token in headers of RacksDB diagram request,
as required with RFL >= 1.3.0.
Last-Update: 2025-02-10
Author: Rémi Palancher <[email protected]>
Forwarded: https://github.com/rackslab/Slurm-web/issues/471


diff --git a/frontend/src/composables/GatewayAPI.ts b/frontend/src/composables/GatewayAPI.ts
index 2135797..e837dad 100644
--- a/frontend/src/composables/GatewayAPI.ts
+++ b/frontend/src/composables/GatewayAPI.ts
@@ -532,7 +532,7 @@ export function useGatewayAPI() {
dimensions: { width: width, height: height },
infrastructure: { equipment_labels: false, ghost_unselected: true }
},
- false,
+ true,
'arraybuffer'
)
// parse multipart response with Response.formData()
47 changes: 47 additions & 0 deletions slurm-web/patches/4.1.0/0001-racksdb-bearer-token
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Description: Send bearer token in headers of RacksDB diagram request,
as required with RFL >= 1.3.0.
Last-Update: 2025-02-10
Author: Rémi Palancher <[email protected]>
Forwarded: https://github.com/rackslab/Slurm-web/issues/471


diff --git a/frontend/src/composables/GatewayAPI.ts b/frontend/src/composables/GatewayAPI.ts
index f4780e8..8ed0d2a 100644
--- a/frontend/src/composables/GatewayAPI.ts
+++ b/frontend/src/composables/GatewayAPI.ts
@@ -456,7 +456,7 @@ export function useGatewayAPI() {

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

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

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

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

0 comments on commit 5174cb3

Please sign in to comment.