From 64126f8b4913366aca0befa67a29d25b5a9abab6 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Wed, 4 Dec 2024 17:55:11 +0800 Subject: [PATCH 01/14] test --- masking/data-classification.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/data-classification.json b/masking/data-classification.json index d2caa69..9958df4 100644 --- a/masking/data-classification.json +++ b/masking/data-classification.json @@ -8,7 +8,7 @@ "levels": [ { "id": "1", - "title": "Level 1", + "title": "Level 01", "description": "" }, { From 764d4b86b003e0ab884f91b7fe74c10ef4c59c5c Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 12:07:22 +0800 Subject: [PATCH 02/14] test --- .github/workflows/bb-masking-3.yml | 2 +- masking/data-classification.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bb-masking-3.yml b/.github/workflows/bb-masking-3.yml index ce10e21..04bfaa8 100644 --- a/.github/workflows/bb-masking-3.yml +++ b/.github/workflows/bb-masking-3.yml @@ -68,7 +68,7 @@ jobs: --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") - # Extract status code and response body + # Extract status code and response body status_code=$(echo "$response" | tail -n1) body=$(echo "$response" | sed '$d') diff --git a/masking/data-classification.json b/masking/data-classification.json index 9958df4..d2caa69 100644 --- a/masking/data-classification.json +++ b/masking/data-classification.json @@ -8,7 +8,7 @@ "levels": [ { "id": "1", - "title": "Level 01", + "title": "Level 1", "description": "" }, { From ba32a48167662808e1dd1b14ef8d4342cbab708b Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 12:15:26 +0800 Subject: [PATCH 03/14] update --- .github/workflows/bb-masking-3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bb-masking-3.yml b/.github/workflows/bb-masking-3.yml index 04bfaa8..b60c4a9 100644 --- a/.github/workflows/bb-masking-3.yml +++ b/.github/workflows/bb-masking-3.yml @@ -63,7 +63,7 @@ jobs: CHANGED_FILE="masking/data-classification.json" echo "Processing: $CHANGED_FILE" - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification?allow_missing=true" \ + response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification" \ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") From 47275c9ecaf9cff4c2bb8ad483b95e400ec25804 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 12:20:34 +0800 Subject: [PATCH 04/14] test --- .github/workflows/bb-masking-3.yml | 2 +- masking/data-classification.json | 2 +- masking/global-masking-rule.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bb-masking-3.yml b/.github/workflows/bb-masking-3.yml index b60c4a9..9a57271 100644 --- a/.github/workflows/bb-masking-3.yml +++ b/.github/workflows/bb-masking-3.yml @@ -119,7 +119,7 @@ jobs: with: script: | const changedFiles = process.env.CHANGED_FILES || ''; - let commentBody = `### Masking Policy Update 2 Summary\n\n`; + let commentBody = `### Masking Policy Update 3 Summary\n\n`; // Add status of merge commentBody += `✅ **PR Status:** Merged\n\n`; diff --git a/masking/data-classification.json b/masking/data-classification.json index d2caa69..9958df4 100644 --- a/masking/data-classification.json +++ b/masking/data-classification.json @@ -8,7 +8,7 @@ "levels": [ { "id": "1", - "title": "Level 1", + "title": "Level 01", "description": "" }, { diff --git a/masking/global-masking-rule.json b/masking/global-masking-rule.json index 687f02e..1b53442 100644 --- a/masking/global-masking-rule.json +++ b/masking/global-masking-rule.json @@ -11,7 +11,7 @@ "title": "", "description": "" }, - "maskingLevel": "NONE" + "maskingLevel": "PARTIAL" }, { "id": "d188a226-5ed6-45cc-82e3-baa890a87962", From 460e55798f19cf3b0579d64f9ce053bb06a55a45 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 12:24:24 +0800 Subject: [PATCH 05/14] test --- masking/global-masking-rule.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/global-masking-rule.json b/masking/global-masking-rule.json index 1b53442..687f02e 100644 --- a/masking/global-masking-rule.json +++ b/masking/global-masking-rule.json @@ -11,7 +11,7 @@ "title": "", "description": "" }, - "maskingLevel": "PARTIAL" + "maskingLevel": "NONE" }, { "id": "d188a226-5ed6-45cc-82e3-baa890a87962", From 570bdf352cd7dcec50adce0ae05690a91e2a13a6 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:02:09 +0800 Subject: [PATCH 06/14] update --- .github/workflows/bb-masking-3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bb-masking-3.yml b/.github/workflows/bb-masking-3.yml index 9a57271..09081d0 100644 --- a/.github/workflows/bb-masking-3.yml +++ b/.github/workflows/bb-masking-3.yml @@ -63,7 +63,7 @@ jobs: CHANGED_FILE="masking/data-classification.json" echo "Processing: $CHANGED_FILE" - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification" \ + response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/v1/settings/bb.workspace.data-classification" \ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") @@ -90,7 +90,7 @@ jobs: echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "global-masking-rule.json" | while read -r CHANGED_FILE; do echo "Processing: $CHANGED_FILE" - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.global-masking-rule?allow_missing=true" \ + response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/v1/policies/masking_rule?allow_missing=true&update_mask=payload" \ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") From 52fa5deebe93673e9ad184d9cb02e40784ce4450 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:04:19 +0800 Subject: [PATCH 07/14] test --- masking/global-masking-rule.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/global-masking-rule.json b/masking/global-masking-rule.json index 687f02e..1b53442 100644 --- a/masking/global-masking-rule.json +++ b/masking/global-masking-rule.json @@ -11,7 +11,7 @@ "title": "", "description": "" }, - "maskingLevel": "NONE" + "maskingLevel": "PARTIAL" }, { "id": "d188a226-5ed6-45cc-82e3-baa890a87962", From e9a80bc49dd8bcfa58acf81a56bd998be2a8339f Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:07:02 +0800 Subject: [PATCH 08/14] update --- .github/workflows/bb-masking-3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bb-masking-3.yml b/.github/workflows/bb-masking-3.yml index 09081d0..09a3329 100644 --- a/.github/workflows/bb-masking-3.yml +++ b/.github/workflows/bb-masking-3.yml @@ -63,7 +63,7 @@ jobs: CHANGED_FILE="masking/data-classification.json" echo "Processing: $CHANGED_FILE" - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/v1/settings/bb.workspace.data-classification" \ + response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification" \ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") @@ -90,7 +90,7 @@ jobs: echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "global-masking-rule.json" | while read -r CHANGED_FILE; do echo "Processing: $CHANGED_FILE" - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/v1/policies/masking_rule?allow_missing=true&update_mask=payload" \ + response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/policies/masking_rule?allow_missing=true&update_mask=payload" \ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") From bd3a180654accf5b3956fad20ce01549fa567fcb Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:08:12 +0800 Subject: [PATCH 09/14] test --- masking/global-masking-rule.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/global-masking-rule.json b/masking/global-masking-rule.json index 1b53442..687f02e 100644 --- a/masking/global-masking-rule.json +++ b/masking/global-masking-rule.json @@ -11,7 +11,7 @@ "title": "", "description": "" }, - "maskingLevel": "PARTIAL" + "maskingLevel": "NONE" }, { "id": "d188a226-5ed6-45cc-82e3-baa890a87962", From 972df44b92e5d9c45321d7b41859f2af82789787 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:12:17 +0800 Subject: [PATCH 10/14] test --- masking/masking-algorithm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/masking-algorithm.json b/masking/masking-algorithm.json index d5d017a..e1c721c 100644 --- a/masking/masking-algorithm.json +++ b/masking/masking-algorithm.json @@ -15,7 +15,7 @@ { "id": "bbd2893d-55b2-429c-bf7c-6f073e2bcdeb", "title": "RangeMask", - "description": "this is range mask", + "description": "this is ??? range mask", "category": "MASK", "rangeMask": { "slices": [ From 768a9cbb07a4969933af83f3f4e2824c0cc7b6a6 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:21:56 +0800 Subject: [PATCH 11/14] test --- masking/masking-algorithm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/masking-algorithm.json b/masking/masking-algorithm.json index e1c721c..d5d017a 100644 --- a/masking/masking-algorithm.json +++ b/masking/masking-algorithm.json @@ -15,7 +15,7 @@ { "id": "bbd2893d-55b2-429c-bf7c-6f073e2bcdeb", "title": "RangeMask", - "description": "this is ??? range mask", + "description": "this is range mask", "category": "MASK", "rangeMask": { "slices": [ From 166dca83833d7a03540c44fae8c6f40e65ba6971 Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:24:08 +0800 Subject: [PATCH 12/14] test --- masking/data-classification.json | 2 +- masking/global-masking-rule.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/masking/data-classification.json b/masking/data-classification.json index 9958df4..d2caa69 100644 --- a/masking/data-classification.json +++ b/masking/data-classification.json @@ -8,7 +8,7 @@ "levels": [ { "id": "1", - "title": "Level 01", + "title": "Level 1", "description": "" }, { diff --git a/masking/global-masking-rule.json b/masking/global-masking-rule.json index 687f02e..1b53442 100644 --- a/masking/global-masking-rule.json +++ b/masking/global-masking-rule.json @@ -11,7 +11,7 @@ "title": "", "description": "" }, - "maskingLevel": "NONE" + "maskingLevel": "PARTIAL" }, { "id": "d188a226-5ed6-45cc-82e3-baa890a87962", From b921885635a03ce6b4034244da1ef681ebba887d Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:43:34 +0800 Subject: [PATCH 13/14] update --- .github/workflows/bb-masking-3.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bb-masking-3.yml b/.github/workflows/bb-masking-3.yml index 09a3329..0eb77e2 100644 --- a/.github/workflows/bb-masking-3.yml +++ b/.github/workflows/bb-masking-3.yml @@ -84,7 +84,7 @@ jobs: - name: Apply global masking rule id: apply-global-masking-rule - if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, '/global-masking-rule.json') }} + if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, 'global-masking-rule.json') }} run: | # Process all global-masking-rule.json files echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "global-masking-rule.json" | while read -r CHANGED_FILE; do @@ -103,11 +103,14 @@ jobs: echo "Response body: $body" # Append to outputs (with unique identifiers) - echo "${body}" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then + if [[ $status_code -ge 200 && $status_code -lt 300 ]]; then + echo "${body}" >> $GITHUB_OUTPUT + else echo "Failed with status code: $status_code" + echo "Response body: ${body}" + if [[ $status_code -eq 403 ]]; then + echo "Access denied. Please check your permissions and API token." + fi exit 1 fi done From 1a4f7610b5c5869d408684ca2f05ddef869b925a Mon Sep 17 00:00:00 2001 From: OP3ratordec <1914592563@qq.com> Date: Thu, 5 Dec 2024 13:45:35 +0800 Subject: [PATCH 14/14] test --- masking/global-masking-rule.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masking/global-masking-rule.json b/masking/global-masking-rule.json index 1b53442..687f02e 100644 --- a/masking/global-masking-rule.json +++ b/masking/global-masking-rule.json @@ -11,7 +11,7 @@ "title": "", "description": "" }, - "maskingLevel": "PARTIAL" + "maskingLevel": "NONE" }, { "id": "d188a226-5ed6-45cc-82e3-baa890a87962",