diff --git a/backend/dataall/modules/dataset_sharing/cdk/__init__.py b/backend/dataall/modules/dataset_sharing/cdk/__init__.py deleted file mode 100644 index 6a13887b4..000000000 --- a/backend/dataall/modules/dataset_sharing/cdk/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from dataall.modules.dataset_sharing.cdk import pivot_role_data_sharing_policy - -__all__ = ['pivot_role_data_sharing_policy'] diff --git a/backend/dataall/modules/dataset_sharing/handlers/__init__.py b/backend/dataall/modules/dataset_sharing/handlers/__init__.py deleted file mode 100644 index f24ee985c..000000000 --- a/backend/dataall/modules/dataset_sharing/handlers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from dataall.modules.dataset_sharing.handlers import ecs_share_handler - -__all__ = ['ecs_share_handler'] diff --git a/backend/dataall/modules/dataset_sharing/__init__.py b/backend/dataall/modules/s3_datasets_shares/__init__.py similarity index 64% rename from backend/dataall/modules/dataset_sharing/__init__.py rename to backend/dataall/modules/s3_datasets_shares/__init__.py index bffa8a903..c20ec5b79 100644 --- a/backend/dataall/modules/dataset_sharing/__init__.py +++ b/backend/dataall/modules/s3_datasets_shares/__init__.py @@ -7,7 +7,7 @@ log = logging.getLogger(__name__) -class SharingApiModuleInterface(ModuleInterface): +class S3DatasetsSharesApiModuleInterface(ModuleInterface): @staticmethod def is_supported(modes: Set[ImportMode]) -> bool: return ImportMode.API in modes @@ -16,17 +16,18 @@ def is_supported(modes: Set[ImportMode]) -> bool: def depends_on() -> List[Type['ModuleInterface']]: from dataall.modules.notifications import NotificationsModuleInterface from dataall.modules.s3_datasets import DatasetApiModuleInterface + from dataall.modules.shares_base import SharesBaseModuleInterface - return [DatasetApiModuleInterface, NotificationsModuleInterface] + return [DatasetApiModuleInterface, NotificationsModuleInterface, SharesBaseModuleInterface] def __init__(self): from dataall.core.environment.services.environment_resource_manager import EnvironmentResourceManager - from dataall.modules.dataset_sharing import api - from dataall.modules.dataset_sharing.services.managed_share_policy_service import SharePolicyService + from dataall.modules.s3_datasets_shares import api + from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import SharePolicyService from dataall.modules.s3_datasets.services.dataset_service import DatasetService from dataall.modules.datasets_base.services.dataset_list_service import DatasetListService - from dataall.modules.dataset_sharing.services.dataset_sharing_service import DatasetSharingService - from dataall.modules.dataset_sharing.db.share_object_repositories import ShareEnvironmentResource + from dataall.modules.s3_datasets_shares.services.dataset_sharing_service import DatasetSharingService + from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareEnvironmentResource EnvironmentResourceManager.register(ShareEnvironmentResource()) DatasetService.register(DatasetSharingService()) @@ -34,7 +35,7 @@ def __init__(self): log.info('API of dataset sharing has been imported') -class SharingAsyncHandlersModuleInterface(ModuleInterface): +class S3DatasetsSharesAsyncHandlersModuleInterface(ModuleInterface): """Implements ModuleInterface for dataset async lambda""" @staticmethod @@ -45,16 +46,17 @@ def is_supported(modes: List[ImportMode]): def depends_on() -> List[Type['ModuleInterface']]: from dataall.modules.notifications import NotificationsModuleInterface from dataall.modules.s3_datasets import DatasetAsyncHandlersModuleInterface + from dataall.modules.shares_base import SharesBaseModuleInterface - return [DatasetAsyncHandlersModuleInterface, NotificationsModuleInterface] + return [DatasetAsyncHandlersModuleInterface, NotificationsModuleInterface, SharesBaseModuleInterface] def __init__(self): - import dataall.modules.dataset_sharing.handlers + import dataall.modules.s3_datasets_shares.handlers log.info('Sharing handlers have been imported') -class DataSharingCdkModuleInterface(ModuleInterface): +class S3DatasetsSharesCdkModuleInterface(ModuleInterface): """Implements ModuleInterface for data sharing""" @staticmethod @@ -62,7 +64,7 @@ def is_supported(modes): return ImportMode.CDK in modes def __init__(self): - import dataall.modules.dataset_sharing.cdk - from dataall.modules.dataset_sharing.services.managed_share_policy_service import SharePolicyService + import dataall.modules.s3_datasets_shares.cdk + from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import SharePolicyService log.info('CDK module data_sharing has been imported') diff --git a/backend/dataall/modules/dataset_sharing/api/__init__.py b/backend/dataall/modules/s3_datasets_shares/api/__init__.py similarity index 73% rename from backend/dataall/modules/dataset_sharing/api/__init__.py rename to backend/dataall/modules/s3_datasets_shares/api/__init__.py index 1a101fb7e..fc054d1d2 100644 --- a/backend/dataall/modules/dataset_sharing/api/__init__.py +++ b/backend/dataall/modules/s3_datasets_shares/api/__init__.py @@ -1,4 +1,4 @@ -from dataall.modules.dataset_sharing.api import ( +from dataall.modules.s3_datasets_shares.api import ( input_types, mutations, queries, diff --git a/backend/dataall/modules/dataset_sharing/api/input_types.py b/backend/dataall/modules/s3_datasets_shares/api/input_types.py similarity index 96% rename from backend/dataall/modules/dataset_sharing/api/input_types.py rename to backend/dataall/modules/s3_datasets_shares/api/input_types.py index 9ee7c9794..572c8aa9e 100644 --- a/backend/dataall/modules/dataset_sharing/api/input_types.py +++ b/backend/dataall/modules/s3_datasets_shares/api/input_types.py @@ -1,5 +1,5 @@ from dataall.base.api.constants import SortDirection, gql -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareableType, ShareSortField +from dataall.modules.shares_base.services.shares_enums import ShareableType, ShareSortField NewShareObjectInput = gql.InputType( diff --git a/backend/dataall/modules/dataset_sharing/api/mutations.py b/backend/dataall/modules/s3_datasets_shares/api/mutations.py similarity index 98% rename from backend/dataall/modules/dataset_sharing/api/mutations.py rename to backend/dataall/modules/s3_datasets_shares/api/mutations.py index c878234a0..f669e8181 100644 --- a/backend/dataall/modules/dataset_sharing/api/mutations.py +++ b/backend/dataall/modules/s3_datasets_shares/api/mutations.py @@ -1,5 +1,5 @@ from dataall.base.api import gql -from dataall.modules.dataset_sharing.api.resolvers import ( +from dataall.modules.s3_datasets_shares.api.resolvers import ( add_shared_item, approve_share_object, create_share_object, diff --git a/backend/dataall/modules/dataset_sharing/api/queries.py b/backend/dataall/modules/s3_datasets_shares/api/queries.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/api/queries.py rename to backend/dataall/modules/s3_datasets_shares/api/queries.py index 34d072656..39620f498 100644 --- a/backend/dataall/modules/dataset_sharing/api/queries.py +++ b/backend/dataall/modules/s3_datasets_shares/api/queries.py @@ -1,5 +1,5 @@ from dataall.base.api import gql -from dataall.modules.dataset_sharing.api.resolvers import ( +from dataall.modules.s3_datasets_shares.api.resolvers import ( get_dataset_shared_assume_role_url, get_share_object, list_shared_with_environment_data_items, diff --git a/backend/dataall/modules/dataset_sharing/api/resolvers.py b/backend/dataall/modules/s3_datasets_shares/api/resolvers.py similarity index 95% rename from backend/dataall/modules/dataset_sharing/api/resolvers.py rename to backend/dataall/modules/s3_datasets_shares/api/resolvers.py index e8146912b..0199fce58 100644 --- a/backend/dataall/modules/dataset_sharing/api/resolvers.py +++ b/backend/dataall/modules/s3_datasets_shares/api/resolvers.py @@ -6,12 +6,12 @@ from dataall.core.organizations.db.organization_repositories import OrganizationRepository from dataall.base.db.exceptions import RequiredParameter from dataall.base.feature_toggle_checker import is_feature_enabled -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareObjectPermission -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem, ShareObject -from dataall.modules.dataset_sharing.services.share_item_service import ShareItemService -from dataall.modules.dataset_sharing.services.share_object_service import ShareObjectService -from dataall.modules.dataset_sharing.services.dataset_sharing_service import DatasetSharingService -from dataall.modules.dataset_sharing.aws.glue_client import GlueClient +from dataall.modules.shares_base.services.shares_enums import ShareObjectPermission +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem, ShareObject +from dataall.modules.s3_datasets_shares.services.share_item_service import ShareItemService +from dataall.modules.s3_datasets_shares.services.share_object_service import ShareObjectService +from dataall.modules.s3_datasets_shares.services.dataset_sharing_service import DatasetSharingService +from dataall.modules.s3_datasets_shares.aws.glue_client import GlueClient from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, DatasetTable, S3Dataset diff --git a/backend/dataall/modules/dataset_sharing/api/types.py b/backend/dataall/modules/s3_datasets_shares/api/types.py similarity index 98% rename from backend/dataall/modules/dataset_sharing/api/types.py rename to backend/dataall/modules/s3_datasets_shares/api/types.py index 8d481cc5c..158aed212 100644 --- a/backend/dataall/modules/dataset_sharing/api/types.py +++ b/backend/dataall/modules/s3_datasets_shares/api/types.py @@ -1,10 +1,10 @@ from dataall.base.api import gql -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareableType, PrincipalType, ShareItemHealthStatus, ) -from dataall.modules.dataset_sharing.api.resolvers import ( +from dataall.modules.s3_datasets_shares.api.resolvers import ( union_resolver, resolve_shared_item, resolve_dataset, diff --git a/backend/dataall/modules/dataset_sharing/aws/__init__.py b/backend/dataall/modules/s3_datasets_shares/aws/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/aws/__init__.py rename to backend/dataall/modules/s3_datasets_shares/aws/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/aws/glue_client.py b/backend/dataall/modules/s3_datasets_shares/aws/glue_client.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/aws/glue_client.py rename to backend/dataall/modules/s3_datasets_shares/aws/glue_client.py diff --git a/backend/dataall/modules/dataset_sharing/aws/kms_client.py b/backend/dataall/modules/s3_datasets_shares/aws/kms_client.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/aws/kms_client.py rename to backend/dataall/modules/s3_datasets_shares/aws/kms_client.py index 61e44927f..d59f4c099 100644 --- a/backend/dataall/modules/dataset_sharing/aws/kms_client.py +++ b/backend/dataall/modules/s3_datasets_shares/aws/kms_client.py @@ -2,7 +2,7 @@ from dataall.base.aws.sts import SessionHelper from botocore.exceptions import ClientError -from dataall.modules.dataset_sharing.aws.share_policy_verifier import SharePolicyVerifier +from dataall.modules.s3_datasets_shares.aws.share_policy_verifier import SharePolicyVerifier log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/aws/lakeformation_client.py b/backend/dataall/modules/s3_datasets_shares/aws/lakeformation_client.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/aws/lakeformation_client.py rename to backend/dataall/modules/s3_datasets_shares/aws/lakeformation_client.py diff --git a/backend/dataall/modules/dataset_sharing/aws/ram_client.py b/backend/dataall/modules/s3_datasets_shares/aws/ram_client.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/aws/ram_client.py rename to backend/dataall/modules/s3_datasets_shares/aws/ram_client.py diff --git a/backend/dataall/modules/dataset_sharing/aws/s3_client.py b/backend/dataall/modules/s3_datasets_shares/aws/s3_client.py similarity index 98% rename from backend/dataall/modules/dataset_sharing/aws/s3_client.py rename to backend/dataall/modules/s3_datasets_shares/aws/s3_client.py index eb9e8eb01..191ed2646 100755 --- a/backend/dataall/modules/dataset_sharing/aws/s3_client.py +++ b/backend/dataall/modules/s3_datasets_shares/aws/s3_client.py @@ -4,7 +4,7 @@ from botocore.exceptions import ClientError -from dataall.modules.dataset_sharing.aws.share_policy_verifier import SharePolicyVerifier +from dataall.modules.s3_datasets_shares.aws.share_policy_verifier import SharePolicyVerifier log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/aws/share_policy_verifier.py b/backend/dataall/modules/s3_datasets_shares/aws/share_policy_verifier.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/aws/share_policy_verifier.py rename to backend/dataall/modules/s3_datasets_shares/aws/share_policy_verifier.py diff --git a/backend/dataall/modules/s3_datasets_shares/cdk/__init__.py b/backend/dataall/modules/s3_datasets_shares/cdk/__init__.py new file mode 100644 index 000000000..f01316a76 --- /dev/null +++ b/backend/dataall/modules/s3_datasets_shares/cdk/__init__.py @@ -0,0 +1,3 @@ +from dataall.modules.s3_datasets_shares.cdk import pivot_role_data_sharing_policy + +__all__ = ['pivot_role_data_sharing_policy'] diff --git a/backend/dataall/modules/dataset_sharing/cdk/pivot_role_data_sharing_policy.py b/backend/dataall/modules/s3_datasets_shares/cdk/pivot_role_data_sharing_policy.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/cdk/pivot_role_data_sharing_policy.py rename to backend/dataall/modules/s3_datasets_shares/cdk/pivot_role_data_sharing_policy.py diff --git a/backend/dataall/modules/dataset_sharing/db/__init__.py b/backend/dataall/modules/s3_datasets_shares/db/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/db/__init__.py rename to backend/dataall/modules/s3_datasets_shares/db/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/db/share_object_models.py b/backend/dataall/modules/s3_datasets_shares/db/share_object_models.py similarity index 96% rename from backend/dataall/modules/dataset_sharing/db/share_object_models.py rename to backend/dataall/modules/s3_datasets_shares/db/share_object_models.py index 440720781..372d91885 100644 --- a/backend/dataall/modules/dataset_sharing/db/share_object_models.py +++ b/backend/dataall/modules/s3_datasets_shares/db/share_object_models.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import query_expression from dataall.base.db import Base, utils -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareObjectStatus, ShareItemStatus, ) diff --git a/backend/dataall/modules/dataset_sharing/db/share_object_repositories.py b/backend/dataall/modules/s3_datasets_shares/db/share_object_repositories.py similarity index 99% rename from backend/dataall/modules/dataset_sharing/db/share_object_repositories.py rename to backend/dataall/modules/s3_datasets_shares/db/share_object_repositories.py index 9bbc1723c..7d159465c 100644 --- a/backend/dataall/modules/dataset_sharing/db/share_object_repositories.py +++ b/backend/dataall/modules/s3_datasets_shares/db/share_object_repositories.py @@ -10,7 +10,7 @@ from dataall.core.environment.services.environment_resource_manager import EnvironmentResource from dataall.core.organizations.db.organization_models import Organization from dataall.base.db import exceptions, paginate -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareItemHealthStatus, ShareObjectActions, ShareObjectStatus, @@ -19,7 +19,7 @@ ShareableType, PrincipalType, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem, ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem, ShareObject from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, DatasetTable, S3Dataset, DatasetBucket from dataall.modules.datasets_base.db.dataset_models import DatasetBase diff --git a/backend/dataall/modules/s3_datasets_shares/handlers/__init__.py b/backend/dataall/modules/s3_datasets_shares/handlers/__init__.py new file mode 100644 index 000000000..b61dc1597 --- /dev/null +++ b/backend/dataall/modules/s3_datasets_shares/handlers/__init__.py @@ -0,0 +1,3 @@ +from dataall.modules.s3_datasets_shares.handlers import ecs_share_handler + +__all__ = ['ecs_share_handler'] diff --git a/backend/dataall/modules/dataset_sharing/handlers/ecs_share_handler.py b/backend/dataall/modules/s3_datasets_shares/handlers/ecs_share_handler.py similarity index 95% rename from backend/dataall/modules/dataset_sharing/handlers/ecs_share_handler.py rename to backend/dataall/modules/s3_datasets_shares/handlers/ecs_share_handler.py index 7098b672a..5f46d1dea 100644 --- a/backend/dataall/modules/dataset_sharing/handlers/ecs_share_handler.py +++ b/backend/dataall/modules/s3_datasets_shares/handlers/ecs_share_handler.py @@ -4,7 +4,7 @@ from dataall.core.tasks.service_handlers import Worker from dataall.core.stacks.aws.ecs import Ecs from dataall.core.tasks.db.task_models import Task -from dataall.modules.dataset_sharing.services.data_sharing_service import DataSharingService +from dataall.modules.s3_datasets_shares.services.data_sharing_service import DataSharingService log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/__init__.py b/backend/dataall/modules/s3_datasets_shares/services/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/__init__.py rename to backend/dataall/modules/s3_datasets_shares/services/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/services/data_sharing_service.py b/backend/dataall/modules/s3_datasets_shares/services/data_sharing_service.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/services/data_sharing_service.py rename to backend/dataall/modules/s3_datasets_shares/services/data_sharing_service.py index a66c309b0..70ee2164b 100644 --- a/backend/dataall/modules/dataset_sharing/services/data_sharing_service.py +++ b/backend/dataall/modules/s3_datasets_shares/services/data_sharing_service.py @@ -5,22 +5,22 @@ from datetime import datetime from dataall.base.db import Engine -from dataall.modules.dataset_sharing.db.share_object_repositories import ( +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ( ShareObjectSM, ShareObjectRepository, ShareItemSM, ) -from dataall.modules.dataset_sharing.services.share_item_service import ShareItemService -from dataall.modules.dataset_sharing.services.share_object_service import ShareObjectService -from dataall.modules.dataset_sharing.services.share_processors.lakeformation_process_share import ( +from dataall.modules.s3_datasets_shares.services.share_item_service import ShareItemService +from dataall.modules.s3_datasets_shares.services.share_object_service import ShareObjectService +from dataall.modules.s3_datasets_shares.services.share_processors.lakeformation_process_share import ( ProcessLakeFormationShare, ) -from dataall.modules.dataset_sharing.services.share_processors.s3_access_point_process_share import ( +from dataall.modules.s3_datasets_shares.services.share_processors.s3_access_point_process_share import ( ProcessS3AccessPointShare, ) -from dataall.modules.dataset_sharing.services.share_processors.s3_bucket_process_share import ProcessS3BucketShare +from dataall.modules.s3_datasets_shares.services.share_processors.s3_bucket_process_share import ProcessS3BucketShare -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareItemHealthStatus, ShareObjectActions, ShareItemStatus, diff --git a/backend/dataall/modules/dataset_sharing/services/dataset_sharing_alarm_service.py b/backend/dataall/modules/s3_datasets_shares/services/dataset_sharing_alarm_service.py similarity index 98% rename from backend/dataall/modules/dataset_sharing/services/dataset_sharing_alarm_service.py rename to backend/dataall/modules/s3_datasets_shares/services/dataset_sharing_alarm_service.py index 6ad18beeb..5e45a1dbe 100644 --- a/backend/dataall/modules/dataset_sharing/services/dataset_sharing_alarm_service.py +++ b/backend/dataall/modules/s3_datasets_shares/services/dataset_sharing_alarm_service.py @@ -2,7 +2,7 @@ from datetime import datetime from dataall.core.environment.db.environment_models import Environment -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, DatasetStorageLocation, DatasetBucket from dataall.base.utils.alarm_service import AlarmService diff --git a/backend/dataall/modules/dataset_sharing/services/dataset_sharing_service.py b/backend/dataall/modules/s3_datasets_shares/services/dataset_sharing_service.py similarity index 95% rename from backend/dataall/modules/dataset_sharing/services/dataset_sharing_service.py rename to backend/dataall/modules/s3_datasets_shares/services/dataset_sharing_service.py index 3e7fc713a..a22c52f4c 100644 --- a/backend/dataall/modules/dataset_sharing/services/dataset_sharing_service.py +++ b/backend/dataall/modules/s3_datasets_shares/services/dataset_sharing_service.py @@ -4,13 +4,13 @@ from dataall.base.context import get_context from dataall.base.db import exceptions from dataall.base.aws.sts import SessionHelper -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ( +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ( ShareObjectRepository, ShareItemSM, ) -from dataall.modules.dataset_sharing.services.share_permissions import SHARE_OBJECT_APPROVER -from dataall.modules.dataset_sharing.services.share_item_service import ShareItemService +from dataall.modules.shares_base.services.share_permissions import SHARE_OBJECT_APPROVER +from dataall.modules.s3_datasets_shares.services.share_item_service import ShareItemService from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository from dataall.modules.s3_datasets.services.dataset_permissions import ( MANAGE_DATASETS, diff --git a/backend/dataall/modules/dataset_sharing/services/managed_share_policy_service.py b/backend/dataall/modules/s3_datasets_shares/services/managed_share_policy_service.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/managed_share_policy_service.py rename to backend/dataall/modules/s3_datasets_shares/services/managed_share_policy_service.py diff --git a/backend/dataall/modules/dataset_sharing/services/share_exceptions.py b/backend/dataall/modules/s3_datasets_shares/services/share_exceptions.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/share_exceptions.py rename to backend/dataall/modules/s3_datasets_shares/services/share_exceptions.py diff --git a/backend/dataall/modules/dataset_sharing/services/share_item_service.py b/backend/dataall/modules/s3_datasets_shares/services/share_item_service.py similarity index 95% rename from backend/dataall/modules/dataset_sharing/services/share_item_service.py rename to backend/dataall/modules/s3_datasets_shares/services/share_item_service.py index 69134c8a8..a1320745e 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_item_service.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_item_service.py @@ -7,23 +7,23 @@ from dataall.core.tasks.db.task_models import Task from dataall.base.db import utils from dataall.base.db.exceptions import ObjectNotFound, UnauthorizedOperation -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareObjectActions, ShareableType, ShareItemStatus, ShareItemActions, ShareItemHealthStatus, ) -from dataall.modules.dataset_sharing.aws.glue_client import GlueClient -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem -from dataall.modules.dataset_sharing.db.share_object_repositories import ( +from dataall.modules.s3_datasets_shares.aws.glue_client import GlueClient +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ( ShareObjectRepository, ShareObjectSM, ShareItemSM, ) -from dataall.modules.dataset_sharing.services.share_exceptions import ShareItemsFound -from dataall.modules.dataset_sharing.services.share_notification_service import ShareNotificationService -from dataall.modules.dataset_sharing.services.share_permissions import ( +from dataall.modules.s3_datasets_shares.services.share_exceptions import ShareItemsFound +from dataall.modules.s3_datasets_shares.services.share_notification_service import ShareNotificationService +from dataall.modules.shares_base.services.share_permissions import ( GET_SHARE_OBJECT, ADD_ITEM, REMOVE_ITEM, diff --git a/backend/dataall/modules/dataset_sharing/services/share_managers/__init__.py b/backend/dataall/modules/s3_datasets_shares/services/share_managers/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/share_managers/__init__.py rename to backend/dataall/modules/s3_datasets_shares/services/share_managers/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/services/share_managers/lf_share_manager.py b/backend/dataall/modules/s3_datasets_shares/services/share_managers/lf_share_manager.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/services/share_managers/lf_share_manager.py rename to backend/dataall/modules/s3_datasets_shares/services/share_managers/lf_share_manager.py index 3409aafa6..67e379b42 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_managers/lf_share_manager.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_managers/lf_share_manager.py @@ -5,23 +5,23 @@ from warnings import warn from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup from dataall.core.environment.services.environment_service import EnvironmentService -from dataall.modules.dataset_sharing.aws.glue_client import GlueClient -from dataall.modules.dataset_sharing.aws.lakeformation_client import LakeFormationClient +from dataall.modules.s3_datasets_shares.aws.glue_client import GlueClient +from dataall.modules.s3_datasets_shares.aws.lakeformation_client import LakeFormationClient from dataall.base.aws.quicksight import QuicksightClient from dataall.base.aws.iam import IAM from dataall.base.aws.sts import SessionHelper from dataall.base.db import exceptions -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository, ShareItemSM -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository, ShareItemSM +from dataall.modules.shares_base.services.shares_enums import ( ShareItemStatus, ShareObjectActions, ShareItemActions, ShareItemHealthStatus, ) from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, S3Dataset -from dataall.modules.dataset_sharing.services.dataset_sharing_alarm_service import DatasetSharingAlarmService -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem, ShareObject -from dataall.modules.dataset_sharing.services.share_managers.share_manager_utils import ShareErrorFormatter +from dataall.modules.s3_datasets_shares.services.dataset_sharing_alarm_service import DatasetSharingAlarmService +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem, ShareObject +from dataall.modules.s3_datasets_shares.services.share_managers.share_manager_utils import ShareErrorFormatter logger = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py b/backend/dataall/modules/s3_datasets_shares/services/share_managers/s3_access_point_share_manager.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py rename to backend/dataall/modules/s3_datasets_shares/services/share_managers/s3_access_point_share_manager.py index 2a71dd11a..c1da36a76 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_managers/s3_access_point_share_manager.py @@ -8,29 +8,29 @@ from dataall.core.environment.services.environment_service import EnvironmentService from dataall.base.db import utils from dataall.base.aws.sts import SessionHelper -from dataall.modules.dataset_sharing.aws.s3_client import ( +from dataall.modules.s3_datasets_shares.aws.s3_client import ( S3ControlClient, S3Client, DATAALL_ALLOW_OWNER_SID, DATAALL_DELEGATE_TO_ACCESS_POINT, ) -from dataall.modules.dataset_sharing.aws.kms_client import ( +from dataall.modules.s3_datasets_shares.aws.kms_client import ( KmsClient, DATAALL_ACCESS_POINT_KMS_DECRYPT_SID, DATAALL_KMS_PIVOT_ROLE_PERMISSIONS_SID, ) from dataall.base.aws.iam import IAM -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.services.dataset_sharing_alarm_service import DatasetSharingAlarmService -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository -from dataall.modules.dataset_sharing.services.share_exceptions import PrincipalRoleNotFound -from dataall.modules.dataset_sharing.services.share_managers.share_manager_utils import ShareErrorFormatter -from dataall.modules.dataset_sharing.services.managed_share_policy_service import ( +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.services.dataset_sharing_alarm_service import DatasetSharingAlarmService +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository +from dataall.modules.s3_datasets_shares.services.share_exceptions import PrincipalRoleNotFound +from dataall.modules.s3_datasets_shares.services.share_managers.share_manager_utils import ShareErrorFormatter +from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import ( SharePolicyService, IAM_S3_ACCESS_POINTS_STATEMENT_SID, EMPTY_STATEMENT_SID, ) -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import PrincipalType +from dataall.modules.shares_base.services.shares_enums import PrincipalType from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, S3Dataset logger = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/share_managers/s3_bucket_share_manager.py b/backend/dataall/modules/s3_datasets_shares/services/share_managers/s3_bucket_share_manager.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/services/share_managers/s3_bucket_share_manager.py rename to backend/dataall/modules/s3_datasets_shares/services/share_managers/s3_bucket_share_manager.py index 0e31cf8d0..209abe71b 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_managers/s3_bucket_share_manager.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_managers/s3_bucket_share_manager.py @@ -7,24 +7,24 @@ from dataall.base.aws.sts import SessionHelper from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup from dataall.core.environment.services.environment_service import EnvironmentService -from dataall.modules.dataset_sharing.aws.kms_client import ( +from dataall.modules.s3_datasets_shares.aws.kms_client import ( KmsClient, DATAALL_BUCKET_KMS_DECRYPT_SID, DATAALL_KMS_PIVOT_ROLE_PERMISSIONS_SID, ) -from dataall.modules.dataset_sharing.aws.s3_client import S3ControlClient, S3Client, DATAALL_READ_ONLY_SID -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.services.share_exceptions import PrincipalRoleNotFound -from dataall.modules.dataset_sharing.services.share_managers.share_manager_utils import ShareErrorFormatter -from dataall.modules.dataset_sharing.services.dataset_sharing_alarm_service import DatasetSharingAlarmService -from dataall.modules.dataset_sharing.services.managed_share_policy_service import ( +from dataall.modules.s3_datasets_shares.aws.s3_client import S3ControlClient, S3Client, DATAALL_READ_ONLY_SID +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.services.share_exceptions import PrincipalRoleNotFound +from dataall.modules.s3_datasets_shares.services.share_managers.share_manager_utils import ShareErrorFormatter +from dataall.modules.s3_datasets_shares.services.dataset_sharing_alarm_service import DatasetSharingAlarmService +from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import ( SharePolicyService, IAM_S3_BUCKETS_STATEMENT_SID, EMPTY_STATEMENT_SID, ) -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import PrincipalType +from dataall.modules.shares_base.services.shares_enums import PrincipalType from dataall.modules.s3_datasets.db.dataset_models import S3Dataset, DatasetBucket -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository logger = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/share_managers/share_manager_utils.py b/backend/dataall/modules/s3_datasets_shares/services/share_managers/share_manager_utils.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/share_managers/share_manager_utils.py rename to backend/dataall/modules/s3_datasets_shares/services/share_managers/share_manager_utils.py diff --git a/backend/dataall/modules/dataset_sharing/services/share_notification_service.py b/backend/dataall/modules/s3_datasets_shares/services/share_notification_service.py similarity index 98% rename from backend/dataall/modules/dataset_sharing/services/share_notification_service.py rename to backend/dataall/modules/s3_datasets_shares/services/share_notification_service.py index c0f65be22..d39b6f74d 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_notification_service.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_notification_service.py @@ -5,10 +5,10 @@ from dataall.base.config import config from dataall.core.tasks.db.task_models import Task from dataall.core.tasks.service_handlers import Worker -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject from dataall.modules.s3_datasets.db.dataset_models import S3Dataset from dataall.base.context import get_context -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareObjectStatus +from dataall.modules.shares_base.services.shares_enums import ShareObjectStatus from dataall.modules.notifications.db.notification_repositories import NotificationRepository log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/share_object_service.py b/backend/dataall/modules/s3_datasets_shares/services/share_object_service.py similarity index 97% rename from backend/dataall/modules/dataset_sharing/services/share_object_service.py rename to backend/dataall/modules/s3_datasets_shares/services/share_object_service.py index 6e3230d86..0e36e2af0 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_object_service.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_object_service.py @@ -12,24 +12,24 @@ from dataall.base.db import utils from dataall.base.aws.quicksight import QuicksightClient from dataall.base.db.exceptions import UnauthorizedOperation -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareObjectActions, ShareableType, ShareItemStatus, ShareObjectStatus, PrincipalType, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem, ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ( +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem, ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ( ShareObjectRepository, ShareObjectSM, ShareItemSM, ) -from dataall.modules.dataset_sharing.services.share_exceptions import ShareItemsFound, PrincipalRoleNotFound -from dataall.modules.dataset_sharing.services.share_item_service import ShareItemService -from dataall.modules.dataset_sharing.services.share_notification_service import ShareNotificationService -from dataall.modules.dataset_sharing.services.managed_share_policy_service import SharePolicyService -from dataall.modules.dataset_sharing.services.share_permissions import ( +from dataall.modules.s3_datasets_shares.services.share_exceptions import ShareItemsFound, PrincipalRoleNotFound +from dataall.modules.s3_datasets_shares.services.share_item_service import ShareItemService +from dataall.modules.s3_datasets_shares.services.share_notification_service import ShareNotificationService +from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import SharePolicyService +from dataall.modules.shares_base.services.share_permissions import ( REJECT_SHARE_OBJECT, APPROVE_SHARE_OBJECT, SUBMIT_SHARE_OBJECT, @@ -39,7 +39,7 @@ DELETE_SHARE_OBJECT, GET_SHARE_OBJECT, ) -from dataall.modules.dataset_sharing.aws.glue_client import GlueClient +from dataall.modules.s3_datasets_shares.aws.glue_client import GlueClient from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, S3Dataset, DatasetStorageLocation from dataall.modules.s3_datasets.services.dataset_permissions import DATASET_TABLE_READ, DATASET_FOLDER_READ diff --git a/backend/dataall/modules/dataset_sharing/services/share_processors/__init__.py b/backend/dataall/modules/s3_datasets_shares/services/share_processors/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/share_processors/__init__.py rename to backend/dataall/modules/s3_datasets_shares/services/share_processors/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/services/share_processors/lakeformation_process_share.py b/backend/dataall/modules/s3_datasets_shares/services/share_processors/lakeformation_process_share.py similarity index 96% rename from backend/dataall/modules/dataset_sharing/services/share_processors/lakeformation_process_share.py rename to backend/dataall/modules/s3_datasets_shares/services/share_processors/lakeformation_process_share.py index 26f5c98d9..89aa8bcfd 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_processors/lakeformation_process_share.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_processors/lakeformation_process_share.py @@ -2,21 +2,21 @@ from warnings import warn from datetime import datetime from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareItemHealthStatus, ShareItemStatus, ShareObjectActions, ShareItemActions, ShareableType, ) -from dataall.modules.dataset_sharing.services.share_exceptions import PrincipalRoleNotFound -from dataall.modules.dataset_sharing.services.share_managers import LFShareManager -from dataall.modules.dataset_sharing.aws.ram_client import RamClient -from dataall.modules.dataset_sharing.services.share_object_service import ShareObjectService +from dataall.modules.s3_datasets_shares.services.share_exceptions import PrincipalRoleNotFound +from dataall.modules.s3_datasets_shares.services.share_managers import LFShareManager +from dataall.modules.s3_datasets_shares.aws.ram_client import RamClient +from dataall.modules.s3_datasets_shares.services.share_object_service import ShareObjectService from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, S3Dataset -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository, ShareItemSM -from dataall.modules.dataset_sharing.services.share_managers.share_manager_utils import ShareErrorFormatter +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository, ShareItemSM +from dataall.modules.s3_datasets_shares.services.share_managers.share_manager_utils import ShareErrorFormatter log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/share_processors/s3_access_point_process_share.py b/backend/dataall/modules/s3_datasets_shares/services/share_processors/s3_access_point_process_share.py similarity index 94% rename from backend/dataall/modules/dataset_sharing/services/share_processors/s3_access_point_process_share.py rename to backend/dataall/modules/s3_datasets_shares/services/share_processors/s3_access_point_process_share.py index a78e2c1d3..a6aae4530 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_processors/s3_access_point_process_share.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_processors/s3_access_point_process_share.py @@ -2,18 +2,18 @@ from datetime import datetime from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup -from dataall.modules.dataset_sharing.services.share_exceptions import PrincipalRoleNotFound -from dataall.modules.dataset_sharing.services.share_managers import S3AccessPointShareManager -from dataall.modules.dataset_sharing.services.share_object_service import ShareObjectService +from dataall.modules.s3_datasets_shares.services.share_exceptions import PrincipalRoleNotFound +from dataall.modules.s3_datasets_shares.services.share_managers import S3AccessPointShareManager +from dataall.modules.s3_datasets_shares.services.share_object_service import ShareObjectService from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, S3Dataset -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareItemHealthStatus, ShareItemStatus, ShareObjectActions, ShareItemActions, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository, ShareItemSM +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository, ShareItemSM log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/services/share_processors/s3_bucket_process_share.py b/backend/dataall/modules/s3_datasets_shares/services/share_processors/s3_bucket_process_share.py similarity index 94% rename from backend/dataall/modules/dataset_sharing/services/share_processors/s3_bucket_process_share.py rename to backend/dataall/modules/s3_datasets_shares/services/share_processors/s3_bucket_process_share.py index 5c78ca3a0..420300d33 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_processors/s3_bucket_process_share.py +++ b/backend/dataall/modules/s3_datasets_shares/services/share_processors/s3_bucket_process_share.py @@ -2,18 +2,18 @@ from datetime import datetime from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup -from dataall.modules.dataset_sharing.services.share_exceptions import PrincipalRoleNotFound -from dataall.modules.dataset_sharing.services.share_managers import S3BucketShareManager -from dataall.modules.dataset_sharing.services.share_object_service import ShareObjectService +from dataall.modules.s3_datasets_shares.services.share_exceptions import PrincipalRoleNotFound +from dataall.modules.s3_datasets_shares.services.share_managers import S3BucketShareManager +from dataall.modules.s3_datasets_shares.services.share_object_service import ShareObjectService from dataall.modules.s3_datasets.db.dataset_models import S3Dataset, DatasetBucket -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareItemHealthStatus, ShareItemStatus, ShareObjectActions, ShareItemActions, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository, ShareItemSM +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository, ShareItemSM log = logging.getLogger(__name__) diff --git a/backend/dataall/modules/dataset_sharing/tasks/__init__.py b/backend/dataall/modules/s3_datasets_shares/tasks/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/tasks/__init__.py rename to backend/dataall/modules/s3_datasets_shares/tasks/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/tasks/dataset_subscription_task.py b/backend/dataall/modules/s3_datasets_shares/tasks/dataset_subscription_task.py similarity index 94% rename from backend/dataall/modules/dataset_sharing/tasks/dataset_subscription_task.py rename to backend/dataall/modules/s3_datasets_shares/tasks/dataset_subscription_task.py index 7adc9db6b..0cf60e955 100644 --- a/backend/dataall/modules/dataset_sharing/tasks/dataset_subscription_task.py +++ b/backend/dataall/modules/s3_datasets_shares/tasks/dataset_subscription_task.py @@ -9,13 +9,13 @@ from dataall.core.environment.db.environment_models import Environment from dataall.core.environment.services.environment_service import EnvironmentService from dataall.base.db import get_engine -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository -from dataall.modules.dataset_sharing.services.share_notification_service import ShareNotificationService +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository +from dataall.modules.s3_datasets_shares.services.share_notification_service import ShareNotificationService from dataall.modules.s3_datasets.aws.sns_dataset_client import SnsDatasetClient from dataall.modules.s3_datasets.db.dataset_location_repositories import DatasetLocationRepository from dataall.modules.s3_datasets.db.dataset_table_repositories import DatasetTableRepository -from dataall.modules.dataset_sharing.tasks.subscriptions import poll_queues +from dataall.modules.s3_datasets_shares.tasks.subscriptions import poll_queues from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, DatasetTable, S3Dataset diff --git a/backend/dataall/modules/dataset_sharing/tasks/share_manager_task.py b/backend/dataall/modules/s3_datasets_shares/tasks/share_manager_task.py similarity index 93% rename from backend/dataall/modules/dataset_sharing/tasks/share_manager_task.py rename to backend/dataall/modules/s3_datasets_shares/tasks/share_manager_task.py index c9037f809..50d8fea58 100644 --- a/backend/dataall/modules/dataset_sharing/tasks/share_manager_task.py +++ b/backend/dataall/modules/s3_datasets_shares/tasks/share_manager_task.py @@ -2,7 +2,7 @@ import os import sys -from dataall.modules.dataset_sharing.services.data_sharing_service import DataSharingService +from dataall.modules.s3_datasets_shares.services.data_sharing_service import DataSharingService from dataall.base.db import get_engine root = logging.getLogger() diff --git a/backend/dataall/modules/dataset_sharing/tasks/share_reapplier_task.py b/backend/dataall/modules/s3_datasets_shares/tasks/share_reapplier_task.py similarity index 81% rename from backend/dataall/modules/dataset_sharing/tasks/share_reapplier_task.py rename to backend/dataall/modules/s3_datasets_shares/tasks/share_reapplier_task.py index 388e43ea4..32c0faf65 100644 --- a/backend/dataall/modules/dataset_sharing/tasks/share_reapplier_task.py +++ b/backend/dataall/modules/s3_datasets_shares/tasks/share_reapplier_task.py @@ -1,10 +1,10 @@ import logging import os import sys -from dataall.modules.dataset_sharing.api.types import ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareItemHealthStatus -from dataall.modules.dataset_sharing.services.data_sharing_service import DataSharingService +from dataall.modules.s3_datasets_shares.api.types import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository +from dataall.modules.shares_base.services.shares_enums import ShareItemHealthStatus +from dataall.modules.s3_datasets_shares.services.data_sharing_service import DataSharingService from dataall.base.db import get_engine root = logging.getLogger() diff --git a/backend/dataall/modules/dataset_sharing/tasks/share_verifier_task.py b/backend/dataall/modules/s3_datasets_shares/tasks/share_verifier_task.py similarity index 80% rename from backend/dataall/modules/dataset_sharing/tasks/share_verifier_task.py rename to backend/dataall/modules/s3_datasets_shares/tasks/share_verifier_task.py index f3c1e986c..c66eaad37 100644 --- a/backend/dataall/modules/dataset_sharing/tasks/share_verifier_task.py +++ b/backend/dataall/modules/s3_datasets_shares/tasks/share_verifier_task.py @@ -1,10 +1,10 @@ import logging import os import sys -from dataall.modules.dataset_sharing.api.types import ShareObject -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareItemStatus -from dataall.modules.dataset_sharing.services.data_sharing_service import DataSharingService +from dataall.modules.s3_datasets_shares.api.types import ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository +from dataall.modules.shares_base.services.shares_enums import ShareItemStatus +from dataall.modules.s3_datasets_shares.services.data_sharing_service import DataSharingService from dataall.base.db import get_engine root = logging.getLogger() diff --git a/backend/dataall/modules/dataset_sharing/tasks/subscriptions/__init__.py b/backend/dataall/modules/s3_datasets_shares/tasks/subscriptions/__init__.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/tasks/subscriptions/__init__.py rename to backend/dataall/modules/s3_datasets_shares/tasks/subscriptions/__init__.py diff --git a/backend/dataall/modules/dataset_sharing/tasks/subscriptions/sqs_poller.py b/backend/dataall/modules/s3_datasets_shares/tasks/subscriptions/sqs_poller.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/tasks/subscriptions/sqs_poller.py rename to backend/dataall/modules/s3_datasets_shares/tasks/subscriptions/sqs_poller.py diff --git a/backend/dataall/modules/shares_base/__init__.py b/backend/dataall/modules/shares_base/__init__.py new file mode 100644 index 000000000..0a0d80f4a --- /dev/null +++ b/backend/dataall/modules/shares_base/__init__.py @@ -0,0 +1,19 @@ +from typing import Set +from dataall.base.loader import ModuleInterface, ImportMode + + +class SharesBaseModuleInterface(ModuleInterface): + @staticmethod + def is_supported(modes: Set[ImportMode]) -> bool: + supported_modes = { + ImportMode.API, + ImportMode.CDK, + ImportMode.HANDLERS, + ImportMode.STACK_UPDATER_TASK, + ImportMode.CATALOG_INDEXER_TASK, + } + return modes & supported_modes + + def __init__(self): + import dataall.modules.shares_base.services.shares_enums + import dataall.modules.shares_base.services.share_permissions diff --git a/backend/dataall/modules/shares_base/api/__init__.py b/backend/dataall/modules/shares_base/api/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/dataall/modules/shares_base/db/__init__.py b/backend/dataall/modules/shares_base/db/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/dataall/modules/shares_base/services/__init__.py b/backend/dataall/modules/shares_base/services/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/dataall/modules/dataset_sharing/services/share_permissions.py b/backend/dataall/modules/shares_base/services/share_permissions.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/share_permissions.py rename to backend/dataall/modules/shares_base/services/share_permissions.py diff --git a/backend/dataall/modules/dataset_sharing/services/dataset_sharing_enums.py b/backend/dataall/modules/shares_base/services/shares_enums.py similarity index 100% rename from backend/dataall/modules/dataset_sharing/services/dataset_sharing_enums.py rename to backend/dataall/modules/shares_base/services/shares_enums.py diff --git a/backend/migrations/versions/04d92886fabe_add_consumption_roles.py b/backend/migrations/versions/04d92886fabe_add_consumption_roles.py index 1400a05b7..e15a34972 100644 --- a/backend/migrations/versions/04d92886fabe_add_consumption_roles.py +++ b/backend/migrations/versions/04d92886fabe_add_consumption_roles.py @@ -19,7 +19,7 @@ from dataall.core.permissions.services.permission_service import PermissionService from dataall.core.permissions.services.resource_policy_service import ResourcePolicyService -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareObjectStatus +from dataall.modules.shares_base.services.shares_enums import ShareObjectStatus from dataall.core.permissions.services.environment_permissions import ( CONSUMPTION_ENVIRONMENT_ROLE_ALL, ) diff --git a/backend/migrations/versions/458572580709_remove_dataset_table_read_permissions_from_env_admins.py b/backend/migrations/versions/458572580709_remove_dataset_table_read_permissions_from_env_admins.py index a5f730397..fa74f1f1f 100644 --- a/backend/migrations/versions/458572580709_remove_dataset_table_read_permissions_from_env_admins.py +++ b/backend/migrations/versions/458572580709_remove_dataset_table_read_permissions_from_env_admins.py @@ -18,8 +18,8 @@ from dataall.core.permissions.services.resource_policy_service import ResourcePolicyService from dataall.modules.s3_datasets.db.dataset_models import DatasetTable -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject, ShareObjectItem -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareItemStatus, ShareableType, PrincipalType +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject, ShareObjectItem +from dataall.modules.shares_base.services.shares_enums import ShareItemStatus, ShareableType, PrincipalType from dataall.modules.datasets_base.services.datasets_enums import ConfidentialityClassification, Language # revision identifiers, used by Alembic. diff --git a/backend/migrations/versions/509997f0a51e_sharing_state_machines_v1_4_0.py b/backend/migrations/versions/509997f0a51e_sharing_state_machines_v1_4_0.py index 88327936d..399854e8c 100644 --- a/backend/migrations/versions/509997f0a51e_sharing_state_machines_v1_4_0.py +++ b/backend/migrations/versions/509997f0a51e_sharing_state_machines_v1_4_0.py @@ -13,7 +13,7 @@ from dataall.base.db import utils from datetime import datetime -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareObjectStatus, ShareItemStatus +from dataall.modules.shares_base.services.shares_enums import ShareObjectStatus, ShareItemStatus # revision identifiers, used by Alembic. revision = '509997f0a51e' diff --git a/backend/migrations/versions/72b8a90b6ee8__share_request_purpose.py b/backend/migrations/versions/72b8a90b6ee8__share_request_purpose.py index c5c5d703a..22f109fd5 100644 --- a/backend/migrations/versions/72b8a90b6ee8__share_request_purpose.py +++ b/backend/migrations/versions/72b8a90b6ee8__share_request_purpose.py @@ -12,8 +12,8 @@ from dataall.core.environment.services.environment_service import EnvironmentService from dataall.core.permissions.services.resource_policy_service import ResourcePolicyService -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.services.share_permissions import SHARE_OBJECT_APPROVER, SHARE_OBJECT_REQUESTER +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.shares_base.services.share_permissions import SHARE_OBJECT_APPROVER, SHARE_OBJECT_REQUESTER from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository # revision identifiers, used by Alembic. diff --git a/backend/migrations/versions/8c79fb896983_add_table_for_buckets.py b/backend/migrations/versions/8c79fb896983_add_table_for_buckets.py index dce79af22..2f93cb5ea 100644 --- a/backend/migrations/versions/8c79fb896983_add_table_for_buckets.py +++ b/backend/migrations/versions/8c79fb896983_add_table_for_buckets.py @@ -16,7 +16,7 @@ from dataall.base.db import get_engine, has_table from dataall.base.db import utils, Resource -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareObjectStatus +from dataall.modules.shares_base.services.shares_enums import ShareObjectStatus from datetime import datetime from dataall.modules.datasets_base.services.datasets_enums import ConfidentialityClassification, Language diff --git a/backend/migrations/versions/c6d01930179d_add_backfill_read_folder_permissions.py b/backend/migrations/versions/c6d01930179d_add_backfill_read_folder_permissions.py index 55cf6af14..e443ceed5 100644 --- a/backend/migrations/versions/c6d01930179d_add_backfill_read_folder_permissions.py +++ b/backend/migrations/versions/c6d01930179d_add_backfill_read_folder_permissions.py @@ -18,11 +18,10 @@ from dataall.core.permissions.services.resource_policy_service import ResourcePolicyService from dataall.modules.s3_datasets.services.dataset_permissions import DATASET_FOLDER_READ, GET_DATASET_FOLDER from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject, ShareObjectItem -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareItemStatus, ShareableType +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject, ShareObjectItem +from dataall.modules.shares_base.services.shares_enums import ShareItemStatus, ShareableType from dataall.modules.datasets_base.services.datasets_enums import ConfidentialityClassification, Language - # revision identifiers, used by Alembic. revision = 'c6d01930179d' down_revision = '9dcc2f2b8858' diff --git a/backend/migrations/versions/d05f9a5b215e_backfill_dataset_table_permissions.py b/backend/migrations/versions/d05f9a5b215e_backfill_dataset_table_permissions.py index c80a098da..180483888 100644 --- a/backend/migrations/versions/d05f9a5b215e_backfill_dataset_table_permissions.py +++ b/backend/migrations/versions/d05f9a5b215e_backfill_dataset_table_permissions.py @@ -19,12 +19,12 @@ from dataall.core.permissions.services.permission_service import PermissionService from dataall.core.permissions.services.resource_policy_service import ResourcePolicyService -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareObjectStatus, ShareableType, ShareItemStatus, ) -from dataall.modules.dataset_sharing.db.share_object_repositories import ShareObjectRepository +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ShareObjectRepository from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository from dataall.modules.s3_datasets.services.dataset_permissions import DATASET_TABLE_READ diff --git a/config.json b/config.json index 2e7ca12f8..4c2d2094e 100644 --- a/config.json +++ b/config.json @@ -34,7 +34,7 @@ } } }, - "dataset_sharing": { + "s3_datasets_shares": { "active": true }, "worksheets": { diff --git a/deploy/stacks/container.py b/deploy/stacks/container.py index b4a1a7543..16314f30b 100644 --- a/deploy/stacks/container.py +++ b/deploy/stacks/container.py @@ -216,7 +216,7 @@ def add_share_management_task(self): container_name='container', image=ecs.ContainerImage.from_ecr_repository(repository=self._ecr_repository, tag=self._cdkproxy_image_tag), environment=self._create_env('DEBUG'), - command=['python3.9', '-m', 'dataall.modules.dataset_sharing.tasks.share_manager_task'], + command=['python3.9', '-m', 'dataall.modules.s3_datasets_shares.tasks.share_manager_task'], logging=ecs.LogDriver.aws_logs( stream_prefix='task', log_group=self.create_log_group(self._envname, self._resource_prefix, log_group_name='share-manager'), @@ -243,7 +243,7 @@ def add_share_management_task(self): def add_share_verifier_task(self): verify_shares_task, verify_shares_task_def = self.set_scheduled_task( cluster=self.ecs_cluster, - command=['python3.9', '-m', 'dataall.modules.dataset_sharing.tasks.share_verifier_task'], + command=['python3.9', '-m', 'dataall.modules.s3_datasets_shares.tasks.share_verifier_task'], container_id='container', ecr_repository=self._ecr_repository, environment=self._create_env('INFO'), @@ -276,7 +276,7 @@ def add_share_reapplier_task(self): container_name='container', image=ecs.ContainerImage.from_ecr_repository(repository=self._ecr_repository, tag=self._cdkproxy_image_tag), environment=self._create_env('INFO'), - command=['python3.9', '-m', 'dataall.modules.dataset_sharing.tasks.share_reapplier_task'], + command=['python3.9', '-m', 'dataall.modules.s3_datasets_shares.tasks.share_reapplier_task'], logging=ecs.LogDriver.aws_logs( stream_prefix='task', log_group=self.create_log_group(self._envname, self._resource_prefix, log_group_name='share-reapplier'), @@ -292,7 +292,7 @@ def add_subscription_task(self): command=[ 'python3.9', '-m', - 'dataall.modules.dataset_sharing.tasks.dataset_subscription_task', + 'dataall.modules.s3_datasets_shares.tasks.dataset_subscription_task', ], container_id='container', ecr_repository=self._ecr_repository, diff --git a/tests/conftest.py b/tests/conftest.py index c0c78991d..383bd7e64 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -187,7 +187,7 @@ def mock_aws_client(module_mocker): # there can be other mocker clients module_mocker.patch('dataall.modules.s3_datasets.aws.s3_dataset_client.SessionHelper', session_helper) - module_mocker.patch('dataall.modules.dataset_sharing.aws.kms_client.SessionHelper', session_helper) + module_mocker.patch('dataall.modules.s3_datasets_shares.aws.kms_client.SessionHelper', session_helper) module_mocker.patch('dataall.base.aws.sts.SessionHelper', session_helper) diff --git a/tests/modules/datasets/conftest.py b/tests/modules/datasets/conftest.py index b2e21d9a6..fe564fc17 100644 --- a/tests/modules/datasets/conftest.py +++ b/tests/modules/datasets/conftest.py @@ -6,9 +6,9 @@ from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup from dataall.core.organizations.db.organization_models import Organization from dataall.core.permissions.services.resource_policy_service import ResourcePolicyService -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareableType, PrincipalType -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject, ShareObjectItem -from dataall.modules.dataset_sharing.services.share_permissions import SHARE_OBJECT_REQUESTER, SHARE_OBJECT_APPROVER +from dataall.modules.shares_base.services.shares_enums import ShareableType, PrincipalType +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject, ShareObjectItem +from dataall.modules.shares_base.services.share_permissions import SHARE_OBJECT_REQUESTER, SHARE_OBJECT_APPROVER from dataall.modules.datasets_base.services.datasets_enums import ConfidentialityClassification from dataall.modules.s3_datasets.services.dataset_permissions import DATASET_TABLE_READ from dataall.modules.s3_datasets.db.dataset_models import S3Dataset, DatasetTable, DatasetStorageLocation diff --git a/tests/modules/datasets/tasks/conftest.py b/tests/modules/datasets/tasks/conftest.py index 62df01fe6..b3d3f8cd8 100644 --- a/tests/modules/datasets/tasks/conftest.py +++ b/tests/modules/datasets/tasks/conftest.py @@ -2,13 +2,13 @@ from dataall.core.organizations.db.organization_models import Organization from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareableType, ShareItemStatus, ShareObjectStatus, PrincipalType, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem, ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem, ShareObject from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, DatasetTable, S3Dataset, DatasetBucket diff --git a/tests/modules/datasets/tasks/test_dataset_subscriptions.py b/tests/modules/datasets/tasks/test_dataset_subscriptions.py index b1226437c..4e11071a8 100644 --- a/tests/modules/datasets/tasks/test_dataset_subscriptions.py +++ b/tests/modules/datasets/tasks/test_dataset_subscriptions.py @@ -4,15 +4,15 @@ from dataall.base.db import Engine from dataall.core.environment.db.environment_models import Environment -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ( ShareObjectStatus, ShareItemStatus, ShareableType, PrincipalType, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObjectItem, ShareObject +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObjectItem, ShareObject from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, S3Dataset -from dataall.modules.dataset_sharing.tasks.dataset_subscription_task import DatasetSubscriptionService +from dataall.modules.s3_datasets_shares.tasks.dataset_subscription_task import DatasetSubscriptionService from dataall.core.environment.api.enums import EnvironmentPermission @@ -90,7 +90,7 @@ def share( def test_subscriptions(org, env, otherenv, db, dataset, share, mocker): sns_client = MagicMock() - mocker.patch('dataall.modules.dataset_sharing.tasks.dataset_subscription_task.SnsDatasetClient', sns_client) + mocker.patch('dataall.modules.s3_datasets_shares.tasks.dataset_subscription_task.SnsDatasetClient', sns_client) sns_client.publish_dataset_message.return_value = True subscriber = DatasetSubscriptionService(db) messages = [ diff --git a/tests/modules/datasets/tasks/test_lf_share_manager.py b/tests/modules/datasets/tasks/test_lf_share_manager.py index 93db13420..171ba3426 100644 --- a/tests/modules/datasets/tasks/test_lf_share_manager.py +++ b/tests/modules/datasets/tasks/test_lf_share_manager.py @@ -14,11 +14,11 @@ from dataall.core.groups.db.group_models import Group from dataall.core.organizations.db.organization_models import Organization from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareItemStatus -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject, ShareObjectItem +from dataall.modules.shares_base.services.shares_enums import ShareItemStatus +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject, ShareObjectItem from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, S3Dataset -from dataall.modules.dataset_sharing.services.dataset_sharing_alarm_service import DatasetSharingAlarmService -from dataall.modules.dataset_sharing.services.share_processors.lakeformation_process_share import ( +from dataall.modules.s3_datasets_shares.services.dataset_sharing_alarm_service import DatasetSharingAlarmService +from dataall.modules.s3_datasets_shares.services.share_processors.lakeformation_process_share import ( ProcessLakeFormationShare, ) from dataall.base.db import exceptions @@ -144,7 +144,7 @@ def processor_with_mocks( @pytest.fixture(scope='function') def mock_glue_client(mocker): mock_client = MagicMock() - mocker.patch('dataall.modules.dataset_sharing.services.share_managers.lf_share_manager.GlueClient', mock_client) + mocker.patch('dataall.modules.s3_datasets_shares.services.share_managers.lf_share_manager.GlueClient', mock_client) yield mock_client diff --git a/tests/modules/datasets/tasks/test_s3_access_point_share_manager.py b/tests/modules/datasets/tasks/test_s3_access_point_share_manager.py index d4bd6b533..76fcf6c67 100644 --- a/tests/modules/datasets/tasks/test_s3_access_point_share_manager.py +++ b/tests/modules/datasets/tasks/test_s3_access_point_share_manager.py @@ -8,10 +8,10 @@ from dataall.core.groups.db.group_models import Group from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup, ConsumptionRole from dataall.core.organizations.db.organization_models import Organization -from dataall.modules.dataset_sharing.aws.s3_client import S3ControlClient -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject, ShareObjectItem -from dataall.modules.dataset_sharing.services.managed_share_policy_service import SharePolicyService -from dataall.modules.dataset_sharing.services.share_managers import S3AccessPointShareManager +from dataall.modules.s3_datasets_shares.aws.s3_client import S3ControlClient +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject, ShareObjectItem +from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import SharePolicyService +from dataall.modules.s3_datasets_shares.services.share_managers import S3AccessPointShareManager from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, S3Dataset SOURCE_ENV_ACCOUNT = '111111111111' @@ -182,7 +182,7 @@ def share_manager( def mock_s3_client(mocker): mock_client = MagicMock() mocker.patch( - 'dataall.modules.dataset_sharing.services.share_managers.s3_access_point_share_manager.S3Client', mock_client + 'dataall.modules.s3_datasets_shares.services.share_managers.s3_access_point_share_manager.S3Client', mock_client ) mock_client.create_bucket_policy.return_value = None return mock_client @@ -191,7 +191,7 @@ def mock_s3_client(mocker): def mock_s3_control_client(mocker): mock_client = MagicMock() mocker.patch( - 'dataall.modules.dataset_sharing.services.share_managers.s3_access_point_share_manager.S3ControlClient', + 'dataall.modules.s3_datasets_shares.services.share_managers.s3_access_point_share_manager.S3ControlClient', mock_client, ) @@ -209,7 +209,8 @@ def mock_s3_control_client(mocker): def mock_kms_client(mocker): mock_client = MagicMock() mocker.patch( - 'dataall.modules.dataset_sharing.services.share_managers.s3_access_point_share_manager.KmsClient', mock_client + 'dataall.modules.s3_datasets_shares.services.share_managers.s3_access_point_share_manager.KmsClient', + mock_client, ) mock_client.put_key_policy.return_value = None return mock_client @@ -218,7 +219,7 @@ def mock_kms_client(mocker): def mock_iam_client(mocker, account_id, role_name): mock_client = MagicMock() mocker.patch( - 'dataall.modules.dataset_sharing.services.share_managers.s3_access_point_share_manager.IAM', mock_client + 'dataall.modules.s3_datasets_shares.services.share_managers.s3_access_point_share_manager.IAM', mock_client ) mock_client.get_role_arn_by_name.return_value = f'arn:aws:iam::{account_id}:role/{role_name}' return mock_client @@ -329,11 +330,11 @@ def test_grant_target_role_access_policy_test_empty_policy( return_value=None, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -394,11 +395,11 @@ def test_grant_target_role_access_policy_existing_policy_bucket_not_included( mocker.patch('dataall.base.aws.iam.IAM.get_managed_policy_default_version', return_value=('v1', iam_policy)) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -449,12 +450,12 @@ def test_grant_target_role_access_policy_existing_policy_bucket_included( mocker.patch('dataall.base.aws.iam.IAM.get_managed_policy_default_version', return_value=('v1', iam_policy)) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -900,12 +901,12 @@ def test_delete_target_role_access_policy_no_remaining_statement( 'dataall.base.aws.iam.IAM.get_managed_policy_default_version', return_value=('v1', existing_target_role_policy) ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1003,12 +1004,12 @@ def test_delete_target_role_access_policy_with_remaining_statement( ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1199,12 +1200,12 @@ def test_check_bucket_policy_missing_sid(mocker, base_bucket_policy, share_manag def test_check_target_role_access_policy(mocker, target_dataset_access_control_policy, share_manager): # Given mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1237,12 +1238,12 @@ def test_check_target_role_access_policy_existing_policy_bucket_and_key_not_incl ): # Given mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1271,12 +1272,12 @@ def test_check_target_role_access_policy_existing_policy_bucket_and_key_not_incl def test_check_target_role_access_policy_test_no_policy(mocker, share_manager): # Given mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=False, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1292,12 +1293,12 @@ def test_check_target_role_access_policy_test_no_policy(mocker, share_manager): def test_check_target_role_access_policy_test_policy_not_attached(mocker, share_manager): # Given mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) # Policy is not attached mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=False, ) diff --git a/tests/modules/datasets/tasks/test_s3_bucket_share_manager.py b/tests/modules/datasets/tasks/test_s3_bucket_share_manager.py index ad4ec93bb..eb34b93e0 100644 --- a/tests/modules/datasets/tasks/test_s3_bucket_share_manager.py +++ b/tests/modules/datasets/tasks/test_s3_bucket_share_manager.py @@ -7,9 +7,9 @@ from dataall.core.groups.db.group_models import Group from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup from dataall.core.organizations.db.organization_models import Organization -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject -from dataall.modules.dataset_sharing.services.share_managers import S3BucketShareManager -from dataall.modules.dataset_sharing.services.managed_share_policy_service import SharePolicyService +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject +from dataall.modules.s3_datasets_shares.services.share_managers import S3BucketShareManager +from dataall.modules.s3_datasets_shares.services.managed_share_policy_service import SharePolicyService from dataall.modules.s3_datasets.db.dataset_models import S3Dataset, DatasetBucket SOURCE_ENV_ACCOUNT = '111111111111' @@ -237,7 +237,7 @@ def complete_access_bucket_policy(target_requester_arn, s3_bucket_name, owner_ro def mock_s3_client(mocker): mock_client = MagicMock() mocker.patch( - 'dataall.modules.dataset_sharing.services.share_managers.s3_bucket_share_manager.S3Client', mock_client + 'dataall.modules.s3_datasets_shares.services.share_managers.s3_bucket_share_manager.S3Client', mock_client ) mock_client.create_bucket_policy.return_value = None return mock_client @@ -246,7 +246,7 @@ def mock_s3_client(mocker): def mock_kms_client(mocker): mock_client = MagicMock() mocker.patch( - 'dataall.modules.dataset_sharing.services.share_managers.s3_bucket_share_manager.KmsClient', mock_client + 'dataall.modules.s3_datasets_shares.services.share_managers.s3_bucket_share_manager.KmsClient', mock_client ) mock_client.put_key_policy.return_value = None return mock_client @@ -254,7 +254,7 @@ def mock_kms_client(mocker): def mock_iam_client(mocker, account_id, role_name): mock_client = MagicMock() - mocker.patch('dataall.modules.dataset_sharing.services.share_managers.s3_bucket_share_manager.IAM', mock_client) + mocker.patch('dataall.modules.s3_datasets_shares.services.share_managers.s3_bucket_share_manager.IAM', mock_client) mock_client.get_role_arn_by_name.return_value = f'arn:aws:iam::{account_id}:role/{role_name}' return mock_client @@ -417,7 +417,7 @@ def test_grant_s3_iam_access_with_no_policy(mocker, dataset2, share2_manager): # Check if the get and update_role_policy func are called and policy statements are added mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=False, ) kms_client = mock_kms_client(mocker) @@ -428,15 +428,15 @@ def test_grant_s3_iam_access_with_no_policy(mocker, dataset2, share2_manager): 'Statement': [{'Sid': EMPTY_STATEMENT_SID, 'Effect': 'Allow', 'Action': 'none:null', 'Resource': '*'}], } share_policy_service_mock_1 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.create_managed_policy_from_inline_and_delete_inline', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.create_managed_policy_from_inline_and_delete_inline', return_value='arn:iam::someArn', ) share_policy_service_mock_2 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.attach_policy', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.attach_policy', return_value=True, ) share_policy_service_mock_3 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=False, ) iam_update_role_policy_mock_1 = mocker.patch( @@ -481,11 +481,11 @@ def test_grant_s3_iam_access_with_empty_policy(mocker, dataset2, share2_manager) # Check if the get and update_role_policy func are called and policy statements are added mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) kms_client = mock_kms_client(mocker) @@ -553,11 +553,11 @@ def test_grant_s3_iam_access_with_policy_and_target_resources_not_present(mocker } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) s3_index = SharePolicyService._get_statement_by_sid(policy=policy, sid=f'{IAM_S3_BUCKETS_STATEMENT_SID}S3') @@ -625,11 +625,11 @@ def test_grant_s3_iam_access_with_complete_policy_present(mocker, dataset2, shar } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) kms_client = mock_kms_client(mocker) @@ -915,7 +915,7 @@ def test_delete_target_role_access_no_policy_no_other_resources_shared( } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=False, ) @@ -923,11 +923,11 @@ def test_delete_target_role_access_no_policy_no_other_resources_shared( kms_client().get_key_id.return_value = 'kms-key' share_policy_service_mock_1 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.create_managed_policy_from_inline_and_delete_inline', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.create_managed_policy_from_inline_and_delete_inline', return_value='arn:iam::someArn', ) share_policy_service_mock_2 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.attach_policy', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.attach_policy', return_value=True, ) @@ -987,11 +987,11 @@ def test_delete_target_role_access_policy_no_resource_of_datasets_s3_bucket( } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1060,11 +1060,11 @@ def test_delete_target_role_access_policy_with_multiple_s3_buckets_in_policy( } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1134,11 +1134,11 @@ def test_delete_target_role_access_policy_with_one_s3_bucket_and_one_kms_resourc } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) @@ -1392,11 +1392,11 @@ def test_check_s3_iam_access(mocker, dataset2, share2_manager): ], } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) # Gets policy with S3 and KMS @@ -1420,7 +1420,7 @@ def test_check_s3_iam_access_no_policy(mocker, dataset2, share2_manager): # When policy does not exist iam_update_role_policy_mock_1 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=False, ) @@ -1441,11 +1441,11 @@ def test_check_s3_iam_access_policy_not_attached(mocker, dataset2, share2_manage # When policy does not exist iam_update_role_policy_mock_1 = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=False, ) @@ -1476,11 +1476,11 @@ def test_check_s3_iam_access_missing_policy_statement(mocker, dataset2, share2_m ], } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) # Gets policy with other S3 and KMS @@ -1524,11 +1524,11 @@ def test_check_s3_iam_access_missing_target_resource(mocker, dataset2, share2_ma ], } mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) # Gets policy with other S3 and KMS diff --git a/tests/modules/datasets/test_share.py b/tests/modules/datasets/test_share.py index ff1642fa3..5f0c9f0e1 100644 --- a/tests/modules/datasets/test_share.py +++ b/tests/modules/datasets/test_share.py @@ -7,28 +7,28 @@ from dataall.core.environment.db.environment_models import Environment, EnvironmentGroup from dataall.core.organizations.db.organization_models import Organization -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ShareableType, PrincipalType -from dataall.modules.dataset_sharing.services.dataset_sharing_enums import ( +from dataall.modules.shares_base.services.shares_enums import ShareableType, PrincipalType +from dataall.modules.shares_base.services.shares_enums import ( ShareObjectActions, ShareItemActions, ShareObjectStatus, ShareItemStatus, ShareItemHealthStatus, ) -from dataall.modules.dataset_sharing.db.share_object_models import ShareObject, ShareObjectItem -from dataall.modules.dataset_sharing.db.share_object_repositories import ( +from dataall.modules.s3_datasets_shares.db.share_object_models import ShareObject, ShareObjectItem +from dataall.modules.s3_datasets_shares.db.share_object_repositories import ( ShareObjectRepository, ShareItemSM, ShareObjectSM, ) -from dataall.modules.dataset_sharing.services.share_object_service import ShareObjectService +from dataall.modules.s3_datasets_shares.services.share_object_service import ShareObjectService from dataall.modules.s3_datasets.db.dataset_models import DatasetTable, S3Dataset @pytest.fixture(scope='function') def mock_glue_client(mocker): glue_client = MagicMock() - mocker.patch('dataall.modules.dataset_sharing.services.share_item_service.GlueClient', return_value=glue_client) + mocker.patch('dataall.modules.s3_datasets_shares.services.share_item_service.GlueClient', return_value=glue_client) glue_client.get_source_catalog.return_value = None @@ -425,7 +425,7 @@ def create_share_object( } """ mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.create_managed_policy_from_inline_and_delete_inline', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.create_managed_policy_from_inline_and_delete_inline', return_value=True, ) @@ -861,11 +861,11 @@ def test_create_share_object_as_requester(mocker, client, user2, group2, env2gro # SharePolicy exists and is attached # When a user that belongs to environment and group creates request mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) create_share_object_response = create_share_object( @@ -890,11 +890,11 @@ def test_create_share_object_as_approver_and_requester(mocker, client, user, gro # SharePolicy exists and is attached # When a user that belongs to environment and group creates request mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) create_share_object_response = create_share_object( @@ -921,11 +921,11 @@ def test_create_share_object_with_item_authorized( # SharePolicy exists and is attached # When a user that belongs to environment and group creates request with table in the request mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=True, ) create_share_object_response = create_share_object( @@ -966,15 +966,15 @@ def test_create_share_object_share_policy_not_attached_attachMissingPolicies_ena # SharePolicy exists and is NOT attached, attachMissingPolicies=True # When a correct user creates request, data.all attaches the policy and the share creates successfully mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=False, ) attach_mocker = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.attach_policy', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.attach_policy', return_value=True, ) create_share_object_response = create_share_object( @@ -1003,15 +1003,15 @@ def test_create_share_object_share_policy_not_attached_attachMissingPolicies_dis # SharePolicy exists and is NOT attached, attachMissingPolicies=True but principal=Group so managed=Trye # When a correct user creates request, data.all attaches the policy and the share creates successfully mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=False, ) attach_mocker = mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.attach_policy', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.attach_policy', return_value=True, ) create_share_object_response = create_share_object( @@ -1040,11 +1040,11 @@ def test_create_share_object_share_policy_not_attached_attachMissingPolicies_dis # SharePolicy exists and is NOT attached, attachMissingPolicies=True # When a correct user creates request, data.all attaches the policy and the share creates successfully mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_exists', return_value=True, ) mocker.patch( - 'dataall.modules.dataset_sharing.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', + 'dataall.modules.s3_datasets_shares.services.managed_share_policy_service.SharePolicyService.check_if_policy_attached', return_value=False, ) consumption_role = type('consumption_role', (object,), {})()