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

Migrate to a new permission checker #569

Merged

Conversation

nikpodsh
Copy link
Contributor

@nikpodsh nikpodsh commented Jul 12, 2023

There is a new permission checker API in the modularization branch. It allows us get away from passing unused variables into the methods.
The previous permission checker used a certain signature that expected special parameters passed in a certain order. Though, most of the time those passed parameters were not used in the method, but only were needed for the permission checker decorator.
The other issue with the previous permission checker, that it had forced us to pass a request data as a dictionary e.g. in the resolver we had had some parameters and had to put them into dictionary and unpack them back in the method. It was not memory inefficient
All in all, a new permission checker doesn't require to follow previous agreements which will us to write shorter and more concise API, we can utilize type checking and avoid unnecessary memory allocation during the object creation.

The PR is waiting other PR to merged.

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

nikpodsh added 30 commits May 5, 2023 13:04
# Conflicts:
#	backend/dataall/modules/datasets/api/storage_location/resolvers.py
#	tests/api/test_dataset.py
#	tests/api/test_dataset_location.py
#	tests/tasks/test_tables_sync.py
# Conflicts:
#	backend/dataall/modules/dataset_sharing/services/share_object.py
#	backend/dataall/modules/datasets/__init__.py
#	backend/dataall/modules/datasets/api/profiling/resolvers.py
#	backend/dataall/modules/datasets/api/table/resolvers.py
#	backend/dataall/modules/datasets/api/table_column/resolvers.py
#	backend/dataall/modules/datasets/db/dataset_location_repository.py
#	backend/dataall/modules/datasets/db/dataset_table_repository.py
#	backend/dataall/modules/datasets/services/dataset_group_resource.py
#	backend/dataall/modules/datasets/services/dataset_service.py
#	backend/migrations/versions/d05f9a5b215e_backfill_dataset_table_permissions.py
#	tests/api/test_environment.py
#	tests/db/test_permission.py
#	tests/tasks/test_subscriptions.py
# Conflicts:
#	backend/dataall/cdkproxy/stacks/environment.py
# Conflicts:
#	backend/dataall/modules/dataset_sharing/services/dataset_alarm_service.py
#	backend/dataall/modules/dataset_sharing/services/share_managers/s3_share_manager.py
#	backend/dataall/modules/dataset_sharing/services/share_processors/s3_process_share.py
#	backend/dataall/modules/datasets/cdk/dataset_s3_policy.py
#	backend/dataall/modules/datasets/handlers/glue_profiling_handler.py
#	backend/dataall/modules/datasets/handlers/sns_dataset_handler.py
@nikpodsh nikpodsh added the type: modularization Code refactoring project label Jul 12, 2023
@nikpodsh nikpodsh added this to the v2.0.0 milestone Jul 12, 2023
…ew_permission_checker

# Conflicts:
#	backend/dataall/api/Objects/Environment/resolvers.py
#	backend/dataall/db/api/environment.py
#	backend/dataall/db/api/redshift_cluster.py
@nikpodsh nikpodsh changed the base branch from core-modularization to modularization-main July 19, 2023 08:54
@nikpodsh nikpodsh marked this pull request as ready for review July 19, 2023 08:55
@nikpodsh nikpodsh requested a review from dbalintx July 19, 2023 08:55
return Environment.query_environment_invited_groups(
session, username, groups, uri, data
).all()
def list_environment_invited_groups(session, uri):
Copy link
Contributor

Choose a reason for hiding this comment

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

permission decorator is missing from here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method is used while deploying env stack. We can't put a decorator, because we are out of user context

@nikpodsh nikpodsh merged commit e859965 into data-dot-all:modularization-main Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: modularization Code refactoring project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants