-
Notifications
You must be signed in to change notification settings - Fork 43
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
base: 0.31
Are you sure you want to change the base?
feat: plugins #594
Conversation
2dee1be
to
ca412e5
Compare
✅ No documentation updates required. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
Hi @sattvikc ,
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) |
- Matches plugin eval order to Node - Adds recursive dependency resolution - Adds tests for overrides and dependencies
- Defines aliases for old override config classes for backward compatibility - Adds `__all__` to recipe `__init__` files to explicitly declare exports - FIxes `apply_plugins` config input/return type - Adds ruff rule to format `__all__` exports - Updates changelog
7b4083f
to
5b1f37e
Compare
Summary of change
(A few sentences about this PR)
Related issues
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
coreDriverInterfaceSupported.json
file has been updated (if needed)supertokens_python/constants.py
frontendDriverInterfaceSupported.json
file has been updated (if needed)setup.py
supertokens_python/constants.py
git tag
) in the formatvX.Y.Z
, and then find the latest branch (git branch --all
) whoseX.Y
is greater than the latest released tag.supertokens_python/utils.py
file to include that in theFRAMEWORKS
variablesyncio
/asyncio
functions are consistent.tests/sessions/test_access_token_version.py
to account for any new claims that are optional or omitted by the coreRemaining TODOs for this PR