Skip to content

fix: tests and changes for oauth2 provider #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .circleci/config_continue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
test-backend-sdk-testing:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
cdi-version:
Expand All @@ -54,6 +55,7 @@ jobs:
test-website-fastapi:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
Expand All @@ -74,6 +76,7 @@ jobs:
test-website-flask:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
Expand All @@ -94,6 +97,7 @@ jobs:
test-website-django:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
Expand All @@ -114,6 +118,7 @@ jobs:
test-website-drf-async:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
Expand All @@ -134,6 +139,7 @@ jobs:
test-website-drf-sync:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
Expand All @@ -154,6 +160,7 @@ jobs:
test-website-django2x:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
parameters:
fdi-version:
Expand All @@ -174,6 +181,7 @@ jobs:
test-website-flask-nest-asyncio:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
resource_class: large
environment:
SUPERTOKENS_NEST_ASYNCIO: "1"
Expand All @@ -197,6 +205,7 @@ jobs:
test-authreact-fastapi:
docker:
- image: python:<< parameters.python-version >>
- image: rishabhpoddar/oauth-server-cicd
environment:
MOCHA_FILE: /root/test_report/report_node-<< parameters.fdi-version >>.xml
parameters:
Expand Down Expand Up @@ -227,6 +236,7 @@ jobs:
test-authreact-flask:
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
Expand Down Expand Up @@ -258,6 +268,7 @@ jobs:
test-authreact-django:
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
Expand Down
3 changes: 2 additions & 1 deletion .circleci/markDevTagAsTestNotPassed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ while IFS='"' read -ra ADDR; do
done
done <<< "$version"

responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
responseStatus=`curl -s -o out.bin -w "%{http_code}" -X PUT \
https://api.supertokens.io/0/driver \
-H 'Content-Type: application/json' \
-H 'api-version: 0' \
Expand All @@ -35,5 +35,6 @@ responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
if [ $responseStatus -ne "200" ]
then
echo "failed core PUT API status code: $responseStatus. Exiting!"
cat out.bin
exit 1
fi
7 changes: 7 additions & 0 deletions .circleci/setupAndTestBackendSDKWithFreeCore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithAuthReact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithAuthReactWithDjango.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithAuthReactWithFlask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFreeCore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFrontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFrontendWithDjango.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFrontendWithDjango2x.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFrontendWithDrfAsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFrontendWithDrfSync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
7 changes: 7 additions & 0 deletions .circleci/setupAndTestWithFrontendWithFlask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
./loadModules --ssh
cd supertokens-core
git checkout $coreTag

# Update oauth provider config in devConfig.yaml
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml

cd ../supertokens-plugin-interface
git checkout $pluginInterfaceTag
cd ../
Expand Down
2 changes: 1 addition & 1 deletion coreDriverInterfaceSupported.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"_comment": "contains a list of core-driver interfaces branch names that this core supports",
"versions": [
"5.1"
"5.2"
]
}
3 changes: 2 additions & 1 deletion frontendDriverInterfaceSupported.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"1.19",
"2.0",
"3.0",
"3.1"
"3.1",
"4.0"
]
}
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

setup(
name="supertokens_python",
version="0.26.1",
version="0.27.0",
author="SuperTokens",
license="Apache 2.0",
author_email="[email protected]",
Expand Down Expand Up @@ -127,6 +127,7 @@
"aiosmtplib>=1.1.6,<4.0.0",
"pkce<1.1.0",
"pyotp<3",
"python-dateutil<3",
],
python_requires=">=3.8",
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions supertokens_python/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

from __future__ import annotations

SUPPORTED_CDI_VERSIONS = ["5.1"]
VERSION = "0.26.1"
SUPPORTED_CDI_VERSIONS = ["5.2"]
VERSION = "0.27.0"
TELEMETRY = "/telemetry"
USER_COUNT = "/users/count"
USER_DELETE = "/user/remove"
Expand Down
2 changes: 2 additions & 0 deletions supertokens_python/framework/django/django_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def get_cookie(self, key: str) -> Union[str, None]:

def get_header(self, key: str) -> Union[None, str]:
key = key.replace("-", "_")
if key.upper() in self.request.META:
return self.request.META.get(key.upper())
key = "HTTP_" + key
return self.request.META.get(key.upper())

Expand Down
1 change: 1 addition & 0 deletions supertokens_python/framework/django/django_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ def redirect(self, url: str) -> BaseResponse:
if not self.response_sent:
self.set_header("Location", url)
self.set_status_code(302)
self.response_sent = True
return self
1 change: 1 addition & 0 deletions supertokens_python/framework/fastapi/fastapi_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,5 @@ def redirect(self, url: str) -> BaseResponse:
if not self.response_sent:
self.set_header("Location", url)
self.set_status_code(302)
self.response_sent = True
return self
Loading
Loading