Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cd9d7a3
feat: add Litestar framework support and related middleware
pythonhubdev May 23, 2025
d357331
feat: update Litestar middleware integration and enhance session hand…
pythonhubdev May 23, 2025
dc72b14
feat: add Litestar framework integration with SuperTokens and setup e…
pythonhubdev May 23, 2025
b9a3670
feat: add Litestar framework integration with SuperTokens and setup e…
pythonhubdev May 23, 2025
9861460
feat: refactor Litestar framework integration and update middleware i…
pythonhubdev May 27, 2025
a8512ef
fix: un-intentional refactor and rebase with main
pythonhubdev Oct 29, 2025
6da31bb
feat: refactor Litestar framework integration and update middleware i…
pythonhubdev Oct 29, 2025
035f967
fix: remove .venv folder since it was accidentaly pushed
pythonhubdev Oct 29, 2025
273f0a3
feat: update Litestar framework integration with new request and resp…
pythonhubdev Oct 29, 2025
7af0429
feat: update dependencies and add licensing information
pythonhubdev Oct 30, 2025
8f63a59
feat: integrate SuperTokens middleware and plugin for Litestar framework
pythonhubdev Nov 1, 2025
f9d71ca
feat: add exception handling for SuperTokens in Litestar framework
pythonhubdev Nov 1, 2025
c933915
feat: enhance documentation and improve type hints in Litestar integr…
pythonhubdev Nov 1, 2025
0429345
feat: add Litestar integration with SuperTokens and enhance testing s…
pythonhubdev Nov 17, 2025
08248af
feat: add Litestar integration with SuperTokens and enhance testing s…
pythonhubdev Nov 17, 2025
067d9d5
fix: update black version to latest
pythonhubdev Nov 22, 2025
ada3cfb
fix: get-versions-action to get-versions-from-repo
pythonhubdev Nov 24, 2025
9c7a049
fix: revert all version similar to base branch
pythonhubdev Nov 24, 2025
a760e57
feat: enhance type hints and improve version fetching in CI workflows
pythonhubdev Nov 24, 2025
da87e7f
fix: update user context test assertion and adjust Litestar framework…
pythonhubdev Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .circleci/authReactLitestar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
echo "Starting tests for FDI $1";

if [ -z "$SUPERTOKENS_API_KEY" ]; then
echo "SUPERTOKENS_API_KEY not set"
exit 1
fi
frontendDriverVersion=$1
frontendDriverVersion=`echo $frontendDriverVersion | tr -d '"'`
if [[ $frontendDriverVersion == '1.0' ]]; then
exit 0
fi

coreDriverJson=`cat ../coreDriverInterfaceSupported.json`
coreDriverLength=`echo $coreDriverJson | jq ".versions | length"`
coreDriverArray=`echo $coreDriverJson | jq ".versions"`
coreDriverVersion=`echo $coreDriverArray | jq ". | last"`
coreDriverVersion=`echo $coreDriverVersion | tr -d '"'`
coreFree=`curl -s -X GET \
"https://api.supertokens.io/0/core-driver-interface/dependency/core/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$coreDriverVersion&driverName=python" \
-H 'api-version: 1'`
if [[ `echo $coreFree | jq .core` == "null" ]]
then
echo "fetching latest X.Y version for core given core-driver-interface X.Y version: $coreDriverVersion, planType: FREE gave response: $coreFree. Please make sure all relevant cores have been pushed."
exit 1
fi
coreFree=$(echo $coreFree | jq .core | tr -d '"')


frontendVersionXY=`curl -s -X GET \
"https://api.supertokens.io/0/frontend-driver-interface/dependency/frontend/latest?password=$SUPERTOKENS_API_KEY&frontendName=website&mode=DEV&version=$frontendDriverVersion&driverName=python" \
-H 'api-version: 1'`
if [[ `echo $frontendVersionXY | jq .frontend` == "null" ]]
then
echo "fetching latest X.Y version for frontend given frontend-driver-interface X.Y version: $frontendDriverVersion, name: webiste gave response: $frontend. Please make sure all relevant versions have been pushed."
exit 1
fi
frontendVersionXY=$(echo $frontendVersionXY | jq .frontend | tr -d '"')

frontendInfo=`curl -s -X GET \
"https://api.supertokens.io/0/driver/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$frontendVersionXY&name=website" \
-H 'api-version: 0'`
if [[ `echo $frontendInfo | jq .tag` == "null" ]]
then
echo "fetching latest X.Y.Z version for frontend, X.Y version: $frontendVersionXY gave response: $frontendInfo"
exit 1
fi
frontendTag=$(echo $frontendInfo | jq .tag | tr -d '"')
frontendVersion=$(echo $frontendInfo | jq .version | tr -d '"')

nodeVersionXY=`curl -s -X GET \
"https://api.supertokens.io/0/frontend-driver-interface/dependency/driver/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$frontendDriverVersion&driverName=node&frontendName=auth-react" \
-H 'api-version: 1'`
if [[ `echo $nodeVersionXY | jq .driver` == "null" ]]
then
echo "fetching latest X.Y version for driver given frontend-driver-interface X.Y version: $frontendDriverVersion gave response: $nodeVersionXY. Please make sure all relevant drivers have been pushed."
exit 1
fi
nodeVersionXY=$(echo $nodeVersionXY | jq .driver | tr -d '"')

nodeInfo=`curl -s -X GET \
"https://api.supertokens.io/0/driver/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$nodeVersionXY&name=node" \
-H 'api-version: 0'`
if [[ `echo $nodeInfo | jq .tag` == "null" ]]
then
echo "fetching latest X.Y.Z version for driver, X.Y version: $nodeVersionXY gave response: $nodeInfo"
exit 1
fi
nodeTag=$(echo $nodeInfo | jq .tag | tr -d '"')

frontendAuthReactVersionXY=`curl -s -X GET \
"https://api.supertokens.io/0/frontend-driver-interface/dependency/frontend/latest?password=$SUPERTOKENS_API_KEY&frontendName=auth-react&mode=DEV&version=$frontendDriverVersion&driverName=python" \
-H 'api-version: 1'`
if [[ `echo $frontendAuthReactVersionXY | jq .frontend` == "null" ]]
then
echo "fetching latest X.Y version for frontend given frontend-driver-interface X.Y version: $frontendDriverVersion, name: auth-react gave response: $frontend. Please make sure all relevant frontend libs have been pushed."
exit 1
fi
frontendAuthReactVersionXY=$(echo $frontendAuthReactVersionXY | jq .frontend | tr -d '"')

frontendAuthReactInfo=`curl -s -X GET \
"https://api.supertokens.io/0/driver/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$frontendAuthReactVersionXY&name=auth-react" \
-H 'api-version: 0'`
if [[ `echo $frontendAuthReactInfo | jq .tag` == "null" ]]
then
echo "fetching latest X.Y.Z version for frontend, X.Y version: $frontendAuthReactVersionXY gave response: $frontendAuthReactInfo"
exit 1
fi
frontendAuthReactTag=$(echo $frontendAuthReactInfo | jq .tag | tr -d '"')
frontendAuthReactVersion=$(echo $frontendAuthReactInfo | jq .version | tr -d '"')

if [[ $frontendDriverVersion == '1.3' || $frontendDriverVersion == '1.8' ]]; then
# we skip this since the tests for auth-react here are not reliable due to race conditions...

# we skip 1.8 since the SDK with just 1.8 doesn't have the right scripts
exit 0
else
./setupAndTestWithAuthReactWithLitestar.sh $coreFree $frontendAuthReactTag $nodeTag
if [[ $? -ne 0 ]]
then
echo "test failed for auth-react tests... exiting!"
exit 1
fi
fi
85 changes: 85 additions & 0 deletions .circleci/config_continue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,28 @@ jobs:
- run: make with-fastapi
- run: (cd .circleci/ && ./websiteFastApi.sh << parameters.fdi-version >>)
- slack/status
test-website-litestar:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
type: string
python-version:
type: string
parallelism: 4
steps:
- checkout
- run: apt update && apt install -y bc jq lsof libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libgconf-2-4 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 libxss1 libasound2 libxshmfence1 xvfb
- run: (cd .circleci/ && ./installJava.sh)
- run: (cd .circleci/ && ./installNode.sh 20)
- run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
- run: python3 -m pip install pip setuptools --upgrade
- run: make with-litestar
- run: (cd .circleci/ && ./websiteLitestar.sh << parameters.fdi-version >>)
- slack/status
test-website-flask:
docker:
- image: python:<< parameters.python-version >>
Expand Down Expand Up @@ -309,6 +331,39 @@ jobs:
- store_artifacts:
path: ~/test_report/react-logs
destination: react-logs
test-authreact-litestar:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
environment:
MOCHA_FILE: /root/test_report/report_node-<< parameters.fdi-version >>.xml
parameters:
fdi-version:
type: string
python-version:
type: string
parallelism: 4
steps:
- checkout
- attach_workspace:
at: /
- run: apt update && apt install -y bc jq lsof libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libgconf-2-4 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 libxss1 libasound2 libxshmfence1 xvfb
- run: (cd .circleci/ && ./installJava.sh)
- run: (cd .circleci/ && ./installNode.sh 20)
- run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
- run: python3 -m pip install pip setuptools --upgrade
- run: make with-litestar
- run: (cd .circleci && ./authReactLitestar.sh << parameters.fdi-version >>)
- store_test_results:
path: /root/test_report/report_node-<< parameters.fdi-version >>.xml
- store_artifacts:
path: ~/test_report/screenshots
destination: screenshots
- store_artifacts:
path: ~/test_report/react-logs
destination: react-logs
test-success:
docker:
- image: rishabhpoddar/supertokens_python_driver_testing
Expand Down Expand Up @@ -370,6 +425,20 @@ workflows:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
only: /test-cicd\/.*/
- test-website-litestar:
requires:
- test-dev-tag-as-not-passed
context:
- slack-notification
matrix:
parameters:
fdi-version: placeholder
python-version: ['3.8', '3.13']
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
only: /test-cicd\/.*/
- test-website-flask:
requires:
- test-dev-tag-as-not-passed
Expand Down Expand Up @@ -482,11 +551,26 @@ workflows:
parameters:
fdi-version: placeholder
python-version: ['3.8', '3.13']
- test-authreact-litestar:
requires:
- test-dev-tag-as-not-passed
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
only: /test-cicd\/.*/
matrix:
parameters:
fdi-version: placeholder
python-version: ['3.8', '3.13']
- test-success:
requires:
- test-unit
- test-backend-sdk-testing
- test-website-fastapi
- test-website-litestar
- test-website-flask
- test-website-django
- test-website-drf-async
Expand All @@ -495,6 +579,7 @@ workflows:
- test-authreact-fastapi
- test-authreact-flask
- test-authreact-django
- test-authreact-litestar
context:
- slack-notification
filters:
Expand Down
Empty file.
99 changes: 99 additions & 0 deletions .circleci/websiteLitestar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
coreDriverJson=`cat ../coreDriverInterfaceSupported.json`
coreDriverLength=`echo $coreDriverJson | jq ".versions | length"`
coreDriverArray=`echo $coreDriverJson | jq ".versions"`
echo "got core driver relations"

# get driver version
version=`cat ../setup.py | grep -e 'version='`
while IFS='"' read -ra ADDR; do
counter=0
for i in "${ADDR[@]}"; do
if [ $counter == 1 ]
then
version=$i
fi
counter=$(($counter+1))
done
done <<< "$version"

someFrontendTestsRan=false
i=0
coreDriverVersion=`echo $coreDriverArray | jq ". | last"`
coreDriverVersion=`echo $coreDriverVersion | tr -d '"'`
coreFree=`curl -s -X GET \
"https://api.supertokens.io/0/core-driver-interface/dependency/core/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$coreDriverVersion&driverName=python" \
-H 'api-version: 1'`
if [[ `echo $coreFree | jq .core` == "null" ]]
then
echo "fetching latest X.Y version for core given core-driver-interface X.Y version: $coreDriverVersion, planType: FREE gave response: $coreFree. Please make sure all relevant cores have been pushed."
exit 1
fi
coreFree=$(echo $coreFree | jq .core | tr -d '"')


frontendDriverVersion=$1
frontendDriverVersion=`echo $frontendDriverVersion | tr -d '"'`

frontendVersionXY=`curl -s -X GET \
"https://api.supertokens.io/0/frontend-driver-interface/dependency/frontend/latest?password=$SUPERTOKENS_API_KEY&frontendName=website&mode=DEV&version=$frontendDriverVersion&driverName=node" \
-H 'api-version: 1'`
if [[ `echo $frontendVersionXY | jq .frontend` == "null" ]]
then
echo "fetching latest X.Y version for frontend given frontend-driver-interface X.Y version: $frontendDriverVersion, name: website gave response: $frontend. Please make sure all relevant versions have been pushed."
exit 1
fi
frontendVersionXY=$(echo $frontendVersionXY | jq .frontend | tr -d '"')

frontendInfo=`curl -s -X GET \
"https://api.supertokens.io/0/frontend/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$frontendVersionXY&name=website" \
-H 'api-version: 0'`
if [[ `echo $frontendInfo | jq .tag` == "null" ]]
then
echo "fetching latest X.Y.Z version for frontend, X.Y version: $frontendVersionXY gave response: $frontendInfo"
exit 1
fi
frontendTag=$(echo $frontendInfo | jq .tag | tr -d '"')
frontendVersion=$(echo $frontendInfo | jq .version | tr -d '"')

nodeVersionXY=`curl -s -X GET \
"https://api.supertokens.io/0/frontend-driver-interface/dependency/driver/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$frontendDriverVersion&driverName=node&frontendName=website" \
-H 'api-version: 1'`
if [[ `echo $nodeVersionXY | jq .driver` == "null" ]]
then
echo "fetching latest X.Y version for driver given frontend-driver-interface X.Y version: $frontendDriverVersion gave response: $nodeVersionXY. Please make sure all relevant drivers have been pushed."
exit 1
fi
nodeVersionXY=$(echo $nodeVersionXY | jq .driver | tr -d '"')

nodeInfo=`curl -s -X GET \
"https://api.supertokens.io/0/driver/latest?password=$SUPERTOKENS_API_KEY&mode=DEV&version=$nodeVersionXY&name=node" \
-H 'api-version: 0'`
if [[ `echo $nodeInfo | jq .tag` == "null" ]]
then
echo "fetching latest X.Y.Z version for driver, X.Y version: $nodeVersionXY gave response: $nodeInfo"
exit 1
fi
nodeTag=$(echo $nodeInfo | jq .tag | tr -d '"')

tries=1
while [ $tries -le 3 ]
do
tries=$(( $tries + 1 ))
./setupAndTestWithFrontend.sh $coreFree $frontendTag $nodeTag
if [[ $? -ne 0 ]]
then
if [[ $tries -le 3 ]]
then
rm -rf ../../supertokens-root
rm -rf ../../supertokens-website
echo "failed test.. retrying!"
else
echo "test failed for website tests... exiting!"
exit 1
fi
else
rm -rf ../../supertokens-root
rm -rf ../../supertokens-website
break
fi
done
Loading