Skip to content

Commit

Permalink
remove with_signature (goharbor#21420)
Browse files Browse the repository at this point in the history
Signed-off-by: wang yan <[email protected]>
  • Loading branch information
wy65701436 authored Jan 16, 2025
1 parent b4c3c73 commit 2140a28
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 27 deletions.
12 changes: 0 additions & 12 deletions api/v2.0/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`),
};
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 0 additions & 2 deletions tests/apitests/python/library/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def list_artifacts(self, project_name, repo_name, **kwargs):

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:
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def do_validate(self, registry_type):
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_proxy_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def do_validate(self, registry_type):
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")
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_push_files_by_oras.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def testOrasCli(self):
#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)
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_push_image_with_special_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def testPushImageWithSpecialName(self):
#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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setUp(self):
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);
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_scan_image_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setUp(self):
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setUp(self):
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);
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_stop_scan_image_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setUp(self):
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);
Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_tag_immutability.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setUp(self):
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)

Expand Down
2 changes: 1 addition & 1 deletion tests/apitests/python/test_webhook_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setUp(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/Harbor-Pages/Project-Artifact.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit 2140a28

Please sign in to comment.