Skip to content

Commit

Permalink
core connectors whitelist in file-uploader-api (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
asnytin authored Oct 30, 2023
1 parent 50d659b commit 9493976
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
8 changes: 6 additions & 2 deletions lib/dl_file_uploader_api_lib/dl_file_uploader_api_lib/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
from dl_core.aio.middlewares.master_key import master_key_middleware
from dl_core.aio.ping_view import PingView
from dl_core.aio.web_app_services.s3 import S3Service
from dl_core.loader import load_core_lib
from dl_core.loader import (
CoreLibraryConfig,
load_core_lib,
)
from dl_file_uploader_api_lib.aiohttp_services.arq_redis import ArqRedisService
from dl_file_uploader_api_lib.aiohttp_services.crypto import CryptoService
from dl_file_uploader_api_lib.aiohttp_services.error_handler import FileUploaderErrorHandler
Expand Down Expand Up @@ -59,7 +62,8 @@ def set_up_sentry(self, secret_sentry_dsn: str, release: str) -> None:
)

def create_app(self, app_version: str) -> web.Application:
load_core_lib()
core_conn_whitelist = ["clickhouse", "file", "gsheets_v2"]
load_core_lib(core_lib_config=CoreLibraryConfig(core_connector_ep_names=core_conn_whitelist))

if (secret_sentry_dsn := self._settings.SENTRY_DSN) is not None:
self.set_up_sentry(secret_sentry_dsn, app_version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
from dl_file_uploader_api_lib.app import FileUploaderApiAppFactory
from dl_file_uploader_api_lib.dl_request import FileUploaderDLRequest
from dl_file_uploader_api_lib.settings import FileUploaderAPISettings
from dl_file_uploader_api_lib_tests.config import (
CONNECTOR_WHITELIST,
TestingUSConfig,
)
from dl_file_uploader_lib.redis_model.base import RedisModelManager
from dl_file_uploader_task_interface.context import FileUploaderTaskContext
from dl_file_uploader_worker_lib.settings import (
Expand All @@ -74,11 +78,6 @@

from dl_connector_bundle_chs3.chs3_base.core.settings import FileS3ConnectorSettings

from dl_file_uploader_api_lib_tests.config import (
CONNECTOR_WHITELIST,
TestingUSConfig,
)


if TYPE_CHECKING:
from types_aiobotocore_s3 import S3Client as AsyncS3Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
)
from dl_file_uploader_worker_lib.tasks import REGISTRY
from dl_file_uploader_worker_lib.testing.app_factory import TestingFileUploaderWorkerFactory
from dl_file_uploader_worker_lib_tests.config import (
CONNECTOR_WHITELIST,
TestingUSConfig,
)
from dl_task_processor.arq_wrapper import (
create_arq_redis_settings,
create_redis_pool,
Expand All @@ -67,11 +71,6 @@

from dl_connector_bundle_chs3.chs3_base.core.settings import FileS3ConnectorSettings

from dl_file_uploader_worker_lib_tests.config import (
CONNECTOR_WHITELIST,
TestingUSConfig,
)


if TYPE_CHECKING:
from mypy_boto3_s3.client import S3Client as SyncS3Client
Expand Down

0 comments on commit 9493976

Please sign in to comment.