Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: supertokens/supertokens-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4fe642b932f3950df52e5128cd9305f4e5bc816b
Choose a base ref
...
head repository: supertokens/supertokens-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0faebfae435fd661f4b6657e2ca510101da012f5
Choose a head ref

Commits on May 2, 2021

  1. Fdi 1.8 (#120)

    * adds anti csrf check via custom header
    
    * changes input type of antiCsrf
    
    * fixes tests
    
    * fixes to tests
    
    * removes deprecated apiWebProxyPath config
    rishabhpoddar authored May 2, 2021
    Copy the full SHA
    ebce73a View commit details
  2. Copy the full SHA
    24e7a18 View commit details
  3. Copy the full SHA
    64030f6 View commit details
  4. Copy the full SHA
    44dbf4a View commit details
  5. Copy the full SHA
    5dadf20 View commit details
  6. Copy the full SHA
    14826f6 View commit details

Commits on May 3, 2021

  1. Copy the full SHA
    7e15e12 View commit details

Commits on May 6, 2021

  1. fixes #122

    rishabhpoddar committed May 6, 2021
    Copy the full SHA
    5ab3905 View commit details
  2. Copy the full SHA
    03a0e94 View commit details
  3. fixes #122

    rishabhpoddar committed May 6, 2021
    Copy the full SHA
    96ca8e3 View commit details
  4. Copy the full SHA
    a025743 View commit details

Commits on May 10, 2021

  1. Bump url-parse from 1.4.7 to 1.5.1 (#124)

    Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
    - [Release notes](https://github.com/unshiftio/url-parse/releases)
    - [Commits](unshiftio/url-parse@1.4.7...1.5.1)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 10, 2021
    Copy the full SHA
    a4faf06 View commit details

Commits on May 18, 2021

  1. Copy the full SHA
    71adb7c View commit details
  2. Copy the full SHA
    f857a1a View commit details
  3. Copy the full SHA
    d24de9b View commit details
  4. changes major version

    rishabhpoddar committed May 18, 2021
    Copy the full SHA
    abf6efb View commit details
  5. Copy the full SHA
    8d70f1d View commit details

Commits on May 19, 2021

  1. Copy the full SHA
    dc2cd66 View commit details
  2. Copy the full SHA
    fc6da97 View commit details
  3. Bump lodash from 4.17.20 to 4.17.21 (#125)

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.17.20...4.17.21)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 19, 2021
    Copy the full SHA
    80dab17 View commit details
  4. exports types

    rishabhpoddar committed May 19, 2021
    Copy the full SHA
    bea6e6d View commit details
  5. Copy the full SHA
    d894454 View commit details
  6. Copy the full SHA
    cca0289 View commit details
  7. Copy the full SHA
    d8c1d2e View commit details

Commits on May 20, 2021

  1. Copy the full SHA
    1a3b443 View commit details
  2. fixes tests

    rishabhpoddar committed May 20, 2021
    Copy the full SHA
    4e0b4e9 View commit details

Commits on May 22, 2021

  1. Override apis (#129)

    * updates types for functions override and creates interface and implementation for emailverification apis
    
    * implements emailverification API interface
    
    * allows for override of emailpassword APIs
    
    * allows for override of thirdparty APIs
    
    * implements api overriding for thirdpartyemailpassword recipe
    
    * changes for background process
    
    * moves emailverification override inside main override block
    
    * Reduce recipe use (#130)
    
    * removes need for recipe in error
    
    * fixes tests
    
    * passes querier instead of recipe in implementation
    
    * passes querier instead of recipe in implementation for thirdparty
    
    * removes use of recipe from thirdpartyemailpassword
    
    * changes session implementation to not depend on a recipe
    
    * decouples querier from recipe
    
    * function name change for getting querier instance
    
    * api implementation doesn't depend on recipe instance for emailverification recipe
    
    * api implementation doesn't depend on recipe instance for emailpassword recipe
    
    * api implementation doesn't depend on recipe instance for thirdparty recipe
    
    * removes unnecessary checks in tpep api implementation
    
    * fixes all tests
    
    * makes session APIs overridable
    rishabhpoddar authored May 22, 2021
    Copy the full SHA
    2bd589c View commit details

Commits on May 23, 2021

  1. Copy the full SHA
    c1ff2e3 View commit details
  2. replaces disableDefaultImpl boolean with overriding api with undefine…

    …d for emailpassword, thirdparty and thirdpartyemailpassword
    rishabhpoddar committed May 23, 2021
    Copy the full SHA
    344834f View commit details
  3. Copy the full SHA
    f0d104d View commit details
  4. Copy the full SHA
    8d9cdaa View commit details
  5. fixes tests

    rishabhpoddar committed May 23, 2021
    Copy the full SHA
    128dbc9 View commit details
  6. Copy the full SHA
    036e6ae View commit details
  7. fixes tests

    rishabhpoddar committed May 23, 2021
    Copy the full SHA
    9bc7a36 View commit details

Commits on May 24, 2021

  1. Removes post api callbacks for emailpassword and emailverification (#131

    )
    
    * removes post api callbacks for emailpassword and emailverification
    
    * removes post sign up / in callbacks from thirdpaty recipe
    
    * removes post sign up / in callbacks from thirdpatyemailpassword recipe
    
    * changes api interface for thirdpartyemailpassword to combine sign in and sign up into one API
    
    * fixes to tests
    
    * updates changelog
    rishabhpoddar authored May 24, 2021
    Copy the full SHA
    7cc8cd3 View commit details
  2. makes supertokens config optional (since users can potentially overri…

    …de a recipe entirely and use that instead of using the core)
    rishabhpoddar committed May 24, 2021
    Copy the full SHA
    3382cc8 View commit details

Commits on May 26, 2021

  1. Copy the full SHA
    5e7be99 View commit details

Commits on May 27, 2021

  1. Copy the full SHA
    3944372 View commit details
  2. Copy the full SHA
    67ab07d View commit details
  3. Copy the full SHA
    f5d13c5 View commit details
  4. Copy the full SHA
    aab7808 View commit details
  5. Copy the full SHA
    dea5e55 View commit details
  6. Copy the full SHA
    ebf7242 View commit details
  7. fixes for tests

    rishabhpoddar committed May 27, 2021
    Copy the full SHA
    cbb05d4 View commit details

Commits on May 28, 2021

  1. updates changelog

    rishabhpoddar committed May 28, 2021
    Copy the full SHA
    0ad91d7 View commit details
  2. Copy the full SHA
    6632854 View commit details

Commits on May 29, 2021

  1. adds ability to override recipes of child recipes so that multiple in…

    …stances of the same recipe are not created
    rishabhpoddar committed May 29, 2021
    Copy the full SHA
    4e53982 View commit details
  2. Copy the full SHA
    87a9867 View commit details
  3. type changes

    rishabhpoddar committed May 29, 2021
    Copy the full SHA
    47e5f72 View commit details
  4. Copy the full SHA
    d265d10 View commit details
Showing 1,371 changed files with 504,378 additions and 22,941 deletions.
121 changes: 43 additions & 78 deletions .circleci/doTests.sh → .circleci/authReact.sh
Original file line number Diff line number Diff line change
@@ -21,50 +21,6 @@ while IFS='"' read -ra ADDR; do
done
done <<< "$version"

responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
https://api.supertokens.io/0/driver \
-H 'Content-Type: application/json' \
-H 'api-version: 0' \
-d "{
\"password\": \"$SUPERTOKENS_API_KEY\",
\"version\":\"$version\",
\"name\": \"node\",
\"frontendDriverInterfaces\": $frontendDriverArray,
\"coreDriverInterfaces\": $coreDriverArray
}"`
if [ $responseStatus -ne "200" ]
then
echo "failed core PUT API status code: $responseStatus. Exiting!"
exit 1
fi

someTestsRan=false
i=0
while [ $i -lt $coreDriverLength ]; do
coreDriverVersion=`echo $coreDriverArray | jq ".[$i]"`
coreDriverVersion=`echo $coreDriverVersion | tr -d '"'`
i=$((i+1))

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" \
-H 'api-version: 0'`
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 '"')

someTestsRan=true
./setupAndTestWithFreeCore.sh $coreFree $coreDriverVersion
if [[ $? -ne 0 ]]
then
echo "test failed... exiting!"
exit 1
fi
rm -rf ../../supertokens-root
done

someFrontendTestsRan=false
i=0
coreDriverVersion=`echo $coreDriverArray | jq ". | last"`
@@ -108,17 +64,27 @@ while [ $i -lt $frontendDriverLength ]; do
frontendTag=$(echo $frontendInfo | jq .tag | tr -d '"')
frontendVersion=$(echo $frontendInfo | jq .version | tr -d '"')

nodeTag=dev-v$version
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" \
-H 'api-version: 0'`
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 '"')

someFrontendTestsRan=true
./setupAndTestWithFrontend.sh $coreFree $frontendTag $nodeTag
if [[ $? -ne 0 ]]
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 "test failed... exiting!"
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 '"')

rm -rf ../../supertokens-root
someFrontendTestsRan=true

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" \
@@ -141,41 +107,40 @@ while [ $i -lt $frontendDriverLength ]; do
frontendAuthReactTag=$(echo $frontendAuthReactInfo | jq .tag | tr -d '"')
frontendAuthReactVersion=$(echo $frontendAuthReactInfo | jq .version | tr -d '"')

if [[ $frontendDriverVersion == '1.3' ]]; then
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
continue
else
./setupAndTestWithAuthReact.sh $coreFree $frontendAuthReactTag $nodeTag
if [[ $? -ne 0 ]]
then
echo "test failed... exiting!"
exit 1
fi

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

done

if [[ $someFrontendTestsRan = "true" ]] && [[ $someTestsRan = "true" ]]
if [[ $someFrontendTestsRan = "false" ]]
then
echo "calling /driver PATCH to make testing passed"
responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PATCH \
https://api.supertokens.io/0/driver \
-H 'Content-Type: application/json' \
-H 'api-version: 0' \
-d "{
\"password\": \"$SUPERTOKENS_API_KEY\",
\"version\":\"$version\",
\"name\": \"node\",
\"testPassed\": true
}"`
if [ $responseStatus -ne "200" ]
then
echo "patch api failed"
exit 1
fi
else
echo "no test ran"
echo "no tests ran... failing!"
exit 1
fi
103 changes: 62 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,67 @@
version: 2.1

# this allows you to use CircleCI's dynamic configuration feature
setup: true

orbs:
slack: circleci/slack@3.4.2
continuation: circleci/continuation@0.1.2
slack: circleci/slack@3.4.2
jq: circleci/jq@2.2.0
jobs:
publish:
docker:
- image: circleci/node:8.10.0
steps:
- checkout
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish
- slack/status
test:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
resource_class: large
steps:
- add_ssh_keys:
fingerprints:
- "b3:da:ef:15:52:aa:a3:69:c3:6b:14:0c:be:23:b7:c7"
- checkout
- run: apt-get install lsof
- run: npm i -d
- run: (cd .circleci/ && ./doTests.sh)
- slack/status
publish:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
steps:
- checkout
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Publish
command: |
cd .circleci
./publish.sh
- slack/status
update-docs:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
steps:
- checkout
- run: cd ../ && git clone git@github.com:supertokens/supertokens-backend-website.git
- run: (cd .circleci && ./updateDocsInWebsite.sh)
- slack/status
setup:
machine:
image: ubuntu-2204:2022.04.1
steps:
- checkout
- run:
name: Generate config
command: |
cd .circleci && ./generateConfig.sh
- continuation/continue:
configuration_path: .circleci/config_continue.yml # use newly generated config to continue

workflows:
version: 2
tagged-build:
jobs:
- publish:
context:
- slack-notification
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test:
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
version: 2
tagged-build:
jobs:
- publish:
context:
- slack-notification
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- setup:
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- update-docs:
context:
- slack-notification
filters:
branches:
only:
- master
121 changes: 121 additions & 0 deletions .circleci/config_continue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
version: 2.1

orbs:
continuation: circleci/continuation@0.1.2
slack: circleci/slack@3.4.2
jq: circleci/jq@2.2.0
jobs:
test-dev-tag-as-not-passed:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
steps:
- checkout
- run: (cd .circleci/ && ./markDevTagAsTestNotPassed.sh)
test-unit:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
resource_class: large
parameters:
cdi-version:
type: string
parallelism: 4
steps:
- checkout
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
- run: apt-get install lsof
- run: npm i -d --force
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
- run: (cd .circleci/ && ./doUnitTests.sh << parameters.cdi-version >>)
- slack/status
test-website:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
resource_class: large
steps:
- checkout
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
- run: apt-get install lsof
- run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: npm i -d --force
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
- run: (cd .circleci/ && ./website.sh)
- slack/status
test-authreact:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing_node_16
resource_class: large
steps:
- checkout
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
- run: apt-get install lsof
- run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: npm i -d --force
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
- run: (cd .circleci/ && ./authReact.sh)
- slack/status
test-success:
docker:
- image: rishabhpoddar/supertokens_website_sdk_testing
steps:
- checkout
- run: (cd .circleci/ && ./markAsSuccess.sh)
- slack/status

workflows:
version: 2
tagged-build:
jobs:
- test-dev-tag-as-not-passed:
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test-unit:
requires:
- test-dev-tag-as-not-passed
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
matrix:
parameters:
cdi-version: placeholder
- test-website:
requires:
- test-dev-tag-as-not-passed
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test-authreact:
requires:
- test-dev-tag-as-not-passed
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test-success:
requires:
- test-unit
- test-website
- test-authreact
context:
- slack-notification
filters:
tags:
only: /dev-v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
Loading