From a58bff9d119b1b9ad60ba700699b58999bb53ffb Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Thu, 9 Jan 2025 19:30:01 +0100 Subject: [PATCH 1/2] Patch api v1 21 0 (#2932) * fix(chalice): fixes for SSO * fix(chalice): changed base image * fix(chalice): changed requirements (cherry picked from commit c8775f3c155deeccfecec4a053cfede5bb6b2ead) --- ee/api/Dockerfile | 7 ++----- ee/api/Pipfile | 28 ++++++++++++++-------------- ee/api/requirements.txt | 28 ++++++++++++++-------------- 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/ee/api/Dockerfile b/ee/api/Dockerfile index 35e7149f5..f15d68569 100644 --- a/ee/api/Dockerfile +++ b/ee/api/Dockerfile @@ -12,12 +12,9 @@ ENV SOURCE_MAP_VERSION=0.7.4 \ WORKDIR /work COPY requirements.txt ./requirements.txt -# Caching the source build -#RUN pip install --no-cache-dir --upgrade uv -#RUN uv pip install --no-cache-dir --upgrade pip setuptools wheel --system -#RUN uv pip install --no-cache-dir --upgrade python3-saml==1.16.0 --no-binary=lxml --system -#RUN uv pip install --no-cache-dir --upgrade -r requirements.txt --system RUN pip install --no-cache-dir --upgrade -r requirements.txt +# This code is used to solve 'lxml & xmlsec libxml2 library version mismatch' error +RUN pip uninstall -y lxml && pip install lxml COPY . . RUN mv env.default .env diff --git a/ee/api/Pipfile b/ee/api/Pipfile index 73ed3bddf..df07b14ca 100644 --- a/ee/api/Pipfile +++ b/ee/api/Pipfile @@ -4,27 +4,27 @@ verify_ssl = true name = "pypi" [packages] -urllib3 = "==2.2.3" +urllib3 = "==1.26.16" requests = "==2.32.3" -boto3 = "==1.35.86" -pyjwt = "==2.10.1" +boto3 = "==1.35.60" +pyjwt = "==2.9.0" psycopg2-binary = "==2.9.10" -psycopg = {extras = ["pool", "binary"], version = "==3.2.3"} -clickhouse-driver = {extras = ["lz4"], version = "==0.2.9"} -clickhouse-connect = "==0.8.11" -elasticsearch = "==8.17.0" +psycopg = {extras = ["binary", "pool"], version = "==3.2.3"} +elasticsearch = "==8.16.0" jira = "==3.8.0" cachetools = "==5.5.0" -fastapi = "==0.115.6" -uvicorn = {extras = ["standard"], version = "==0.34.0"} +fastapi = "==0.115.5" +uvicorn = {extras = ["standard"], version = "==0.32.0"} gunicorn = "==23.0.0" python-decouple = "==3.8" -pydantic = {extras = ["email"], version = "==2.10.4"} -apscheduler = "==3.11.0" -redis = "==5.2.1" +pydantic = {extras = ["email"], version = "==2.9.2"} +apscheduler = "==3.10.4" +clickhouse-driver = {extras = ["lz4"], version = "==0.2.9"} +lxml = "!=4.7.0,<=5.2.1,>=4.6.5" python3-saml = "==1.16.0" -python-multipart = "==0.0.20" -azure-storage-blob = "==12.24.0" +python-multipart = "==0.0.17" +redis = "==5.2.0" +azure-storage-blob = "==12.23.1" [dev-packages] diff --git a/ee/api/requirements.txt b/ee/api/requirements.txt index 43b788f6a..7b849d9fe 100644 --- a/ee/api/requirements.txt +++ b/ee/api/requirements.txt @@ -1,30 +1,30 @@ -urllib3==2.2.3 +# Keep this version to not have conflicts between requests and boto3 +urllib3==1.26.16 requests==2.32.3 -boto3==1.35.86 -pyjwt==2.10.1 +boto3==1.35.60 +pyjwt==2.9.0 psycopg2-binary==2.9.10 psycopg[pool,binary]==3.2.3 -clickhouse-driver[lz4]==0.2.9 -clickhouse-connect==0.8.11 -elasticsearch==8.17.0 +elasticsearch==8.16.0 jira==3.8.0 cachetools==5.5.0 -fastapi==0.115.6 -uvicorn[standard]==0.34.0 +fastapi==0.115.5 +uvicorn[standard]==0.32.0 gunicorn==23.0.0 python-decouple==3.8 -pydantic[email]==2.10.4 -apscheduler==3.11.0 - -redis==5.2.1 +pydantic[email]==2.9.2 +apscheduler==3.10.4 +clickhouse-driver[lz4]==0.2.9 # TODO: enable after xmlsec fix https://github.com/xmlsec/python-xmlsec/issues/252 #--no-binary is used to avoid libxml2 library version incompatibilities between xmlsec and lxml +lxml >= 4.6.5, !=4.7.0, <=5.2.1 python3-saml==1.16.0 --no-binary=lxml -python-multipart==0.0.20 +python-multipart==0.0.17 +redis==5.2.0 #confluent-kafka==2.1.0 -azure-storage-blob==12.24.0 +azure-storage-blob==12.23.1 From 9ee853365c7938bae9add64db6e8fe48f5eed2ca Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 13 Jan 2025 13:47:58 +0100 Subject: [PATCH 2/2] fix(ui): user invitation --- .../ForgotPassword/CreatePassword.tsx | 10 ++------- frontend/app/mstore/userStore.ts | 2 ++ frontend/app/services/UserService.ts | 22 ++++++++++++++----- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/frontend/app/components/ForgotPassword/CreatePassword.tsx b/frontend/app/components/ForgotPassword/CreatePassword.tsx index 17193828e..a943da41c 100644 --- a/frontend/app/components/ForgotPassword/CreatePassword.tsx +++ b/frontend/app/components/ForgotPassword/CreatePassword.tsx @@ -32,13 +32,7 @@ function CreatePassword(props: Props) { if (!validatePassword(password)) { return; } - resetPassword({ invitation, pass, password }).then((response: any) => { - if (response && response.errors && response.errors.length > 0) { - setError(response.errors[0]); - } else { - setUpdated(true); - } - }); + void resetPassword({ invitation, pass, password }); }; const onSubmit = (e: any) => { @@ -102,7 +96,7 @@ function CreatePassword(props: Props) { /> - + { this.account = new Account(data.user); + this.jwt = data.jwt; + this.spotJwt = data.spotJwt; }); } catch (error) { toast.error('Error resetting your password; please try again'); diff --git a/frontend/app/services/UserService.ts b/frontend/app/services/UserService.ts index ca8886217..1dabe0e00 100644 --- a/frontend/app/services/UserService.ts +++ b/frontend/app/services/UserService.ts @@ -136,11 +136,23 @@ export default class UserService { .then((response: { data: any }) => response as Record || {}); } - resetPassword(data: any) { - return this.client - .post('/password/reset', data) - .then((response: { json: () => any }) => response.json()) - .then((response: { data: any }) => response.data || {}); + async resetPassword(data: any) { + try { + const response = await this.client.post('/password/reset', data); + const responseData = await response.json(); + if (responseData.errors) { + throw new Error(responseData.errors[0] || 'An unexpected error occurred.'); + } + + return responseData || {}; + } catch (error: any) { + if (error.response) { + const errorData = await error.response.json(); + const errorMessage = errorData.errors ? errorData.errors[0] : 'An unexpected error occurred.'; + throw new Error(errorMessage); + } + throw new Error('An unexpected error occurred.'); + } } async requestResetPassword(data: any) {