mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
Merge pull request #11777 from heww/fix-issue-11771
fix(swagger): enable security in swagger.yaml
This commit is contained in:
commit
9cc7a5547a
1
Makefile
1
Makefile
@ -518,7 +518,6 @@ swagger_client:
|
||||
mkdir -p harborclient/harbor_client
|
||||
mkdir -p harborclient/harbor_swagger_client
|
||||
mkdir -p harborclient/harbor_v2_swagger_client
|
||||
sed -i "/type: basic/ a\\security:\n - basicAuth: []" api/v2.0/swagger.yaml
|
||||
java -jar swagger-codegen-cli.jar generate -i api/swagger.yaml -l python -o harborclient/harbor_client -DpackageName=client
|
||||
java -jar swagger-codegen-cli.jar generate -i api/v2.0/legacy_swagger.yaml -l python -o harborclient/harbor_swagger_client -DpackageName=swagger_client
|
||||
java -jar swagger-codegen-cli.jar generate -i api/v2.0/swagger.yaml -l python -o harborclient/harbor_v2_swagger_client -DpackageName=v2_swagger_client
|
||||
|
@ -13,8 +13,11 @@ produces:
|
||||
consumes:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
basicAuth:
|
||||
basic:
|
||||
type: basic
|
||||
security:
|
||||
- basic: []
|
||||
- {}
|
||||
paths:
|
||||
/projects/{project_name}/repositories:
|
||||
get:
|
||||
|
@ -23,7 +23,12 @@ class Credential:
|
||||
self.password = password
|
||||
|
||||
def _create_client(server, credential, debug, api_type="products"):
|
||||
cfg = None
|
||||
if api_type in ('projectv2', 'artifact', 'repository', 'scan'):
|
||||
cfg = v2_swagger_client.Configuration()
|
||||
else:
|
||||
cfg = swagger_client.Configuration()
|
||||
|
||||
cfg.host = server.endpoint
|
||||
cfg.verify_ssl = server.verify_ssl
|
||||
# support basic auth only for now
|
||||
|
Loading…
Reference in New Issue
Block a user