Skip to content

Commit 8f794c0

Browse files
authored
feat: oauth provider (supertokens#549)
* fix: files for oauth2 providers * fix: interface * fix: oauth2 interfaces * fix: update recipe.py * fix: login request impl * fix: query params for put request * fix: consent request * fix: more impl * fix: more impl * fix: recipe impl * fix: recipe impl * fix: validate_oauth2_access_token * fix: authorization * fix: token exchange * fix: frontend redirection url * fix: revoke token * fix: end session * fix: api stubs * fix: api structures and lint fixes * fix: remaining type fixes * fix: end session * fix: api endpoints * fix: remaining apis * fix: remaining impl * fix: typing * fix: type and lint * fix: types, exposed functions and cyclic import * fix: backend sdk tests * fix: default recipes and fixes for test * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: openid and cookies * fix: roles and permissions for oauth2 * fix: auth react tests * fix: tests and changes for oauth2 provider (supertokens#551) * fix: cdi and fdi versions * fix: deps * fix: sdk version * fix: tests * fix: website reset * fix: website tests * fix: test scripts for oauth2 * fix: website tests * fix: unit test * fix: unit test * fix: django headers * fix: better types * fix: review comments * fix: test server * fix: changelog * fix: check lint output in pre-commit * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import * fix: cyclic import
1 parent ee275a5 commit 8f794c0

File tree

83 files changed

+6034
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+6034
-68
lines changed

.circleci/config_continue.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
test-backend-sdk-testing:
3535
docker:
3636
- image: python:<< parameters.python-version >>
37+
- image: rishabhpoddar/oauth-server-cicd
3738
resource_class: large
3839
parameters:
3940
cdi-version:
@@ -54,6 +55,7 @@ jobs:
5455
test-website-fastapi:
5556
docker:
5657
- image: python:<< parameters.python-version >>
58+
- image: rishabhpoddar/oauth-server-cicd
5759
resource_class: large
5860
parameters:
5961
fdi-version:
@@ -74,6 +76,7 @@ jobs:
7476
test-website-flask:
7577
docker:
7678
- image: python:<< parameters.python-version >>
79+
- image: rishabhpoddar/oauth-server-cicd
7780
resource_class: large
7881
parameters:
7982
fdi-version:
@@ -94,6 +97,7 @@ jobs:
9497
test-website-django:
9598
docker:
9699
- image: python:<< parameters.python-version >>
100+
- image: rishabhpoddar/oauth-server-cicd
97101
resource_class: large
98102
parameters:
99103
fdi-version:
@@ -114,6 +118,7 @@ jobs:
114118
test-website-drf-async:
115119
docker:
116120
- image: python:<< parameters.python-version >>
121+
- image: rishabhpoddar/oauth-server-cicd
117122
resource_class: large
118123
parameters:
119124
fdi-version:
@@ -134,6 +139,7 @@ jobs:
134139
test-website-drf-sync:
135140
docker:
136141
- image: python:<< parameters.python-version >>
142+
- image: rishabhpoddar/oauth-server-cicd
137143
resource_class: large
138144
parameters:
139145
fdi-version:
@@ -154,6 +160,7 @@ jobs:
154160
test-website-django2x:
155161
docker:
156162
- image: python:<< parameters.python-version >>
163+
- image: rishabhpoddar/oauth-server-cicd
157164
resource_class: large
158165
parameters:
159166
fdi-version:
@@ -174,6 +181,7 @@ jobs:
174181
test-website-flask-nest-asyncio:
175182
docker:
176183
- image: python:<< parameters.python-version >>
184+
- image: rishabhpoddar/oauth-server-cicd
177185
resource_class: large
178186
environment:
179187
SUPERTOKENS_NEST_ASYNCIO: "1"
@@ -197,6 +205,7 @@ jobs:
197205
test-authreact-fastapi:
198206
docker:
199207
- image: python:<< parameters.python-version >>
208+
- image: rishabhpoddar/oauth-server-cicd
200209
environment:
201210
MOCHA_FILE: /root/test_report/report_node-<< parameters.fdi-version >>.xml
202211
parameters:
@@ -227,6 +236,7 @@ jobs:
227236
test-authreact-flask:
228237
docker:
229238
- image: python:<< parameters.python-version >>
239+
- image: rishabhpoddar/oauth-server-cicd
230240
resource_class: large
231241
environment:
232242
MOCHA_FILE: /root/test_report/report_node-<< parameters.fdi-version >>.xml
@@ -258,6 +268,7 @@ jobs:
258268
test-authreact-django:
259269
docker:
260270
- image: python:<< parameters.python-version >>
271+
- image: rishabhpoddar/oauth-server-cicd
261272
resource_class: large
262273
environment:
263274
MOCHA_FILE: /root/test_report/report_node-<< parameters.fdi-version >>.xml

.circleci/markDevTagAsTestNotPassed.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ while IFS='"' read -ra ADDR; do
2121
done
2222
done <<< "$version"
2323

24-
responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
24+
responseStatus=`curl -s -o out.bin -w "%{http_code}" -X PUT \
2525
https://api.supertokens.io/0/driver \
2626
-H 'Content-Type: application/json' \
2727
-H 'api-version: 0' \
@@ -35,5 +35,6 @@ responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
3535
if [ $responseStatus -ne "200" ]
3636
then
3737
echo "failed core PUT API status code: $responseStatus. Exiting!"
38+
cat out.bin
3839
exit 1
3940
fi

.circleci/setupAndTestBackendSDKWithFreeCore.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
4343
./loadModules --ssh
4444
cd supertokens-core
4545
git checkout $coreTag
46+
47+
# Update oauth provider config in devConfig.yaml
48+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
49+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
50+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
51+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
52+
4653
cd ../supertokens-plugin-interface
4754
git checkout $pluginInterfaceTag
4855
cd ../

.circleci/setupAndTestWithAuthReact.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
3939
./loadModules --ssh
4040
cd supertokens-core
4141
git checkout $coreTag
42+
43+
# Update oauth provider config in devConfig.yaml
44+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
45+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
46+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
47+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
48+
4249
cd ../supertokens-plugin-interface
4350
git checkout $pluginInterfaceTag
4451
cd ../

.circleci/setupAndTestWithAuthReactWithDjango.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
4141
./loadModules --ssh
4242
cd supertokens-core
4343
git checkout $coreTag
44+
45+
# Update oauth provider config in devConfig.yaml
46+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
47+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
48+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
49+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
50+
4451
cd ../supertokens-plugin-interface
4552
git checkout $pluginInterfaceTag
4653
cd ../

.circleci/setupAndTestWithAuthReactWithFlask.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
4141
./loadModules --ssh
4242
cd supertokens-core
4343
git checkout $coreTag
44+
45+
# Update oauth provider config in devConfig.yaml
46+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
47+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
48+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
49+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
50+
4451
cd ../supertokens-plugin-interface
4552
git checkout $pluginInterfaceTag
4653
cd ../

.circleci/setupAndTestWithFreeCore.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
4343
./loadModules --ssh
4444
cd supertokens-core
4545
git checkout $coreTag
46+
47+
# Update oauth provider config in devConfig.yaml
48+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
49+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
50+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
51+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
52+
4653
cd ../supertokens-plugin-interface
4754
git checkout $pluginInterfaceTag
4855
cd ../

.circleci/setupAndTestWithFrontend.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
3939
./loadModules --ssh
4040
cd supertokens-core
4141
git checkout $coreTag
42+
43+
# Update oauth provider config in devConfig.yaml
44+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
45+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
46+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
47+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
48+
4249
cd ../supertokens-plugin-interface
4350
git checkout $pluginInterfaceTag
4451
cd ../

.circleci/setupAndTestWithFrontendWithDjango.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
3939
./loadModules --ssh
4040
cd supertokens-core
4141
git checkout $coreTag
42+
43+
# Update oauth provider config in devConfig.yaml
44+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
45+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
46+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
47+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
48+
4249
cd ../supertokens-plugin-interface
4350
git checkout $pluginInterfaceTag
4451
cd ../

.circleci/setupAndTestWithFrontendWithDjango2x.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ echo -e "core,$1\nplugin-interface,$pluginInterfaceVersionXY" > modules.txt
3939
./loadModules --ssh
4040
cd supertokens-core
4141
git checkout $coreTag
42+
43+
# Update oauth provider config in devConfig.yaml
44+
sed -i 's/# oauth_provider_public_service_url:/oauth_provider_public_service_url: "http:\/\/localhost:4444"/' devConfig.yaml
45+
sed -i 's/# oauth_provider_admin_service_url:/oauth_provider_admin_service_url: "http:\/\/localhost:4445"/' devConfig.yaml
46+
sed -i 's/# oauth_provider_consent_login_base_url:/oauth_provider_consent_login_base_url: "http:\/\/localhost:3001\/auth"/' devConfig.yaml
47+
sed -i 's/# oauth_client_secret_encryption_key:/oauth_client_secret_encryption_key: "asdfasdfasdfasdfasdf"/' devConfig.yaml
48+
4249
cd ../supertokens-plugin-interface
4350
git checkout $pluginInterfaceTag
4451
cd ../

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy