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

feat(be+fe): Features for FUTU #590

Merged
merged 148 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 147 commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
0da04e4
batch create&reload db
530051970 Jan 19, 2024
b5aee97
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Jan 19, 2024
4a3f373
chore: upload batch file
chenhaiyun Jan 22, 2024
c421411
fix: remove xlsx file
chenhaiyun Jan 22, 2024
ef42e23
Merge pull request #569 from awslabs/haiyunc/frontend-batch-ui
chenhaiyun Jan 22, 2024
a4f7020
feat(be): Always update the schema of MySQL
nowfox Jan 23, 2024
dafc450
feat(cdk): add batch create jdbc datasource template
nowfox Jan 23, 2024
ccf0b88
Merge pull request #571 from awslabs/junzhong
nowfox Jan 23, 2024
1d4914a
fix(cdk): add batch create jdbc datasource template
nowfox Jan 23, 2024
f949d6a
Merge pull request #572 from awslabs/junzhong
nowfox Jan 23, 2024
d13dbfe
fix(cdk): add batch create jdbc datasource template
nowfox Jan 23, 2024
d427d9f
Merge pull request #573 from awslabs/junzhong
nowfox Jan 23, 2024
3c3f2c3
fix(cdk): invoke function policy
nowfox Jan 23, 2024
488eede
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Jan 23, 2024
872ce8d
batch operation
530051970 Jan 24, 2024
d54bbd5
fix(cdk): config
nowfox Jan 25, 2024
50e45db
update crawler when update connection
530051970 Jan 25, 2024
221b9a6
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Jan 25, 2024
e254f97
merge conflict
530051970 Jan 25, 2024
b996484
fix: fix upload status
chenhaiyun Jan 25, 2024
27deadf
fix: fix dlownload api
chenhaiyun Jan 25, 2024
fea4d06
fix: fix download template
chenhaiyun Jan 25, 2024
5c1bd14
fix: batch upload files
chenhaiyun Jan 25, 2024
e7b34a3
fix(be): modify ConcurrentRunJobNumber
nowfox Jan 26, 2024
0307405
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Jan 26, 2024
d7c0cb3
update jdbc bratch create
530051970 Jan 26, 2024
ecb331c
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Jan 26, 2024
4dcf46d
add list resource fun
530051970 Jan 26, 2024
35ee099
fix(be): Compatibility job failed
nowfox Jan 26, 2024
3eb877d
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Jan 26, 2024
d5c2943
chore: add system settings api
chenhaiyun Jan 26, 2024
a44f418
Merge branch 'patch/v1.1.0-ft' of awslabs:awslabs/sensitive-data-prot…
chenhaiyun Jan 26, 2024
8fc7a2a
fix: fix pending status color
chenhaiyun Jan 26, 2024
c81f857
chore: add mysql and other in add jdbc
chenhaiyun Jan 27, 2024
7f9084f
chore: add jdbc edit connection with other
chenhaiyun Jan 27, 2024
ce1036c
chore: add batch i18n
chenhaiyun Jan 28, 2024
e48d6df
fix: calculate ip
chenhaiyun Jan 28, 2024
fe7a3d4
fix: show pending in job detail
chenhaiyun Jan 28, 2024
a100206
chore: add tips when user close tips
chenhaiyun Jan 28, 2024
d5e1861
fix(fe): update subnet Desc
nowfox Jan 29, 2024
f2f67b6
fix: load database do not load page
chenhaiyun Jan 29, 2024
44ecf27
delete crawler and glue db when delete connection
530051970 Jan 31, 2024
d674f1a
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Jan 31, 2024
1e68ee2
fix(cdk): add glue:TagResource policy
nowfox Feb 1, 2024
53143e4
update jdbc create logic
530051970 Feb 1, 2024
a40e85e
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Feb 1, 2024
f9b1769
support feature for futu:update datasource logic for job
530051970 Feb 1, 2024
2629bab
fix(be): replace_single_quotes
nowfox Feb 1, 2024
8948e3d
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Feb 1, 2024
12fdeec
support feature for futu:update datasource logic for job
530051970 Feb 1, 2024
598b8cb
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Feb 1, 2024
31ee708
update list resource api
530051970 Feb 1, 2024
0306fa1
fix(be): add location result
nowfox Feb 5, 2024
672ef2c
fix(be): CustomFormat log
nowfox Feb 5, 2024
c2b0d9c
fix(cdk): Upgrade RDS
nowfox Feb 5, 2024
05a5f30
fix(cdk): Use appropriate policies
nowfox Feb 5, 2024
df8c376
fix(be): Generate a report after the job complete
nowfox Feb 5, 2024
67f5e95
fix(cdk): update SQL
nowfox Feb 5, 2024
3c0f155
fix(cdk): modify API readme
nowfox Feb 6, 2024
a7b11bd
fix(cdk): Glue Detection Job Policy
nowfox Feb 6, 2024
43f0a39
fix: fix upload link
chenhaiyun Feb 6, 2024
2b7b142
fix(cdk): Update policy
nowfox Feb 6, 2024
0007d47
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Feb 6, 2024
c851903
batch create datasources
530051970 Feb 6, 2024
2cf5ce7
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Feb 6, 2024
095b98a
fix: job cron time
chenhaiyun Feb 6, 2024
32ea1d4
fix: update batch progress count
chenhaiyun Feb 6, 2024
7f7d681
fix: remove unuse varible
chenhaiyun Feb 6, 2024
956df8f
fix: fix i18n
chenhaiyun Feb 6, 2024
1bb156e
update export catalog
530051970 Feb 7, 2024
a7e77a7
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Feb 7, 2024
db1e182
fix(cdk): Update ConcurrentRunJobNumber
nowfox Feb 7, 2024
b7011e2
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Feb 7, 2024
b8cdfa4
fix: batch upload with token
chenhaiyun Feb 8, 2024
a2eaac0
feat(be): export debug logs
yanbasic Feb 21, 2024
739449c
fix(cdk): EventBridge default status
nowfox Feb 22, 2024
7a61ca0
fix(be): update job report
nowfox Feb 23, 2024
0e6ec25
fix(be): import common logger
nowfox Feb 23, 2024
2b4281b
fix(be): import common logger
nowfox Feb 23, 2024
afd5f97
fix(fe): download debug logs as zip
yanbasic Feb 23, 2024
84edc35
update export headers
530051970 Feb 25, 2024
bf6f3e5
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Feb 25, 2024
1bb7734
bugs fix: resloved exception occured when vpc tag is null
530051970 Feb 26, 2024
3fccd2c
bug fix: update data catalog of s3 when exist unstructure data
530051970 Feb 26, 2024
24f4fdf
fix(cdk): dynamically CSP
nowfox Feb 27, 2024
bcf82a2
fix(fe): OIDC wildcard domain name
nowfox Feb 28, 2024
ba9b41e
export datasources
530051970 Mar 4, 2024
8e4bbac
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 4, 2024
57a09ec
fix(cdk): Updata version
nowfox Mar 7, 2024
3cb7dea
Merge remote-tracking branch 'origin/patch/v1.1.0-ft' into patch/v1.1…
nowfox Mar 7, 2024
caba64b
chore: update connect to authorize
chenhaiyun Mar 12, 2024
b707a06
chore: create s3 job change to data source
chenhaiyun Mar 12, 2024
4647172
chore: filter unconnected in s3
chenhaiyun Mar 12, 2024
15615be
feature develop
530051970 Mar 12, 2024
659dc6a
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 12, 2024
a2e727d
chore: change rds job to data source
chenhaiyun Mar 12, 2024
80447ba
chore: start job remove await
chenhaiyun Mar 12, 2024
ac393c6
update datasource selection
530051970 Mar 12, 2024
0538e4a
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 12, 2024
a2549c7
fix(be): update list secrets size
nowfox Mar 12, 2024
97aae0f
update batch operation on identifier selection
530051970 Mar 14, 2024
5ffb33b
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 14, 2024
17443ae
fix(cdk): batch create template
nowfox Mar 14, 2024
1925cdd
update jdbc authorize
530051970 Mar 14, 2024
7a498fb
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 14, 2024
05c2cc6
update jdbc catalog status
530051970 Mar 14, 2024
0f283aa
fix(cdk): batch create template
nowfox Mar 15, 2024
e1566e5
batch create identifier
530051970 Mar 15, 2024
74e9b01
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 15, 2024
6889995
batch create identifiers
530051970 Mar 17, 2024
01ab645
fix(be): Simplify the progress of obtaining tasks
nowfox Mar 18, 2024
9e44601
update batch create datasource
530051970 Mar 18, 2024
b3c2f3f
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 18, 2024
e92ee9d
clear s3 object
530051970 Mar 18, 2024
3238fb5
update batch create template
530051970 Mar 19, 2024
23ad02c
update batch create template
530051970 Mar 19, 2024
03d0a01
fix(cdk): UnstructuredParsePolicy
nowfox Mar 19, 2024
5f45f0b
update batch create template
530051970 Mar 19, 2024
e47aab0
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 19, 2024
035388e
update batch create template
530051970 Mar 19, 2024
70013c0
fix(cdk): next token
nowfox Mar 19, 2024
760a566
update batch create template
530051970 Mar 20, 2024
abefe89
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 20, 2024
dc1a8e1
fix(cdk): update cdk
nowfox Mar 20, 2024
2e11de5
catch exception when create datasource
530051970 Mar 20, 2024
1d303e8
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 20, 2024
3c71aae
update batch create datasource
530051970 Mar 20, 2024
c377ac4
update fe code for create ds
530051970 Mar 20, 2024
8910aec
fix:export identifier
530051970 Mar 20, 2024
89156b9
fix:export identifier
530051970 Mar 21, 2024
43e9ce0
fix:catalog export etc.
530051970 Mar 21, 2024
53872d0
fix:catalog export etc.
530051970 Mar 22, 2024
d4fe5f4
fix:dashboard index error
530051970 Mar 22, 2024
f83a259
fix:change glue state to authorized when update jdbc conn
530051970 Mar 22, 2024
e6ec2f4
fix(be): list jdbc schema
nowfox Mar 25, 2024
aa7086c
fix:dashboard
530051970 Mar 25, 2024
d1be896
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 25, 2024
a1708a3
fix(be): update job parameter
nowfox Mar 25, 2024
e9e1d76
fix:update source column
530051970 Mar 26, 2024
6c4257a
Merge branch 'patch/v1.1.0-ft' of github.com:awslabs/sensitive-data-p…
530051970 Mar 26, 2024
aa184bb
fix(be): update processing job version
nowfox Mar 27, 2024
d28a054
fix:jdbc_databases except catch
530051970 Mar 27, 2024
e20a8dc
fix:jdbc_databases except catch
530051970 Mar 27, 2024
a0b5f0c
merged from main branch
530051970 Mar 27, 2024
5e69c8b
fix:update datasource
530051970 Mar 28, 2024
818a22a
fix:reslove pr issues
530051970 Mar 29, 2024
3ee19f7
fix:reslove pr issues
530051970 Mar 29, 2024
38aefa4
fix:reslove pr issues
530051970 Mar 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
be+fe
cdk
others
subjectPattern: ^[\s\w-\.]{5,100}$
subjectPattern: ^[\s\w-\./]{5,100}$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
Expand Down
19 changes: 19 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 忽略所有在 tests 目录下的文件
tests/

# 忽略所有的 .json 文件
*.json

# 忽略特定的文件
.gitignore
deployment/cdk-solution-helper/index.js
deployment/cdk-solution-helper/index.js
deployment/cdk-solution-helper/index.js
deployment/helper.py
source/portal/config/env.js
source/portal/config/modules.js
source/portal/config/modules.js
source/portal/config/modules.js
source/portal/config/paths.js
source/portal/nginx-config/start_nginx.sh
.github/*
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ phases:
- chmod +x ./run-all-tests.sh && ./run-all-tests.sh
- echo "Installing dependencies and executing unit tests completed `date`"
- export BSS_IMAGE_ASSET_REPOSITORY_NAME='aws-sensitive-data-protection'
- export BUILD_VERSION=1.1.1-${CODEBUILD_RESOLVED_SOURCE_VERSION:0:7}
- export BUILD_VERSION=1.1.2-${CODEBUILD_RESOLVED_SOURCE_VERSION:0:7}
- export CN_ASSETS='cn/'
- |-
set -euxo pipefail
Expand Down
2 changes: 2 additions & 0 deletions deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ title "cdk synth"
run cd ${SRC_PATH}

# Replace before building
sed -i "s|DEBUG|INFO|"g api/logging.conf

sed -i "s|@TEMPLATE_SOLUTION_VERSION@|$SOLUTION_VERSION|"g lib/admin/database/*/*.sql
sed -i "s|@TEMPLATE_SOLUTION_VERSION@|$SOLUTION_VERSION|"g lib/agent/DiscoveryJob.json

Expand Down
4 changes: 4 additions & 0 deletions source/.viperlightignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ constructs/api/pytest/test_data_source.py
constructs/api/pytest/test_labels.py
constructs/api/pytest/test_query.py
constructs/lib/common/solution-info.ts:30
constructs/config/batch_create/datasource/template/batch_create_jdbc_datasource-cn.xlsx
constructs/config/batch_create/datasource/template/batch_create_jdbc_datasource-en.xlsx
constructs/config/batch_create/identifier/template/batch_create_identifier-cn.xlsx
constructs/config/batch_create/identifier/template/batch_create_identifier-en.xlsx

[python-pipoutdated]
pip=v21.1.2
Expand Down
23 changes: 19 additions & 4 deletions source/constructs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,31 @@ As shown in the following format. Please follow this configuration. Select 'Othe
```json
{"username":"db username","password":"db password","engine":"mysql","host":"127.0.0.1","port":6306}
```
### 4. Configuration development mode
The following command is configured as development mode to bypass authentication.
### 4. Configure development parameters
```shell
export AdminBucketName="Your admin bucket name"
# The two subnets where the API lambda is located
export SubnetIds="subnet-xxxxxx,subnet-xxxxxx"
# Development mode that bypasses authentication
export mode=dev
```
### 5. Starting web services locally
### 5. Run as API role
Firstly, use `aws configure -- profile cn` to configure a user authorization information. This user needs to have `sts:AssumeRole` permission.
Secondly, modify the trust relationships of the SDPS API role in the Admin account and add the first step user in the principal.
Thirdly, modify `.aws/config` file and configure the default profile using the following command
```
[default]
region = cn-northwest-1
source_profile = cn
role_arn = arn:aws-cn:iam::{AdminAccountId}:role/SDPSAPIRole-cn-northwest-1
output = json
```
Finally, validate using `aws sts get-caller-identity`. If the returned content contains `arn:aws-cn:sts::{AdminAccountId}:assumed-role/SDPSAPIRole-{Region}`, it indicates that the configuration is correct.
### 6. Starting web services locally
```shell
uvicorn main:app --reload
```
### 6. View API
### 7. View API
http://127.0.0.1:8000/docs

## File Naming
Expand Down
37 changes: 35 additions & 2 deletions source/constructs/api/catalog/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,16 @@ def delete_catalog_table_level_classification_by_database_region(database: str,
).delete()
session.commit()

def delete_catalog_table_level_classification_by_database_region_batch(database: str, region: str, type: str):
session = get_session()
session.query(models.CatalogTableLevelClassification).filter(
models.CatalogTableLevelClassification.database_name == database,
models.CatalogTableLevelClassification.database_type == type
).filter(
models.CatalogTableLevelClassification.region == region
).delete(synchronize_session=False)
session.commit()


def delete_catalog_table_level_classification_by_database(database: str, region: str, type: str):
session = get_session()
Expand Down Expand Up @@ -698,6 +708,16 @@ def delete_catalog_database_level_classification_by_database_region(database: st
).delete()
session.commit()

def delete_catalog_database_level_classification_by_database_region_batch(database: str, region: str, type: str):
session = get_session()
session.query(models.CatalogDatabaseLevelClassification).filter(
models.CatalogDatabaseLevelClassification.database_name == database,
models.CatalogDatabaseLevelClassification.database_type == type
).filter(
models.CatalogDatabaseLevelClassification.region == region
).delete(synchronize_session=False)
session.commit()


def delete_catalog_column_level_classification_by_database_region(database: str, region: str, type: str):
session = get_session()
Expand All @@ -709,6 +729,16 @@ def delete_catalog_column_level_classification_by_database_region(database: str,
).delete()
session.commit()

def delete_catalog_column_level_classification_by_database_region_batch(database: str, region: str, type: str):
session = get_session()
session.query(models.CatalogColumnLevelClassification).filter(
models.CatalogColumnLevelClassification.database_name == database,
models.CatalogDatabaseLevelClassification.database_type == type
).filter(
models.CatalogColumnLevelClassification.region == region
).delete(synchronize_session=False)
session.commit()


def delete_catalog_column_level_classification_by_database(database: str, region: str, type: str):
session = get_session()
Expand Down Expand Up @@ -1056,11 +1086,14 @@ def update_catalog_table_labels(


def get_export_catalog_data():
return get_session().query(models.CatalogColumnLevelClassification.account_id,
return get_session().query(models.CatalogColumnLevelClassification.database_type,
models.CatalogColumnLevelClassification.account_id,
models.CatalogColumnLevelClassification.region,
models.CatalogColumnLevelClassification.database_type,
models.CatalogColumnLevelClassification.database_name,
models.CatalogDatabaseLevelClassification.description,
models.CatalogDatabaseLevelClassification.url,
models.CatalogColumnLevelClassification.table_name,
models.CatalogTableLevelClassification.storage_location,
models.CatalogColumnLevelClassification.column_name,
models.CatalogColumnLevelClassification.column_path,
models.CatalogColumnLevelClassification.identifier,
Expand Down
1 change: 0 additions & 1 deletion source/constructs/api/catalog/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ def agg_catalog_summary_by_privacy(database_type: str):
@router.get("/dashboard/agg-catalog-top-n", response_model=BaseResponse)
@inject_session
def agg_catalog_top_n(database_type: str, top_n: int):

return service_dashboard.agg_catalog_data_source_top_n(database_type, top_n)


Expand Down
Loading
Loading