Skip to content

Commit

Permalink
Merge pull request #54 from python-ellar/ellar_081_upgrade
Browse files Browse the repository at this point in the history
upgraded to ellar 0.8.1
  • Loading branch information
eadwinCode authored Aug 21, 2024
2 parents 4a7d55b + 3ce4184 commit 4d79165
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ellar_jwt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""JWT Module for Ellar"""

__version__ = "0.2.2"
__version__ = "0.2.4"
from .module import JWTModule
from .schemas import JWTConfiguration
from .services import JWTService
Expand Down
12 changes: 6 additions & 6 deletions ellar_jwt/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

from ellar.common import IModuleSetup, Module
from ellar.core import Config, ModuleSetup
from ellar.core.modules import DynamicModule, ModuleBase
from ellar.core.modules import DynamicModule, ModuleBase, ModuleRefBase
from ellar.di import ProviderConfig
from pydantic import AnyHttpUrl

from .schemas import JWTConfiguration
from .services import JWTService


@Module()
@Module(exports=[JWTService, JWTConfiguration])
class JWTModule(ModuleBase, IModuleSetup):
@classmethod
def setup(
Expand Down Expand Up @@ -43,7 +43,7 @@ def setup(
return DynamicModule(
cls,
providers=[
JWTService,
ProviderConfig(JWTService),
ProviderConfig(JWTConfiguration, use_value=configuration),
],
)
Expand All @@ -54,14 +54,14 @@ def register_setup(cls) -> ModuleSetup:

@staticmethod
def register_setup_factory(
module: t.Type["JWTModule"], config: Config
module_ref: ModuleRefBase, config: Config
) -> DynamicModule:
if config.get("JWT_CONFIG") and isinstance(config.JWT_CONFIG, dict):
schema = JWTConfiguration(**dict(config.JWT_CONFIG))
return DynamicModule(
module,
module_ref.module,
providers=[
JWTService,
ProviderConfig(JWTService),
ProviderConfig(JWTConfiguration, use_value=schema),
],
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ classifiers = [
]

dependencies = [
"ellar >= 0.5.8",
"ellar >= 0.8.2",
"pyjwt>=1.7.1,<3",
"pyjwt[crypto]"
]
Expand Down

0 comments on commit 4d79165

Please sign in to comment.