mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-05 00:23:33 +01:00
97c1fdcd8e
Fix #18617 Signed-off-by: Yang Jiao <jiaoya@vmware.com>
13 lines
555 B
Python
13 lines
555 B
Python
# -*- coding: utf-8 -*-
|
|
import requests
|
|
|
|
def call(server, project_name, repo_name, digest, artifactType=None, **kwargs):
|
|
url=None
|
|
auth = (kwargs.get("username"), kwargs.get("password"))
|
|
if artifactType:
|
|
artifactType = artifactType.replace("+", "%2B")
|
|
url="https://{}/v2/{}/{}/referrers/{}?artifactType={}".format(server, project_name, repo_name, digest, artifactType)
|
|
else:
|
|
url="https://{}/v2/{}/{}/referrers/{}".format(server, project_name, repo_name, digest)
|
|
return requests.get(url, auth=auth, verify=False)
|