-
Notifications
You must be signed in to change notification settings - Fork 82
feature(GH-1613)- New policy management types #1762
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
base: main
Are you sure you want to change the base?
feature(GH-1613)- New policy management types #1762
Conversation
# Conflicts: # backend/dataall/core/environment/db/environment_models.py
@@ -160,7 +160,6 @@ def query_user_environment_consumption_roles(session, groups, uri, filter) -> Qu | |||
) | |||
) | |||
if filter and filter.get('groupUri'): | |||
print('filter group') |
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.
removing print statement
# If environment role is created in environment stack, then data.all should attach the policies in the env stack | ||
# If environment role is imported, then data.all should attach the policies at import time ( Fully Managed ) | ||
# If environment role is created in environment stack, then data.all should attach the policies in the env stack ( Partially Managed - Here policy will be created but won't be attached ) | ||
policy_management: str = ( |
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.
Earlier, when the dataallManaged = True, then share policies were getting attached via the API calls. But when dataallManaged = False, then the share policies were not attached via API calls instead are attached via CF templates.
Mapping this logic to the new policy management types and keeping the functionality same
consumption_role: ConsumptionRole = EnvironmentService.get_consumption_role(session, uri=principal_id) | ||
return consumption_role.dataallManaged | ||
|
||
return PolicyManagementOptions.FULLY_MANAGED.value |
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.
If the role is not a consumption role, then all other roles( i.e. env groups ,etc ) are treated as Fully Managed
|
||
@staticmethod | ||
@ResourcePolicyService.has_resource_permission(environment_permissions.GET_ENVIRONMENT) | ||
def get_consumption_role_by_name(uri, IAMRoleName): |
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.
get_consumption_role_by_name , remving this static method as it was not used any where
Feature or Bugfix
Detail
Relates
Testing
Security
Please answer the questions below briefly where applicable, or write
N/A
. Based onOWASP 10.
fetching data from storage outside the application (e.g. a database, an S3 bucket)? Yes
eval
or similar functions are used? YesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.