-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail Ruff tool configured for the project. All files are formatted In pipelines instead of "make lint" now "make ruff" is used ### Relates #1076 ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Sofia Sazonova <[email protected]>
- Loading branch information
1 parent
e10a043
commit a35a4c7
Showing
494 changed files
with
7,804 additions
and
10,842 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,3 +70,4 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
.idea | ||
/.ruff_cache/ |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
|
||
class Cognito(ServiceProvider): | ||
|
||
def __init__(self): | ||
self.client = boto3.client('cognito-idp', region_name=os.getenv('AWS_REGION', 'eu-west-1')) | ||
|
||
|
@@ -19,10 +18,7 @@ def get_user_emailids_from_group(self, groupName): | |
ssm = boto3.client('ssm', region_name=os.getenv('AWS_REGION', 'eu-west-1')) | ||
user_pool_id = ssm.get_parameter(Name=parameter_path)['Parameter']['Value'] | ||
paginator = self.client.get_paginator('list_users_in_group') | ||
pages = paginator.paginate( | ||
UserPoolId=user_pool_id, | ||
GroupName=groupName | ||
) | ||
pages = paginator.paginate(UserPoolId=user_pool_id, GroupName=groupName) | ||
cognito_user_list = [] | ||
for page in pages: | ||
cognito_user_list += page['Users'] | ||
|
@@ -38,9 +34,7 @@ def get_user_emailids_from_group(self, groupName): | |
if envname in ['local', 'dkrcompose']: | ||
log.error('Local development environment does not support Cognito') | ||
return ['[email protected]'] | ||
log.error( | ||
f'Failed to get email ids for Cognito group {groupName} due to {e}' | ||
) | ||
log.error(f'Failed to get email ids for Cognito group {groupName} due to {e}') | ||
raise e | ||
else: | ||
return group_email_ids | ||
|
@@ -58,9 +52,7 @@ def list_groups(self, envname: str, region: str): | |
for page in pages: | ||
groups += [gr['GroupName'] for gr in page['Groups']] | ||
except Exception as e: | ||
log.error( | ||
f'Failed to list groups of user pool {user_pool_id} due to {e}' | ||
) | ||
log.error(f'Failed to list groups of user pool {user_pool_id} due to {e}') | ||
raise e | ||
return groups | ||
|
||
|
Oops, something went wrong.