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

fix: init and linting #539

Merged
merged 2 commits into from
Nov 6, 2024
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
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: Session",
"License :: OSI Approved :: Apache Software License",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.

from typing import Any, Dict, List, Union
from typing import Any, Dict, List, Union, Optional
from typing_extensions import Literal

from supertokens_python.recipe.multitenancy.asyncio import get_tenant
Expand All @@ -32,9 +32,6 @@
from ...interfaces import APIInterface, APIOptions, CoreConfigFieldInfo


from typing import List, Optional


class ThirdPartyProvider:
def __init__(self, third_party_id: str, name: str):
self.third_party_id = third_party_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,17 @@ async def get_third_party_config(
after_override = provider.override(before_override)

if (
before_override.get_authorisation_redirect_url
before_override.get_authorisation_redirect_url # pylint: disable=W0143
!= after_override.get_authorisation_redirect_url
):
is_get_authorisation_redirect_url_overridden = True
if (
before_override.exchange_auth_code_for_oauth_tokens
before_override.exchange_auth_code_for_oauth_tokens # pylint: disable=W0143
!= after_override.exchange_auth_code_for_oauth_tokens
):
is_exchange_auth_code_for_oauth_tokens_overridden = True
if (
before_override.get_user_info
before_override.get_user_info # pylint: disable=W0143
!= after_override.get_user_info
):
is_get_user_info_overridden = True
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def create_email_password_user(
_: APIInterface,
tenant_id: str,
api_options: APIOptions,
user_context: Dict[str, Any],
__: Dict[str, Any],
) -> Union[
CreateEmailPasswordUserOkResponse,
CreateEmailPasswordUserFeatureNotEnabledResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ async def create_passwordless_user(
raise BadInputError("Please provide exactly one of email or phoneNumber")

if email is not None and (
isinstance(passwordless_recipe.config.contact_config, ContactEmailOnlyConfig)
or isinstance(
passwordless_recipe.config.contact_config, ContactEmailOrPhoneConfig
isinstance(
passwordless_recipe.config.contact_config,
(ContactEmailOnlyConfig, ContactEmailOrPhoneConfig),
)
):
email = email.strip()
Expand All @@ -120,9 +120,9 @@ async def create_passwordless_user(
return CreatePasswordlessUserEmailValidationErrorResponse(validation_error)

if phone_number is not None and (
isinstance(passwordless_recipe.config.contact_config, ContactPhoneOnlyConfig)
or isinstance(
passwordless_recipe.config.contact_config, ContactEmailOrPhoneConfig
isinstance(
passwordless_recipe.config.contact_config,
(ContactPhoneOnlyConfig, ContactEmailOrPhoneConfig),
)
):
validation_error = (
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
GetPermissionsForRoleOkResult,
)

from supertokens_python.recipe.userroles.recipe import UserRolesRecipe
from supertokens_python.recipe.userroles.recipe import UserRolesRecipe
from supertokens_python.types import APIResponse

Expand Down Expand Up @@ -37,10 +36,10 @@ def to_json(self):


async def get_permissions_for_role_api(
_api_interface: APIInterface,
_tenant_id: str,
_: APIInterface,
__: str,
api_options: APIOptions,
user_context: Dict[str, Any],
___: Dict[str, Any],
) -> Union[
OkPermissionsForRoleResponse,
FeatureNotEnabledErrorResponse,
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def to_json(self):


async def get_all_roles_api(
_: APIInterface, __: str, api_options: APIOptions, ___: Any
_: APIInterface, __: str, ___: APIOptions, ____: Any
) -> Union[OkResponse, FeatureNotEnabledErrorResponse]:
try:
UserRolesRecipe.get_instance()
Expand Down
26 changes: 26 additions & 0 deletions supertokens_python/recipe/totp/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2024, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from .create_device import handle_create_device_api
from .list_devices import handle_list_devices_api
from .remove_device import handle_remove_device_api
from .verify_device import handle_verify_device_api
from .verify_totp import handle_verify_totp_api

__all__ = [
"handle_create_device_api",
"handle_list_devices_api",
"handle_remove_device_api",
"handle_verify_device_api",
"handle_verify_totp_api",
]
2 changes: 1 addition & 1 deletion supertokens_python/recipe/totp/api/create_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


async def handle_create_device_api(
tenant_id: str,
_: str,
api_implementation: APIInterface,
api_options: APIOptions,
user_context: Dict[str, Any],
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/totp/api/list_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


async def handle_list_devices_api(
tenant_id: str,
_: str,
api_implementation: APIInterface,
api_options: APIOptions,
user_context: Dict[str, Any],
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/totp/api/remove_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


async def handle_remove_device_api(
tenant_id: str,
_: str,
api_implementation: APIInterface,
api_options: APIOptions,
user_context: Dict[str, Any],
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/totp/api/verify_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


async def handle_verify_device_api(
tenant_id: str,
_: str,
api_implementation: APIInterface,
api_options: APIOptions,
user_context: Dict[str, Any],
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/totp/api/verify_totp.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


async def handle_verify_totp_api(
tenant_id: str,
_: str,
api_implementation: APIInterface,
api_options: APIOptions,
user_context: Dict[str, Any],
Expand Down
Loading
Loading