Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic shares_base module and specific s3_datasets_shares module - part 11 (renaming and cleaning up s3_shares) #1359

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

dlpzx
Copy link
Contributor

@dlpzx dlpzx commented Jun 25, 2024

Feature or Bugfix

  • Refactoring

Detail

As explained in the design for #1123 and #1283 we are trying to implement generic datasets_base and shares_base modules that can be used by any type of datasets and by any type of shareable object in a generic way.

This is one of the last PRs focused on renaming files and cleaning-up the s3_datasets_shares module. The first step is a consolidation of the file and classes names in the services to clearly refer to s3_shares:

  • services.managed_share_policy_service.SharePolicyService ---> services.s3_share_managed_policy_service.S3SharePolicyService
  • services.dataset_sharing_alarm_service.DatasetSharingAlarmService --> services.s3_share_alarm_service.S3ShareAlarmService
  • services.managed_share_policy_service.SharePolicyService --> services.s3_share_managed_policy_service.S3SharePolicyService

👀 The main refactoring happens in what is used to be services.dataset_sharing_service.

  • The part that implements the DatasetServiceInterface has been moved to services/s3_share_dataset_service.py as the S3ShareDatasetService
  • The part used in the resolvers and by other methods has been renamed as services.s3_share_service.py and the methods for the folder/table permissions are also added to the S3ShareService (from share_item_service)

Lastly, there is one method previously in share_item_service that has been moved to the GlueClient directly as get_glue_database_from_catalog.

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)?
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization?
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features?
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users?
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…eric-dataset-sharing-11

# Conflicts:
#	backend/dataall/modules/s3_datasets_shares/__init__.py
@dlpzx dlpzx marked this pull request as ready for review June 26, 2024 15:48
@dlpzx dlpzx requested a review from petrkalos June 27, 2024 07:36
Comment on lines +187 to +188
except Exception as e:
raise e
Copy link
Contributor

@petrkalos petrkalos Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: all it does here is catch and rethrow so the block isn't required

@dlpzx dlpzx merged commit 2e80de4 into main Jun 27, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants