Skip to content

Commit c9f00e7

Browse files
authored
Merge pull request #139 from python-ellar/core_and_auth_dependency
Fixed Auth And Core pkg Dependency
2 parents 6c31c1b + 49e9a19 commit c9f00e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+146
-118
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $(venv) pip install ellar
5151
```python
5252
import uvicorn
5353
from ellar.common import Body, Controller, ControllerBase, delete, get, post, put, Serializer, Inject
54-
from ellar.core import AppFactory
54+
from ellar.app import AppFactory
5555
from ellar.di import injectable, request_scope
5656
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerUI
5757
from pydantic import Field

docs/basics/lifespan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The lifespan manager must be run before ellar starts serving incoming request.
66
```python
77
import uvicorn
88
import contextlib
9-
from ellar.core import App, AppFactory
9+
from ellar.app import App, AppFactory
1010

1111
@contextlib.asynccontextmanager
1212
async def some_async_resource():

docs/custom-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class MathAPI:
4242
Create another file `server.py`:
4343

4444
```Python
45-
from ellar.core import AppFactory
45+
from ellar.app import AppFactory
4646
from ellar.openapi import OpenAPIDocumentBuilder, OpenAPIDocumentModule
4747
from .controller import router, MathAPI
4848

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $(venv) pip install ellar
5757
```python
5858
import uvicorn
5959
from ellar.common import Body, Controller, ControllerBase, delete, get, post, put, Serializer, Inject
60-
from ellar.core import AppFactory
60+
from ellar.app import AppFactory
6161
from ellar.di import injectable, request_scope
6262
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerUI
6363
from pydantic import Field

docs/overview/interceptors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ If we want to restrict the interceptor's scope to a single method, we simply app
121121
In order to set up a global interceptor, we use the use_global_interceptors() method of the Ellar application instance:
122122

123123
```python
124-
from ellar.core import AppFactory
124+
from ellar.app import AppFactory
125125

126126
app = AppFactory.create_from_app_module(ApplicationModule)
127127
app.use_global_interceptors(LoggingInterceptor())

docs/overview/step-one.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ In `project_name.server`, we create the `application` instance using the `AppFac
5454
import os
5555

5656
from ellar.common.constants import ELLAR_CONFIG_MODULE
57-
from ellar.core.factory import AppFactory
57+
from ellar.app import AppFactory
5858
from .root_module import ApplicationModule
5959

6060
application = AppFactory.create_from_app_module(

docs/quick-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ then add the following below.
244244
import os
245245

246246
from ellar.common.constants import ELLAR_CONFIG_MODULE
247-
from ellar.core import AppFactory
247+
from ellar.app import AppFactory
248248
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerDocumentGenerator
249249
from .root_module import ApplicationModule
250250

docs/security/authentication.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ from ellar.auth import UserIdentity
270270
from ellar.common.serializer.guard import (
271271
HTTPAuthorizationCredentials,
272272
)
273-
from ellar.core.guards import GuardHttpBearerAuth
273+
from ellar.auth.guards import GuardHttpBearerAuth
274274
from ellar.di import injectable
275275
from ellar_jwt import JWTService
276276
from ellar.common import logger, IExecutionContext
@@ -494,7 +494,7 @@ Let us define a mechanism for declaring routes as anonymous or public.
494494
HTTPAuthorizationCredentials,
495495
)
496496
from ellar.common import IExecutionContext, set_metadata, logger
497-
from ellar.core.guards import GuardHttpBearerAuth
497+
from ellar.auth.guards import GuardHttpBearerAuth
498498
from ellar.core import Reflector
499499
from ellar.di import injectable
500500
from ellar_jwt import JWTService
@@ -543,7 +543,7 @@ Let us define a mechanism for declaring routes as anonymous or public.
543543
HTTPAuthorizationCredentials,
544544
)
545545
from ellar.common import IExecutionContext, set_metadata, constants, GuardCanActivate, logger
546-
from ellar.core.guards import GuardHttpBearerAuth
546+
from ellar.auth.guards import GuardHttpBearerAuth
547547
from ellar.di import injectable
548548
from ellar_jwt import JWTService
549549

ellar/app/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .factory import AppFactory
2+
from .main import App
3+
4+
__all__ = [
5+
"App",
6+
"AppFactory",
7+
]

ellar/core/factory.py renamed to ellar/app/factory.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
from ellar.common import EllarTyper
77
from ellar.common.constants import MODULE_METADATA, MODULE_WATERMARK
88
from ellar.common.models import GuardCanActivate
9-
from ellar.core.main import App
9+
from ellar.core.conf import Config
1010
from ellar.core.modules import DynamicModule, ModuleBase, ModuleSetup
1111
from ellar.di import EllarInjector, ProviderConfig
1212
from ellar.reflect import reflect
1313
from starlette.routing import Host, Mount
1414

15-
from .conf import Config
16-
from .core_services import EllarCoreService
15+
from .main import App
16+
from .services import EllarAppService
1717

1818
if t.TYPE_CHECKING: # pragma: no cover
1919
from ellar.common.routing import ModuleMount, ModuleRouter
@@ -132,8 +132,8 @@ def _get_config_kwargs() -> t.Dict:
132132
config = Config(app_configured=True, **_get_config_kwargs())
133133
injector = EllarInjector(auto_bind=config.INJECTOR_AUTO_BIND)
134134
injector.container.register_instance(config, concrete_type=Config)
135-
core_service = EllarCoreService(injector, config)
136-
core_service.register_core_services()
135+
service = EllarAppService(injector, config)
136+
service.register_core_services()
137137

138138
cls._build_modules(app_module=module, injector=injector, config=config)
139139

0 commit comments

Comments
 (0)