mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 10:18:39 +00:00
[dashboard] fix listing namespaces as unprivileged user
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
@@ -7,6 +7,9 @@ WORKDIR /src
|
||||
ARG COMMIT_REF=22f9143f5109fb90332651c857d70b51bffccd9b
|
||||
RUN wget -O- https://github.com/PRO-Robotech/openapi-ui-k8s-bff/archive/${COMMIT_REF}.tar.gz | tar xzf - --strip-components=1
|
||||
|
||||
COPY patches /patches
|
||||
RUN git apply /patches/*.diff
|
||||
|
||||
ENV PATH=/src/node_modules/.bin:$PATH
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
diff --git a/src/endpoints/forms/formPrepare/formPrepare.ts b/src/endpoints/forms/formPrepare/formPrepare.ts
|
||||
index 7e437db..90c40f6 100644
|
||||
--- a/src/endpoints/forms/formPrepare/formPrepare.ts
|
||||
+++ b/src/endpoints/forms/formPrepare/formPrepare.ts
|
||||
@@ -15,6 +15,7 @@ export const prepareFormProps: RequestHandler = async (req: TPrepareFormReq, res
|
||||
|
||||
const filteredHeaders = { ...req.headers }
|
||||
delete filteredHeaders['host'] // Avoid passing internal host header
|
||||
+ delete filteredHeaders['content-length'] // This header causes "stream has been aborted"
|
||||
|
||||
const { data: formsOverridesData } = await userKubeApi.get<TFormsOverridesData>(
|
||||
`/apis/${BASE_API_GROUP}/${BASE_API_VERSION}/customformsoverrides`,
|
||||
@@ -40,7 +41,7 @@ export const prepareFormProps: RequestHandler = async (req: TPrepareFormReq, res
|
||||
},
|
||||
)
|
||||
|
||||
- const { data: namespacesData } = await userKubeApi.get<TBuiltinResources>(`/api/v1/namespaces`, {
|
||||
+ const { data: namespacesData } = await userKubeApi.get<TBuiltinResources>(`/apis/core.cozystack.io/v1alpha1/tenantnamespaces`, {
|
||||
headers: {
|
||||
// Authorization: `Bearer ${bearerToken}`,
|
||||
// Cookie: cookies,
|
||||
Reference in New Issue
Block a user