File tree 3 files changed +17
-14
lines changed
3 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 1
- import { safeLoad } from 'js-yaml' ;
2
1
import { consoleFetchJSON } from '@openshift-console/dynamic-plugin-sdk' ;
2
+ import { safeLoad } from 'js-yaml' ;
3
3
4
4
export const API_PROXY_URL = '/api/dev-console/proxy/internet' ;
5
5
6
- type ProxyRequest = {
6
+ export type ProxyRequest = {
7
+ allowAuthHeader ?: boolean ;
7
8
allowInsecure ?: boolean ;
8
9
method : string ;
9
10
url : string ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export const getResultsSummary = async (
24
24
url,
25
25
method : 'GET' ,
26
26
allowInsecure : true ,
27
+ allowAuthHeader : true ,
27
28
} ) ;
28
29
29
30
return sData ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/no-explicit-any */
2
2
import {
3
+ k8sGet ,
3
4
K8sResourceCommon ,
4
5
MatchExpression ,
5
6
MatchLabels ,
6
7
Selector ,
7
- k8sGet ,
8
8
} from '@openshift-console/dynamic-plugin-sdk' ;
9
9
import _ from 'lodash' ;
10
10
import {
@@ -15,7 +15,11 @@ import {
15
15
import { RouteModel , TektonResultModel } from '../../models' ;
16
16
import { PipelineRunKind , TaskRunKind } from '../../types' ;
17
17
import { K8sResourceKind } from '../../types/openshift' ;
18
- import { consoleProxyFetch , consoleProxyFetchJSON } from './proxy' ;
18
+ import {
19
+ consoleProxyFetch ,
20
+ consoleProxyFetchJSON ,
21
+ ProxyRequest ,
22
+ } from './proxy' ;
19
23
20
24
// REST API spec
21
25
// https://github.com/tektoncd/results/blob/main/docs/api/rest-api-spec.md
@@ -63,15 +67,6 @@ export type TektonResultsOptions = {
63
67
groupBy ?: string ;
64
68
} ;
65
69
66
- type ProxyRequest = {
67
- allowInsecure ?: boolean ;
68
- method : string ;
69
- url : string ;
70
- headers ?: Record < string , string [ ] > ;
71
- queryparams ?: Record < string , string [ ] > ;
72
- body ?: string ;
73
- } ;
74
-
75
70
const throw404 = ( ) => {
76
71
// eslint-disable-next-line no-throw-literal
77
72
throw { code : 404 } ;
@@ -334,6 +329,7 @@ export const getFilteredRecord = async <R extends K8sResourceCommon>(
334
329
url,
335
330
method : 'GET' ,
336
331
allowInsecure : true ,
332
+ allowAuthHeader : true ,
337
333
} ) ;
338
334
if ( options ?. limit >= 0 ) {
339
335
list = {
@@ -489,5 +485,10 @@ export const getTaskRunLog = async (taskRunPath: string): Promise<string> => {
489
485
'/records/' ,
490
486
'/logs/' ,
491
487
) } `;
492
- return consoleProxyFetchLog ( { url, method : 'GET' , allowInsecure : true } ) ;
488
+ return consoleProxyFetchLog ( {
489
+ url,
490
+ method : 'GET' ,
491
+ allowInsecure : true ,
492
+ allowAuthHeader : true ,
493
+ } ) ;
493
494
} ;
You can’t perform that action at this time.
0 commit comments