-
Notifications
You must be signed in to change notification settings - Fork 82
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
nikpodsh
merged 397 commits into
data-dot-all:modularization-main
from
nikpodsh:new_permission_checker
Jul 20, 2023
Merged
Migrate to a new permission checker #569
nikpodsh
merged 397 commits into
data-dot-all:modularization-main
from
nikpodsh:new_permission_checker
Jul 20, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
…siness logic from it
# 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
…ctoring_of_aws_calls # Conflicts: # backend/dataall/modules/datasets/tasks/dataset_subscription_task.py
…ew_permission_checker # Conflicts: # backend/dataall/api/Objects/Environment/resolvers.py # backend/dataall/db/api/environment.py # backend/dataall/db/api/redshift_cluster.py
…permission_checker
nikpodsh
changed the base branch from
core-modularization
to
modularization-main
July 19, 2023 08:54
dbalintx
reviewed
Jul 19, 2023
dbalintx
reviewed
Jul 19, 2023
dbalintx
reviewed
Jul 19, 2023
return Environment.query_environment_invited_groups( | ||
session, username, groups, uri, data | ||
).all() | ||
def list_environment_invited_groups(session, uri): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
dbalintx
approved these changes
Jul 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.