From fe4f76945c88b565eb8b1306eaf38316725dd398 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Wed, 18 Nov 2026 13:33:09 +0100 Subject: [PATCH] Load the process output log without a token in the URL The log is fetched with HttpClient, which already sends the Authorization header, so the short-lived token query parameter is not needed. Co-Authored-By: Claude Opus 5.5 --- .../detail/process-detail.component.spec.ts | 3 +++ .../process-page/detail/process-detail.component.ts | 12 +++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app/process-page/detail/process-detail.component.spec.ts b/src/app/process-page/detail/process-detail.component.spec.ts index 9a0d89a8827..41e0436de99 100644 --- a/src/app/process-page/detail/process-detail.component.spec.ts +++ b/src/app/process-page/detail/process-detail.component.spec.ts @@ -215,6 +215,9 @@ describe('ProcessDetailComponent', () => { const outputProcess = fixture.debugElement.query(By.css('#process-output pre')); expect(outputProcess.nativeElement.textContent).toContain(processOutput); }); + it('should request the output logs without a token in the URL', () => { + expect((httpClient.get as jasmine.Spy).calls.mostRecent().args[0]).toBe('log-selflink'); + }); }); describe('if press show output logs and process has no output logs', () => { diff --git a/src/app/process-page/detail/process-detail.component.ts b/src/app/process-page/detail/process-detail.component.ts index be0b6ad0f64..051046b3bb8 100644 --- a/src/app/process-page/detail/process-detail.component.ts +++ b/src/app/process-page/detail/process-detail.component.ts @@ -16,7 +16,6 @@ import { getFirstSucceededRemoteData, getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; -import { URLCombiner } from '../../core/url-combiner/url-combiner'; import { AlertType } from '../../shared/alert/alert-type'; import { hasValue } from '../../shared/empty.util'; import { ProcessStatus } from '../processes/process-status.model'; @@ -55,7 +54,7 @@ export class ProcessDetailComponent implements OnInit, OnDestroy { filesRD$: Observable>>; /** - * File link that contain the output logs with auth token + * Link to the file that contains the output logs */ outputLogFileUrl$: Observable; @@ -203,13 +202,8 @@ export class ProcessDetailComponent implements OnInit, OnDestroy { this.showOutputLogs = true; } }), - switchMap((processOutput: RemoteData) => { - const url = processOutput.payload._links.content.href; - return this.authService.getShortlivedToken().pipe(take(1), - map((token: string) => { - return hasValue(token) ? new URLCombiner(url, `?authentication-token=${token}`).toString() : url; - })); - }) + // HttpClient sends the Authorization header, so the URL needs no token. + map((processOutput: RemoteData) => processOutput.payload._links.content.href) ); }); this.outputLogFileUrl$.pipe(take(1),