Skip to content

Commit 269e26d

Browse files
TejasRGitHubtrajopadhye
andauthored
Bug fixes after 2-7-0-rc (#1785)
### Feature or Bugfix - Bugfix ### Detail - Fixes for maintenance window - #1778 - Importing a glue db with "-" in it - #1776 ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). - 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)? N/A - 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? N/A - 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? N/A - 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? N/A - 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. --------- Co-authored-by: trajopadhye <[email protected]>
1 parent 7a03dd3 commit 269e26d

File tree

8 files changed

+26
-19
lines changed

8 files changed

+26
-19
lines changed

backend/dataall/base/aws/parameter_store.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from typing import List
23

34
from botocore.exceptions import ClientError
45

@@ -39,15 +40,16 @@ def get_parameter_value(AwsAccountId=None, region=None, parameter_path=None):
3940

4041
@staticmethod
4142
def get_parameters_by_path(AwsAccountId=None, region=None, parameter_path=None):
43+
parameter_value_list: List[str] = []
4244
if not parameter_path:
4345
raise Exception('Parameter name is None')
4446
try:
45-
parameter_values = ParameterStoreManager.client(AwsAccountId, region).get_parameters_by_path(
46-
Path=parameter_path
47-
)['Parameters']
47+
paginator = ParameterStoreManager.client(AwsAccountId, region).get_paginator('get_parameters_by_path')
48+
for page in paginator.paginate(Path=parameter_path):
49+
parameter_value_list.extend(page['Parameters'])
4850
except ClientError as e:
4951
raise Exception(e)
50-
return parameter_values
52+
return parameter_value_list
5153

5254
@staticmethod
5355
def update_parameter(AwsAccountId, region, parameter_name, parameter_value):

backend/dataall/base/utils/naming_convention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class NamingConventionPattern(Enum):
1414
IAM = {'regex': '[^a-zA-Z0-9-_]', 'separator': '-', 'max_length': 63} # Role names up to 64 chars
1515
IAM_POLICY = {'regex': '[^a-zA-Z0-9-_]', 'separator': '-', 'max_length': 128} # Policy names up to 128 chars
1616
GLUE = {
17-
'regex': '[^a-zA-Z0-9_]',
17+
'regex': '[^a-zA-Z0-9_-]',
1818
'separator': '_',
1919
'max_length': 240,
20-
'valid_external_regex': '^[a-zA-Z0-9_]+$',
20+
'valid_external_regex': '^[a-zA-Z0-9_-]+$',
2121
} # Limit 255 - 15 extra chars buffer
2222
GLUE_ETL = {'regex': '[^a-zA-Z0-9-]', 'separator': '-', 'max_length': 52}
2323
NOTEBOOK = {'regex': '[^a-zA-Z0-9-]', 'separator': '-', 'max_length': 63}

backend/dataall/modules/s3_datasets/cdk/assets/glueprofilingjob/glue_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def run_table_profiling(
100100
logger.debug('Profiling table for %s %s ', database, table)
101101
logger.debug('using %s', database)
102102
spark.sql('use `{}`'.format(database))
103-
df = spark.sql('select * from {}'.format(table))
103+
df = spark.sql('select * from `{}`'.format(table))
104104
total = df.count()
105105
logger.debug('Retrieved count for %s %s', table, total)
106106

deploy/stacks/pipeline.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ def validate_deployment_params(self, source, repo_connection_arn, git_branch, re
475475
or 'client_id' not in custom_auth_configs
476476
or 'response_types' not in custom_auth_configs
477477
or 'scopes' not in custom_auth_configs
478-
or 'jwks_url' not in custom_auth_configs
479478
or 'claims_mapping' not in custom_auth_configs
480479
or 'user_id' not in custom_auth_configs['claims_mapping']
481480
or 'email' not in custom_auth_configs['claims_mapping']
@@ -491,7 +490,6 @@ def validate_deployment_params(self, source, repo_connection_arn, git_branch, re
491490
or not isinstance(custom_auth_configs['client_id'], str)
492491
or not isinstance(custom_auth_configs['response_types'], str)
493492
or not isinstance(custom_auth_configs['scopes'], str)
494-
or not isinstance(custom_auth_configs['jwks_url'], str)
495493
or not isinstance(custom_auth_configs['claims_mapping']['user_id'], str)
496494
or not isinstance(custom_auth_configs['claims_mapping']['email'], str)
497495
):

frontend/src/authentication/components/MaintenanceGuard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export const MaintenanceGuard = (props) => {
3434
}
3535
};
3636

37-
useEffect(async () => {
37+
useEffect(() => {
3838
// Check if the maintenance window is enabled and has NO-ACCESS Status
3939
// If yes then display a blank screen with a message that data.all is in maintenance mode ( Check use of isNoAccessMaintenance state )
4040
if (isModuleEnabled(ModuleNames.MAINTENANCE) === true) {
41-
if (client) {
41+
if (client && groups) {
4242
checkMaintenanceMode().catch((e) => dispatch({ type: SET_ERROR, e }));
4343
}
4444
}

frontend/src/modules/Administration/views/AdministrationView.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
import { useState } from 'react';
1717
import { Helmet } from 'react-helmet-async';
1818
import { Link as RouterLink } from 'react-router-dom';
19-
import { ChevronRightIcon, useSettings } from 'design';
19+
import { ChevronRightIcon, LoadingScreen, useSettings } from 'design';
2020
import { AdministrationTeams, DashboardViewer } from '../components';
2121
import { MaintenanceViewer } from '../../Maintenance/components/MaintenanceViewer';
2222
import { isModuleEnabled, ModuleNames, isTenantUser } from 'utils';
@@ -42,6 +42,10 @@ const AdministrationView = () => {
4242
setCurrentTab(value);
4343
};
4444

45+
if (!groups) {
46+
return <LoadingScreen />;
47+
}
48+
4549
return !isTenantUser(groups) ? (
4650
<Box
4751
sx={{

frontend/src/modules/Maintenance/components/MaintenanceViewer.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export const ReIndexConfirmationPopUp = (props) => {
298298

299299
export const MaintenanceViewer = () => {
300300
const client = useClient();
301-
const [refreshing, setRefreshing] = useState(false);
301+
const [refreshing, setRefreshing] = useState(true);
302302
const refreshingReIndex = false;
303303
const [updatingReIndex, setUpdatingReIndex] = useState(false);
304304
const [updating, setUpdating] = useState(false);
@@ -443,7 +443,6 @@ export const MaintenanceViewer = () => {
443443
};
444444

445445
const initializeMaintenanceView = useCallback(async () => {
446-
setRefreshing(true);
447446
const response = await client.query(getMaintenanceStatus());
448447
if (!response.errors && response.data.getMaintenanceWindowStatus !== null) {
449448
const maintenanceStatusData = response.data.getMaintenanceWindowStatus;
@@ -471,13 +470,10 @@ export const MaintenanceViewer = () => {
471470
dispatch({ type: SET_ERROR, error });
472471
}
473472
setRefreshing(false);
474-
}, [client]);
473+
}, [client, maintenanceModes]);
475474

476475
useEffect(() => {
477476
if (client) {
478-
initializeMaintenanceView().catch((e) =>
479-
dispatch({ type: SET_ERROR, e })
480-
);
481477
fetchMaintenanceModes().catch((e) =>
482478
dispatch({ type: SET_ERROR, error: e.message })
483479
);
@@ -491,6 +487,14 @@ export const MaintenanceViewer = () => {
491487
}
492488
}, [client]);
493489

490+
useEffect(() => {
491+
if (maintenanceModes.length > 0) {
492+
initializeMaintenanceView().catch((e) =>
493+
dispatch({ type: SET_ERROR, e })
494+
);
495+
}
496+
}, [maintenanceModes]);
497+
494498
return (
495499
<Box>
496500
{refreshingReIndex ? (

template_cdk.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"client_id": "string_EXTERNAL_IDP_CLIENT_ID|DEFAULT=None",
5555
"response_types": "string_EXTERNAL_RESPONSE_TYPES_USED_IN_OIDC_FLOW|DEFAULT=None",
5656
"scopes": "string_EXTERNAL_IDP_SCOPES_SPACE_SEPARATED|DEFAULT=None",
57-
"jwks_url" : "string_EXTERNAL_IDP_JWKS_URL|DEFAULT=None",
5857
"claims_mapping": {
5958
"user_id": "string_USER_ID_CLAIM_NAME_MAPPING_FOR_EXTERNAL_IDP|DEFAULT=None",
6059
"email": "string_EMAIL_ID_CLAIM_NAME_MAPPING_FOR_EXTERNAL_IDP|DEFAULT=None"

0 commit comments

Comments
 (0)