From 2140a283bf8af4b2f61cf77fb33ace93e36f5f62 Mon Sep 17 00:00:00 2001 From: Wang Yan Date: Thu, 16 Jan 2025 13:51:07 +0800 Subject: [PATCH] remove with_signature (#21420) Signed-off-by: wang yan --- api/v2.0/swagger.yaml | 12 ------------ .../artifact/artifact-tag/artifact-tag.component.ts | 2 -- tests/apitests/python/library/artifact.py | 2 -- tests/apitests/python/test_p2p.py | 2 +- tests/apitests/python/test_proxy_cache.py | 2 +- tests/apitests/python/test_push_files_by_oras.py | 2 +- .../python/test_push_image_with_special_name.py | 2 +- .../python/test_sbom_generation_of_image_artifact.py | 2 +- tests/apitests/python/test_scan_image_artifact.py | 2 +- .../test_stop_sbom_generation_of_image_artifact.py | 2 +- .../apitests/python/test_stop_scan_image_artifact.py | 2 +- tests/apitests/python/test_tag_immutability.py | 2 +- tests/apitests/python/test_webhook_crud.py | 2 +- tests/resources/Harbor-Pages/Project-Artifact.robot | 2 +- 14 files changed, 11 insertions(+), 27 deletions(-) diff --git a/api/v2.0/swagger.yaml b/api/v2.0/swagger.yaml index 5f3896b19..bcdfde3d9 100644 --- a/api/v2.0/swagger.yaml +++ b/api/v2.0/swagger.yaml @@ -997,12 +997,6 @@ paths: type: boolean required: false default: false - - name: with_signature - in: query - description: Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting "with_tag=true" - type: boolean - required: false - default: false - name: with_immutable_status in: query description: Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting "with_immutable_status=true" @@ -1313,12 +1307,6 @@ paths: - $ref: '#/parameters/sort' - $ref: '#/parameters/page' - $ref: '#/parameters/pageSize' - - name: with_signature - in: query - description: Specify whether the signature is included inside the returning tags - type: boolean - required: false - default: false - name: with_immutable_status in: query description: Specify whether the immutable status is included inside the returning tags diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts index fe4ab6922..4a22eb457 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts +++ b/src/portal/src/app/base/project/repository/artifact/artifact-tag/artifact-tag.component.ts @@ -114,7 +114,6 @@ export class ArtifactTagComponent implements OnInit, OnDestroy { projectName: this.projectName, repositoryName: dbEncodeURIComponent(this.repositoryName), reference: this.artifactDetails.digest, - withSignature: true, withImmutableStatus: true, q: encodeURIComponent(`name=${name}`), }; @@ -165,7 +164,6 @@ export class ArtifactTagComponent implements OnInit, OnDestroy { repositoryName: dbEncodeURIComponent(this.repositoryName), reference: this.artifactDetails.digest, page: pageNumber, - withSignature: true, withImmutableStatus: true, pageSize: this.pageSize, sort: getSortingString(state), diff --git a/tests/apitests/python/library/artifact.py b/tests/apitests/python/library/artifact.py index eca6a37c8..83a66eee8 100644 --- a/tests/apitests/python/library/artifact.py +++ b/tests/apitests/python/library/artifact.py @@ -23,8 +23,6 @@ class Artifact(base.Base, object): def get_reference_info(self, project_name, repo_name, reference, expect_status_code = 200, ignore_not_found = False,**kwargs): params = {} - if "with_signature" in kwargs: - params["with_signature"] = kwargs["with_signature"] if "with_tag" in kwargs: params["with_tag"] = kwargs["with_tag"] if "with_scan_overview" in kwargs: diff --git a/tests/apitests/python/test_p2p.py b/tests/apitests/python/test_p2p.py index c1d6168b8..011c1d7dd 100644 --- a/tests/apitests/python/test_p2p.py +++ b/tests/apitests/python/test_p2p.py @@ -53,7 +53,7 @@ class TestP2P(unittest.TestCase): 2. Delete user(UA). """ user_id, user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - USER_CLIENT=dict(with_signature = True, endpoint = self.url, username = user_name, password = self.user_password) + USER_CLIENT=dict(endpoint = self.url, username = user_name, password = self.user_password) #2. Create a new distribution instance; instance_id, instance_name = self.preheat.create_instance( **ADMIN_CLIENT) diff --git a/tests/apitests/python/test_proxy_cache.py b/tests/apitests/python/test_proxy_cache.py index ff68c0718..5d18559d7 100644 --- a/tests/apitests/python/test_proxy_cache.py +++ b/tests/apitests/python/test_proxy_cache.py @@ -54,7 +54,7 @@ class TestProxyCache(unittest.TestCase): 2. Delete user(UA). """ user_id, user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - USER_CLIENT=dict(with_signature = True, endpoint = self.url, username = user_name, password = self.user_password) + USER_CLIENT=dict(endpoint = self.url, username = user_name, password = self.user_password) image_for_docker = dict(image = "for_proxy", tag = "1.0") image_for_ctr = dict(image = "redis", tag = "latest") diff --git a/tests/apitests/python/test_push_files_by_oras.py b/tests/apitests/python/test_push_files_by_oras.py index 5e9ad2f04..d02c8add5 100644 --- a/tests/apitests/python/test_push_files_by_oras.py +++ b/tests/apitests/python/test_push_files_by_oras.py @@ -47,7 +47,7 @@ class TestProjects(unittest.TestCase): #1. Create user-001 TestProjects.user_id, user_name = self.user.create_user(user_password = user_001_password, **ADMIN_CLIENT) - TestProjects.USER_CLIENT=dict(with_signature = True, endpoint = url, username = user_name, password = user_001_password) + TestProjects.USER_CLIENT=dict(endpoint = url, username = user_name, password = user_001_password) #2. Create a new private project(PA) by user(UA); TestProjects.project_id, TestProjects.project_name = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_CLIENT) diff --git a/tests/apitests/python/test_push_image_with_special_name.py b/tests/apitests/python/test_push_image_with_special_name.py index b2e082516..afd80035b 100644 --- a/tests/apitests/python/test_push_image_with_special_name.py +++ b/tests/apitests/python/test_push_image_with_special_name.py @@ -52,7 +52,7 @@ class TestProjects(unittest.TestCase): #1. Create user-001 TestProjects.user_sign_image_id, user_sign_image_name = self.user.create_user(user_password = user_001_password, **ADMIN_CLIENT) - TestProjects.USER_sign_image_CLIENT=dict(with_signature = True, endpoint = url, username = user_sign_image_name, password = user_001_password) + TestProjects.USER_sign_image_CLIENT=dict(endpoint = url, username = user_sign_image_name, password = user_001_password) #2. Create a new private project(PA) by user(UA); TestProjects.project_sign_image_id, TestProjects.project_sign_image_name = self.project.create_project(metadata = {"public": "false"}, **ADMIN_CLIENT) diff --git a/tests/apitests/python/test_sbom_generation_of_image_artifact.py b/tests/apitests/python/test_sbom_generation_of_image_artifact.py index 8025fafe3..23b673dd2 100644 --- a/tests/apitests/python/test_sbom_generation_of_image_artifact.py +++ b/tests/apitests/python/test_sbom_generation_of_image_artifact.py @@ -25,7 +25,7 @@ class TestSBOMGeneration(unittest.TestCase): self.user_password = "Aa123456" self.project_id, self.project_name, self.user_id, self.user_name, self.repo_name1 = [None] * 5 self.user_id, self.user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - self.USER_CLIENT = dict(with_signature = True, with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_sbom_overview = True) + self.USER_CLIENT = dict(with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_sbom_overview = True) #2. Create a new private project(PA) by user(UA); diff --git a/tests/apitests/python/test_scan_image_artifact.py b/tests/apitests/python/test_scan_image_artifact.py index 1095a8313..69a5e31bb 100644 --- a/tests/apitests/python/test_scan_image_artifact.py +++ b/tests/apitests/python/test_scan_image_artifact.py @@ -25,7 +25,7 @@ class TestScan(unittest.TestCase): self.user_password = "Aa123456" self.project_id, self.project_name, self.user_id, self.user_name, self.repo_name1 = [None] * 5 self.user_id, self.user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - self.USER_CLIENT = dict(with_signature = True, with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_scan_overview = True) + self.USER_CLIENT = dict(with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_scan_overview = True) #2. Create a new private project(PA) by user(UA); diff --git a/tests/apitests/python/test_stop_sbom_generation_of_image_artifact.py b/tests/apitests/python/test_stop_sbom_generation_of_image_artifact.py index 232e5e85d..354155033 100644 --- a/tests/apitests/python/test_stop_sbom_generation_of_image_artifact.py +++ b/tests/apitests/python/test_stop_sbom_generation_of_image_artifact.py @@ -27,7 +27,7 @@ class TestStopSBOMGeneration(unittest.TestCase): self.user_password = "Aa123456" self.project_id, self.project_name, self.user_id, self.user_name, self.repo_name1 = [None] * 5 self.user_id, self.user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - self.USER_CLIENT = dict(with_signature = True, with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_sbom_overview = True) + self.USER_CLIENT = dict(with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_sbom_overview = True) #2. Create a new private project(PA) by user(UA); diff --git a/tests/apitests/python/test_stop_scan_image_artifact.py b/tests/apitests/python/test_stop_scan_image_artifact.py index 4d3c02190..9989951fb 100644 --- a/tests/apitests/python/test_stop_scan_image_artifact.py +++ b/tests/apitests/python/test_stop_scan_image_artifact.py @@ -27,7 +27,7 @@ class TestStopScan(unittest.TestCase): self.user_password = "Aa123456" self.project_id, self.project_name, self.user_id, self.user_name, self.repo_name1 = [None] * 5 self.user_id, self.user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - self.USER_CLIENT = dict(with_signature = True, with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_scan_overview = True) + self.USER_CLIENT = dict(with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password, with_scan_overview = True) #2. Create a new private project(PA) by user(UA); diff --git a/tests/apitests/python/test_tag_immutability.py b/tests/apitests/python/test_tag_immutability.py index 454917111..42e1ad9a3 100644 --- a/tests/apitests/python/test_tag_immutability.py +++ b/tests/apitests/python/test_tag_immutability.py @@ -27,7 +27,7 @@ class TestTagImmutability(unittest.TestCase): self.tag_immutability = Tag_Immutability() self.project_id, self.project_name, self.user_id, self.user_name = [None] * 4 self.user_id, self.user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - self.USER_CLIENT = dict(with_signature = True, with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password) + self.USER_CLIENT = dict(with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password) self.exsiting_rule = dict(selector_repository="rel*", selector_tag="v2.*") self.project_id, self.project_name = self.project.create_project(metadata = {"public": "false"}, **self.USER_CLIENT) diff --git a/tests/apitests/python/test_webhook_crud.py b/tests/apitests/python/test_webhook_crud.py index 8fbacc3cb..0cbfcba92 100644 --- a/tests/apitests/python/test_webhook_crud.py +++ b/tests/apitests/python/test_webhook_crud.py @@ -23,7 +23,7 @@ class TestProjects(unittest.TestCase): self.webhook= Webhook() self.user_id, self.project_id = [None] * 2 self.user_id, self.user_name = self.user.create_user(user_password = self.user_password, **ADMIN_CLIENT) - self.USER_CLIENT = dict(with_signature = True, with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password) + self.USER_CLIENT = dict(with_immutable_status = True, endpoint = self.url, username = self.user_name, password = self.user_password) @unittest.skipIf(TEARDOWN == True, "Test data won't be erased.") def tearDown(self): diff --git a/tests/resources/Harbor-Pages/Project-Artifact.robot b/tests/resources/Harbor-Pages/Project-Artifact.robot index 731abfd99..421cd0016 100644 --- a/tests/resources/Harbor-Pages/Project-Artifact.robot +++ b/tests/resources/Harbor-Pages/Project-Artifact.robot @@ -52,7 +52,7 @@ Should Not Contain Any Artifact Get The Specific Artifact [Arguments] ${project_name} ${repo_name} ${reference} - ${cmd}= Set Variable curl -u ${HARBOR_ADMIN}:${HARBOR_PASSWORD} -s --insecure -H "Content-Type: application/json" -X GET "${HARBOR_URL}/api/v2.0/projects/${project_name}/repositories/${repo_name}/artifacts/${reference}?page=1&page_size=10&with_tag=true&with_label=true&with_scan_overview=true&with_accessory=true&with_signature=true&with_immutable_status=true" + ${cmd}= Set Variable curl -u ${HARBOR_ADMIN}:${HARBOR_PASSWORD} -s --insecure -H "Content-Type: application/json" -X GET "${HARBOR_URL}/api/v2.0/projects/${project_name}/repositories/${repo_name}/artifacts/${reference}?page=1&page_size=10&with_tag=true&with_label=true&with_scan_overview=true&with_accessory=true&with_immutable_status=true" ${rc} ${output}= Run And Return Rc And Output ${cmd} [Return] ${output}