Skip to content
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

Creating the recipe module manager skeleton and make that structure work with sessions #25

Merged
merged 26 commits into from
Oct 23, 2020

Conversation

rishabhpoddar
Copy link
Contributor

@rishabhpoddar rishabhpoddar commented Oct 22, 2020

Related issues:

Changes:

  • Gets rid of device info related operations
  • Convert Querier to be per instance of recipe
    • This will allow each recipe to get their own instance of the querier with that recipe's rId. This way, if the querier throws an error, the recipe module manager can identity which recipe it originated from. This has a side effect that the if the recipeModuleManager itself uses the querier, then it must give its own rId as "" (But this doesn't happen anywhere as of yet).
  • Changes to error handling completely.
    • Change AuthError to SessionError
    • Change isErrorFromAuth to isErrorFromThisRecipe
    • Created a base Error class called SuperTokensError which contains:
      • type: Used to identify the type of an error within a recipe
      • message: A user-friendly message describing the error.
      • payload: Can be any payload specific to that error type
      • rId: The recipe ID that threw this error. If the error originates from the recipeModuleManager itself, this will be ""
  • app.use(supertokens.init({...})) has changed to app.use(supertokens.middleware()). The init function for session no longer returns a middleware.
  • Removes setOptionsAPIHeader function
  • Removed all static classes within the session recipe. Everything is tied to the recipe instance
  • Reorganisation of session functions to be as instance functions inside the recipe class
  • Solves middleware code duplication issue of FaunaDB using inheritance.
  • Change of supertokens.init:
    • hosts and apiKey are inside supertokens object
    • hosts has been renamed to connectionURI
    • connectionURI is now compulsory to give
    • Structural changes to the config in the init function as per Implement a recipeModule manager #16
  • No longer allow the user to change the accessTokenPath
  • Session error handling functions have moved to init
  • Changes name of getCORSAllowedHeaders to getAllCORSHeaders
  • Changes session.middleware to session.verifySession
  • Removes support for setRelevantHeadersForOptionsAPI

Migration:

  • Changes to error handling completely
  • Changes to how to call the init function
  • Changes to import statements
  • No longer allow the user to change the accessTokenPath
  • Session error handling functions have moved to init instead of in errorHandler middleware
  • Changes name of getCORSAllowedHeaders to getAllCORSHeaders
  • Changes session.middleware to session.verifySession
  • Removes support for setRelevantHeadersForOptionsAPI
  • Removes support for Auth0, until we can figure out how to add it in "nicely". An issue for this has been created: Readd Auth0 support for >= v3.0 #26

@kant01ne kant01ne self-assigned this Oct 22, 2020
@kant01ne kant01ne self-requested a review October 22, 2020 14:25
@kant01ne kant01ne removed their assignment Oct 22, 2020
@rishabhpoddar rishabhpoddar marked this pull request as draft October 22, 2020 15:08
@rishabhpoddar rishabhpoddar changed the title Creating the recipe module manager Creating the recipe module manager skeleton and make that structure work with sessions Oct 22, 2020
@rishabhpoddar rishabhpoddar marked this pull request as ready for review October 23, 2020 19:57
@rishabhpoddar rishabhpoddar mentioned this pull request Oct 23, 2020
14 tasks
@rishabhpoddar rishabhpoddar merged commit 3a65051 into 3.0 Oct 23, 2020
@rishabhpoddar rishabhpoddar deleted the recipe-module-manager branch October 23, 2020 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants