Skip to content

feat: plugins #594

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

Open
wants to merge 29 commits into
base: 0.31
Choose a base branch
from
Open

feat: plugins #594

wants to merge 29 commits into from

Conversation

namsnath
Copy link
Contributor

Summary of change

(A few sentences about this PR)

Related issues

  • Link to issue1 here
  • Link to issue1 here

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
  • coreDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in supertokens_python/constants.py
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In setup.py
    • In supertokens_python/constants.py
  • Had installed and ran the pre-commit hook
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If have added a new web framework, update the supertokens_python/utils.py file to include that in the FRAMEWORKS variable
  • If added a new recipe that has a User type with extra info, then be sure to change the User type in supertokens_python/types.py
  • Make sure that syncio / asyncio functions are consistent.
  • If access token structure has changed
    • Modified test in tests/sessions/test_access_token_version.py to account for any new claims that are optional or omitted by the core

Remaining TODOs for this PR

  • Item1
  • Item2

@namsnath namsnath self-assigned this Jun 10, 2025
@namsnath namsnath changed the base branch from 0.29 to 0.30 July 2, 2025 12:39
@namsnath namsnath force-pushed the feat/plugin/experiment branch from 2dee1be to ca412e5 Compare July 3, 2025 06:30
@namsnath namsnath requested review from sattvikc and porcellus July 3, 2025 09:45
@namsnath namsnath marked this pull request as ready for review July 7, 2025 05:20
Copy link

promptless bot commented Jul 7, 2025

✅ No documentation updates required.

Copy link
Collaborator

@porcellus porcellus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reviewed the broad strokes, those LGTM. Will wait for an in-depth review from @sattvikc

@@ -25,23 +25,21 @@
from .recipe import EmailPasswordRecipe

exceptions = ex
InputOverrideConfig = utils.InputOverrideConfig
EmailPasswordOverrideConfig = utils.EmailPasswordOverrideConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be InputOverrideConfig = ?


from .recipe import DashboardRecipe

InputOverrideConfig = utils.InputOverrideConfig
DashboardOverrideConfig = utils.DashboardOverrideConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be InputOverrideConfig = ?

from . import types
from .recipe import AccountLinkingRecipe

InputOverrideConfig = types.InputOverrideConfig
AccountLinkingOverrideConfig = types.AccountLinkingOverrideConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be InputOverrideConfig = ?


from .recipe import JWTRecipe
from .utils import OverrideConfig
from .utils import JWTOverrideConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require exporting as InputOverrideConfig (like other recipes)?

@@ -70,7 +72,7 @@ def __init__(
request: BaseRequest,
response: BaseResponse,
recipe_id: str,
config: JWTConfig,
config: "NormalisedJWTConfig",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not imported?

from supertokens_python.supertokens import AppInfo

from ...recipe_module import RecipeModule
from supertokens_python.supertokens import RecipeInit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't TOTP have an override config?



def init(
override: Union[utils.InputOverrideConfig, None] = None,
) -> Callable[[AppInfo], RecipeModule]:
override: Union[utils.UserMetadataOverrideConfig, None] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override config not exported?



def init(
skip_adding_roles_to_access_token: Optional[bool] = None,
skip_adding_permissions_to_access_token: Optional[bool] = None,
override: Union[utils.InputOverrideConfig, None] = None,
) -> Callable[[AppInfo], RecipeModule]:
override: Union[utils.UserRolesOverrideConfig, None] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override config not exported?

@@ -60,6 +61,9 @@ def init(config: Optional[WebauthnConfig] = None):

__all__ = [
"init",
"APIInterface",
"RecipeInterface",
"WebauthnOverrideConfig",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be exported as InputOverrideConfig ?

@@ -93,7 +96,7 @@ class TypeWebauthnRecoverAccountEmailDeliveryInput(CamelCaseBaseModel):
class APIOptions(CamelCaseBaseModel):
recipe_implementation: RecipeInterface
app_info: AppInfo
config: NormalisedWebauthnConfig
config: "NormalisedWebauthnConfig"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this imported for TYPE_CHECKING

@namsnath
Copy link
Contributor Author

Hi @sattvikc ,
Addressed the comments in the last few commits

  • Redefined exports using __all__ in __init__ files to clean them up and make them consistent
  • Added old class names as aliases for backward compatibility

For the comments about quoted types, these are mainly to fix circular import issues since types used in classes need to be imported for use, or annotated (as done here)
Added some model_rebuild calls to fix Pydantic errors due to the annotated types

@namsnath namsnath requested a review from sattvikc July 23, 2025 12:12
@namsnath namsnath force-pushed the feat/plugin/experiment branch from 7b4083f to 5b1f37e Compare July 25, 2025 09:28
@namsnath namsnath changed the base branch from 0.30 to 0.31 July 29, 2025 11:24
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.

3 participants
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