Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.31.0] - 2025-07-18
## [0.31.0] - 2025-08-21
### Adds plugins support
- Adds an `experimental` property (`SuperTokensExperimentalConfig`) to the `SuperTokensConfig`
- Plugins can be configured under using the `plugins` property in the `experimental` config
- Refactors the AccountLinking recipe to be automatically initialized on SuperTokens init
- Adds `is_recipe_initialized` method to check if a recipe has been initialized

### Breaking Changes
- Removed default `default_max_age` from all built-in claims/validators.
- You can optionally set them when adding the validators.
- This should help with unexpected API calls during session verification.
- `AccountLinkingRecipe.get_instance` will now raise an exception if not initialized
- Various config classes renamed for consistency across the codebase, and classes added where they were missing
- Old classes added to the recipe modules as aliases for backward compatibility, but will be removed in future versions. Prefer using the renamed classes.
Expand Down
4 changes: 1 addition & 3 deletions supertokens_python/recipe/multitenancy/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ def reset():

class AllowedDomainsClaimClass(PrimitiveArrayClaim[List[str]]):
def __init__(self):
default_max_age_in_sec = 60 * 60

async def fetch_value(
_user_id: str,
_recipe_user_id: RecipeUserId,
Expand All @@ -219,7 +217,7 @@ async def fetch_value(
tenant_id, user_context
)

super().__init__("st-t-dmns", fetch_value, default_max_age_in_sec)
super().__init__("st-t-dmns", fetch_value)


AllowedDomainsClaim = AllowedDomainsClaimClass()
6 changes: 2 additions & 4 deletions supertokens_python/recipe/userroles/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def get_instance() -> UserRolesRecipe:
class PermissionClaimClass(PrimitiveArrayClaim[List[str]]):
def __init__(self) -> None:
key = "st-perm"
default_max_age_in_sec = 300

async def fetch_value(
user_id: str,
Expand Down Expand Up @@ -289,7 +288,7 @@ async def fetch_value(

return list(user_permissions)

super().__init__(key, fetch_value, default_max_age_in_sec)
super().__init__(key, fetch_value)


PermissionClaim = PermissionClaimClass()
Expand All @@ -298,7 +297,6 @@ async def fetch_value(
class UserRoleClaimClass(PrimitiveArrayClaim[List[str]]):
def __init__(self) -> None:
key = "st-role"
default_max_age_in_sec = 300

async def fetch_value(
user_id: str,
Expand All @@ -313,7 +311,7 @@ async def fetch_value(
)
return res.roles

super().__init__(key, fetch_value, default_max_age_in_sec)
super().__init__(key, fetch_value)


UserRoleClaim = UserRoleClaimClass()
Loading