Skip to content

Commit 86b5fb3

Browse files
merge with 0.12
2 parents 08e44d7 + 437f24d commit 86b5fb3

File tree

143 files changed

+4771
-2004
lines changed

Some content is hidden

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

143 files changed

+4771
-2004
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ orbs:
88
slack: circleci/[email protected]
99
jq: circleci/[email protected]
1010
jobs:
11-
test:
11+
create-test-jobs:
1212
machine:
1313
image: ubuntu-2204:2022.04.1
1414
steps:
@@ -41,12 +41,12 @@ workflows:
4141
version: 2
4242
tagged-build:
4343
jobs:
44-
- test:
44+
- create-test-jobs:
4545
filters:
4646
tags:
4747
only: /dev-v[0-9]+(\.[0-9]+)*/
4848
branches:
49-
ignore: /.*/
49+
only: /test\/.*/
5050
- publish:
5151
context:
5252
- slack-notification

.circleci/config_continue.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ jobs:
1515
docker:
1616
- image: rishabhpoddar/supertokens_python_driver_testing
1717
resource_class: large
18+
parameters:
19+
cdi-version:
20+
type: string
21+
parallelism: 4
1822
steps:
1923
- checkout
2024
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
2125
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
2226
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
2327
- run: make dev-install
24-
- run: (cd .circleci/ && ./doUnitTests.sh)
28+
- run: (cd .circleci/ && ./doUnitTests.sh << parameters.cdi-version >>)
2529
- slack/status
2630
test-website-fastapi:
2731
docker:
@@ -184,7 +188,7 @@ workflows:
184188
tags:
185189
only: /dev-v[0-9]+(\.[0-9]+)*/
186190
branches:
187-
ignore: /.*/
191+
only: /test\/.*/
188192
- test-unit:
189193
requires:
190194
- test-dev-tag-as-not-passed
@@ -194,7 +198,10 @@ workflows:
194198
tags:
195199
only: /dev-v[0-9]+(\.[0-9]+)*/
196200
branches:
197-
ignore: /.*/
201+
only: /test\/.*/
202+
matrix:
203+
parameters:
204+
cdi-version: placeholder
198205
- test-website-fastapi:
199206
requires:
200207
- test-dev-tag-as-not-passed
@@ -204,7 +211,7 @@ workflows:
204211
tags:
205212
only: /dev-v[0-9]+(\.[0-9]+)*/
206213
branches:
207-
ignore: /.*/
214+
only: /test\/.*/
208215
- test-website-flask:
209216
requires:
210217
- test-dev-tag-as-not-passed
@@ -214,7 +221,7 @@ workflows:
214221
tags:
215222
only: /dev-v[0-9]+(\.[0-9]+)*/
216223
branches:
217-
ignore: /.*/
224+
only: /test\/.*/
218225
- test-website-django:
219226
requires:
220227
- test-dev-tag-as-not-passed
@@ -224,7 +231,7 @@ workflows:
224231
tags:
225232
only: /dev-v[0-9]+(\.[0-9]+)*/
226233
branches:
227-
ignore: /.*/
234+
only: /test\/.*/
228235
- test-website-django2x:
229236
requires:
230237
- test-dev-tag-as-not-passed
@@ -234,7 +241,7 @@ workflows:
234241
tags:
235242
only: /dev-v[0-9]+(\.[0-9]+)*/
236243
branches:
237-
ignore: /.*/
244+
only: /test\/.*/
238245
- test-authreact-fastapi:
239246
requires:
240247
- test-dev-tag-as-not-passed
@@ -244,7 +251,7 @@ workflows:
244251
tags:
245252
only: /dev-v[0-9]+(\.[0-9]+)*/
246253
branches:
247-
ignore: /.*/
254+
only: /test\/.*/
248255
matrix:
249256
parameters:
250257
fdi-version: placeholder
@@ -257,7 +264,7 @@ workflows:
257264
tags:
258265
only: /dev-v[0-9]+(\.[0-9]+)*/
259266
branches:
260-
ignore: /.*/
267+
only: /test\/.*/
261268
matrix:
262269
parameters:
263270
fdi-version: placeholder
@@ -270,7 +277,7 @@ workflows:
270277
tags:
271278
only: /dev-v[0-9]+(\.[0-9]+)*/
272279
branches:
273-
ignore: /.*/
280+
only: /test\/.*/
274281
matrix:
275282
parameters:
276283
fdi-version: placeholder
@@ -290,4 +297,4 @@ workflows:
290297
tags:
291298
only: /dev-v[0-9]+(\.[0-9]+)*/
292299
branches:
293-
ignore: /.*/
300+
only: /test\/.*/

.circleci/doUnitTests.sh

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,27 @@
1-
coreDriverJson=`cat ../coreDriverInterfaceSupported.json`
2-
coreDriverLength=`echo $coreDriverJson | jq ".versions | length"`
3-
coreDriverArray=`echo $coreDriverJson | jq ".versions"`
4-
echo "got core driver relations"
1+
echo "Starting tests for CDI $1";
52

6-
frontendDriverJson=`cat ../frontendDriverInterfaceSupported.json`
7-
frontendDriverLength=`echo $frontendDriverJson | jq ".versions | length"`
8-
frontendDriverArray=`echo $frontendDriverJson | jq ".versions"`
9-
echo "got frontend driver relations"
10-
11-
# get driver version
12-
version=`cat ../setup.py | grep -e 'version='`
13-
while IFS='"' read -ra ADDR; do
14-
counter=0
15-
for i in "${ADDR[@]}"; do
16-
if [ $counter == 1 ]
17-
then
18-
version=$i
19-
fi
20-
counter=$(($counter+1))
21-
done
22-
done <<< "$version"
23-
24-
someTestsRan=false
25-
i=0
26-
while [ $i -lt $coreDriverLength ]; do
27-
coreDriverVersion=`echo $coreDriverArray | jq ".[$i]"`
28-
coreDriverVersion=`echo $coreDriverVersion | tr -d '"'`
29-
i=$((i+1))
3+
if [ -z "$SUPERTOKENS_API_KEY" ]; then
4+
echo "SUPERTOKENS_API_KEY not set"
5+
exit 1
6+
fi
307

31-
coreFree=`curl -s -X GET \
32-
"https://api.supertokens.io/0/core-driver-interface/dependency/core/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$coreDriverVersion" \
33-
-H 'api-version: 0'`
34-
if [[ `echo $coreFree | jq .core` == "null" ]]
35-
then
36-
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."
37-
exit 1
38-
fi
39-
coreFree=$(echo $coreFree | jq .core | tr -d '"')
8+
coreDriverVersion=$1
9+
coreDriverVersion=`echo $coreDriverVersion | tr -d '"'`
4010

41-
someTestsRan=true
42-
./setupAndTestWithFreeCore.sh $coreFree $coreDriverVersion
43-
if [[ $? -ne 0 ]]
44-
then
45-
echo "test failed... exiting!"
46-
exit 1
47-
fi
48-
rm -rf ../../supertokens-root
49-
done
11+
coreFree=`curl -s -X GET \
12+
"https://api.supertokens.io/0/core-driver-interface/dependency/core/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$coreDriverVersion" \
13+
-H 'api-version: 0'`
14+
if [[ `echo $coreFree | jq .core` == "null" ]]
15+
then
16+
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."
17+
exit 1
18+
fi
19+
coreFree=$(echo $coreFree | jq .core | tr -d '"')
5020

51-
if [[ $someTestsRan = "false" ]]
21+
./setupAndTestWithFreeCore.sh $coreFree $coreDriverVersion
22+
if [[ $? -ne 0 ]]
5223
then
53-
echo "no tests ran... failing!"
24+
echo "test failed... exiting!"
5425
exit 1
55-
fi
26+
fi
27+
rm -rf ../../supertokens-root

.circleci/generateConfig.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
frontendDriverJson=`cat ../frontendDriverInterfaceSupported.json`
2-
frontendDriverArray=`echo $frontendDriverJson | jq ".versions"`
2+
frontendDriverArray=`echo $frontendDriverJson | jq -c ".versions"`
3+
4+
coreDriverJson=`cat ../coreDriverInterfaceSupported.json`
5+
coreDriverArray=`echo $coreDriverJson | jq -c ".versions"`
36

47
if [ -z "$SUPERTOKENS_API_KEY" ]; then
58
echo "SUPERTOKENS_API_KEY missing"
69
exit 1;
710
fi
811

9-
sed -i -e 's/fdi-version: placeholder/fdi-version: '`printf "%q" $frontendDriverArray`'/' config_continue.yml
12+
sed -i -e 's/fdi-version: placeholder/fdi-version: '`printf "%s" $frontendDriverArray`'/' config_continue.yml
13+
sed -i -e 's/cdi-version: placeholder/cdi-version: '`printf "%s" $coreDriverArray`'/' config_continue.yml

.circleci/setupAndTestWithAuthReact.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ git checkout $2
5151
npm run init > /dev/null
5252
(cd ./examples/for-tests && npm run link) # this is there because in linux machine, postinstall in npm doesn't work..
5353
cd ./test/server/
54-
npm i -d
5554
npm i git+https://github.com:supertokens/supertokens-node.git#$3
55+
npm i
5656
cd ../../../project/tests/auth-react/fastapi-server
5757
export PYTHONPATH="${PYTHONPATH}:/root/project"
5858
uvicorn app:app --host 0.0.0.0 --port 8083 &

.circleci/setupAndTestWithAuthReactWithDjango.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ git checkout $2
5151
npm run init > /dev/null
5252
(cd ./examples/for-tests && npm run link) # this is there because in linux machine, postinstall in npm doesn't work..
5353
cd ./test/server/
54-
npm i -d
5554
npm i git+https://github.com:supertokens/supertokens-node.git#$3
55+
npm i
5656
cd ../../../project/tests/auth-react/django3x
5757
export PYTHONPATH="${PYTHONPATH}:/root/project"
5858
uvicorn mysite.asgi:application --port 8083 &

.circleci/setupAndTestWithAuthReactWithFlask.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ git checkout $2
5151
npm run init > /dev/null
5252
(cd ./examples/for-tests && npm run link) # this is there because in linux machine, postinstall in npm doesn't work..
5353
cd ./test/server/
54-
npm i -d
5554
npm i git+https://github.com:supertokens/supertokens-node.git#$3
55+
npm i
5656
cd ../../../project/tests/auth-react/flask-server
5757
export PYTHONPATH="${PYTHONPATH}:/root/project"
5858
python3 app.py --port 8083 &

.circleci/setupAndTestWithFrontend.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ pid=$!
5555
uvicorn app:app --host 0.0.0.0 --port 8082 &
5656
pid2=$!
5757
cd ../../../../supertokens-website/test/server
58-
npm i -d
5958
npm i git+https://github.com:supertokens/supertokens-node.git#$3
59+
npm i
6060
cd ../../
61-
npm i -d
61+
npm i
6262
SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root npm test
6363
if [[ $? -ne 0 ]]
6464
then

.circleci/setupAndTestWithFrontendWithDjango.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ pid=$!
5555
uvicorn mysite.asgi:application --port 8082 &
5656
pid2=$!
5757
cd ../../../../supertokens-website/test/server
58-
npm i -d
5958
npm i git+https://github.com:supertokens/supertokens-node.git#$3
59+
npm i
6060
cd ../../
61-
npm i -d
61+
npm i
6262
SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root npm test
6363
if [[ $? -ne 0 ]]
6464
then

.circleci/setupAndTestWithFrontendWithDjango2x.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ pid=$!
5555
gunicorn mysite.wsgi --bind 0.0.0.0:8082 &
5656
pid2=$!
5757
cd ../../../../supertokens-website/test/server
58-
npm i -d
5958
npm i git+https://github.com:supertokens/supertokens-node.git#$3
59+
npm i
6060
cd ../../
61-
npm i -d
61+
npm i
6262
SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root npm test
6363
if [[ $? -ne 0 ]]
6464
then

.circleci/setupAndTestWithFrontendWithFlask.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ pid=$!
5555
python3 app.py --port 8082 &
5656
pid2=$!
5757
cd ../../../../supertokens-website/test/server
58-
npm i -d
5958
npm i git+https://github.com:supertokens/supertokens-node.git#$3
59+
npm i
6060
cd ../../
61-
npm i -d
61+
npm i
6262
SUPERTOKENS_CORE_TAG=$coreTag NODE_PORT=8081 INSTALL_PATH=../supertokens-root npm test
6363
if [[ $? -ne 0 ]]
6464
then

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## unreleased
99

10-
## [0.11.14] - 2023-02-06
10+
## [0.12.1] - 2023-02-06
1111

1212
- Email template updates
1313

14+
# [0.12.0] - 2023-02-03
15+
### Breaking changes
16+
17+
- The frontend SDK should be updated to a version supporting the header-based sessions!
18+
- supertokens-auth-react: >= 0.31.0
19+
- supertokens-web-js: >= 0.5.0
20+
- supertokens-website: >= 16.0.0
21+
- supertokens-react-native: >= 4.0.0
22+
- supertokens-ios >= 0.2.0
23+
- supertokens-android >= 0.3.0
24+
- supertokens-flutter >= 0.1.0
25+
- Only supporting FDI 1.16
26+
27+
### Added
28+
29+
- Added support for authorizing requests using the `Authorization` header instead of cookies
30+
- Added `get_token_transfer_method` config option
31+
- Check out https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/sessions/token-transfer-method for more information
32+
33+
### Changed
34+
- Remove constraints on `werkzeug` version
35+
36+
1437
# [0.11.13] - 2023-01-06
1538

1639
- Add missing `original` attribute to flask response and remove logic for cases where `response` is `None`

examples/with-django/with-thirdpartyemailpassword/project/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_website_domain():
6565
framework="django",
6666
mode="wsgi",
6767
recipe_list=[
68-
session.init(),
68+
session.init(get_token_transfer_method=lambda _, __, ___: "cookie"),
6969
emailverification.init("REQUIRED"),
7070
thirdpartyemailpassword.init(
7171
providers=[

examples/with-fastapi/with-thirdpartyemailpassword/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_website_domain():
5555
),
5656
framework="fastapi",
5757
recipe_list=[
58-
session.init(),
58+
session.init(get_token_transfer_method=lambda _, __, ___: "cookie"),
5959
emailverification.init("REQUIRED"),
6060
thirdpartyemailpassword.init(
6161
providers=[

examples/with-flask/with-thirdpartyemailpassword/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_website_domain():
4848
),
4949
framework="flask",
5050
recipe_list=[
51-
session.init(),
51+
session.init(get_token_transfer_method=lambda _, __, ___: "cookie"),
5252
emailverification.init("REQUIRED"),
5353
thirdpartyemailpassword.init(
5454
providers=[

frontendDriverInterfaceSupported.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"_comment": "contains a list of frontend-driver interfaces branch names that this core supports",
33
"versions": [
4-
"1.15"
4+
"1.16"
55
]
66
}

html/supertokens_python/constants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4040
# License for the specific language governing permissions and limitations
4141
# under the License.
4242
SUPPORTED_CDI_VERSIONS = [&#34;2.9&#34;, &#34;2.10&#34;, &#34;2.11&#34;, &#34;2.12&#34;, &#34;2.13&#34;, &#34;2.14&#34;, &#34;2.15&#34;]
43-
VERSION = &#34;0.11.13&#34;
43+
VERSION = &#34;0.12.0&#34;
4444
TELEMETRY = &#34;/telemetry&#34;
4545
USER_COUNT = &#34;/users/count&#34;
4646
USER_DELETE = &#34;/user/remove&#34;

0 commit comments

Comments
 (0)