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

core connectors whitelist in file-uploader-api #56

Merged
merged 1 commit into from
Oct 30, 2023
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
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
Loading