1
0
mirror of https://github.com/goharbor/harbor.git synced 2026-10-26 09:59:33 +03:00
Commit Graph

557 Commits

Author SHA1 Message Date
Patrick Eschenbach
abc41cc9eb Fix/api completeness (#23476)
* docs(api): fix 15 swagger gaps — descriptions, responses, lint rules

- Add missing description/summary to deleteProjectMember,
  UpdateImmuRule, DeleteImmuRule, listUsers, getCurrentUserInfo,
  getUser, updateUserProfile, setUserSysAdmin,
  getCurrentUserPermissions, listSchedules, getSchedulePaused
- Add accurate error responses traced to handler code:
  404 on member/immutable ops (RequireProjectAccess paths),
  403+500 on listAuditLogEventTypes (RequireSystemAccess),
  412 on getCurrentUserInfo (non-local security context),
  400 on listSchedules/getSchedulePaused/updateUserProfile,
  401+500 on getRentenitionMetadata (Prepare middleware),
  500 on pingOIDC
- Remove inaccurate responses: 404 from getSchedulePaused/
  listSchedules/updateUserProfile; 403 from getSchedulePaused;
  500 from getCurrentUserPermissions (in-memory only)
- Fix inline 500/401 descriptions in setUserSysAdmin and
  getCurrentUserPermissions to use shared  definitions
- Add operation-description and operation-summary-required rules
  to .spectral.yaml to prevent regression

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* chore: complete swagger changes for harbor-cli well known issues

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* docs(api): restore response codes removed in error from schedules and user endpoints

- Restore 404 on listSchedules (GET /schedules)
- Restore 403 and 404 on getSchedulePaused (GET /schedules/{job_type}/paused)
- Restore 404 on updateUserProfile (PUT /users/{id})
- Restore 500 on getCurrentUserPermissions (GET /users/current/permissions)

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* fix: clean up binaries

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* fix: add needed statements for spectral linting and api tests

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* fix: add changes for unsupported entity; more clear description

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Patrick Eschenbach <45457307+qcserestipy@users.noreply.github.com>

* fix: add changes for unsupported entity; more clear description

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Patrick Eschenbach <45457307+qcserestipy@users.noreply.github.com>

* fix: add changes for unsupported entity; more clear description

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>

---------

Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <45457307+qcserestipy@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-02 23:42:39 +00:00
stonezdj(Daojun Zhang)
914738c3f1 Update artifact_accessory to add source column to identify accessory (#23144)
Add project_metadata config item proxy_referrer_api
   Rename getRemoteRepo to GetRemoteRepo

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-24 08:11:28 +00:00
stonezdj(Daojun Zhang)
63618e8a9f Add UI option to enable proxy cache referrer API (#23151)
Add UI option to enable proxy cache referrer API (#22767)

Expose the proxy_referrer_api setting in the portal for proxy-cache
projects (create project and policy configuration), with i18n strings.

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-24 14:54:26 +08:00
stonezdj(Daojun Zhang)
8a610a3470 Fix issue related to scanner API (#23061)
Signed-off-by: stonezdj <stonezdj@gmail.com>
2026-04-14 06:48:34 +00:00
Aymeric
3d45be3d03 fix: proxy cache serve local on remote not found (#22153)
* fix: proxy cache serve local on remote not found

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>

* tests: fix proxy controller test

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>

* Update src/controller/proxy/controller.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vadim Bauer <Bauer.vadim@gmail.com>

* feat: add ui

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>

* chore: add checkbox in creation project modal

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>

* chore: fix tooltip text

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>

---------

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
Signed-off-by: Vadim Bauer <Bauer.vadim@gmail.com>
Co-authored-by: Vadim Bauer <Bauer.vadim@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-10 07:02:06 +00:00
Matteo Limardo
ba13f6c6cb Swagger Replication Rule invalid JSON (#22724)
* Swagger Replication Rule invalid JSON

The 'type' field in ReplicationFilter schema caused JSON serialization issues
because swagger codegen generates it as a required string field, but the actual
value is interface{} which can be string, []string, or other types depending on
the filter type.

Removing the 'type' field from the schema fixes serialization while maintaining
backward compatibility, as the field wasn't documented or used by clients.

Changes:
- Remove 'type' from ReplicationFilter schema in swagger.yaml
- Simplify filter conversion logic in handler
- Add validation to skip invalid filters
- Add comprehensive tests for filter handling

Signed-off-by: Matteo Limardo <mlimardo@mirantis.com>

remove converFilterValue func

Signed-off-by: Matteo Limardo <mlimardo@mirantis.com>

* Update api/v2.0/swagger.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vadim Bauer <Bauer.vadim@gmail.com>

---------

Signed-off-by: Matteo Limardo <mlimardo@mirantis.com>
Signed-off-by: Vadim Bauer <Bauer.vadim@gmail.com>
Co-authored-by: Vadim Bauer <Bauer.vadim@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-11 10:12:34 +00:00
Vadim Bauer
de33aaab07 fix: correct multiline string in yaml (#22809)
Signed-off-by: Vadim Bauer <vb@container-registry.com>
2026-02-03 21:15:04 +08:00
stonezdj(Daojun Zhang)
3f25cd5ef3 Revert UI change in proxy cache referrer API (#22780)
Revert "Add UI option to enable proxy cache referrer API (#22767)"

This reverts commit 369148e3b6.

Signed-off-by: stonezdj <stonezdj@gmail.com>
2026-01-27 08:49:01 +00:00
stonezdj(Daojun Zhang)
30ba1b3cd3 Proxy the referrer's API to upstream registry (#22746)
Signed-off-by: stonezdj <stonezdj@gmail.com>
2026-01-26 08:00:54 +00:00
stonezdj(Daojun Zhang)
369148e3b6 Add UI option to enable proxy cache referrer API (#22767)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-01-23 09:09:00 +00:00
Wang Yan
34affcbec8 update swagger file for creating tag (#22754)
fix #22582

Harbor doesn't support for creating a immutable tag. Updates the swagger to limit name field only for tag creation.
There is no breaking change.

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>
Co-authored-by: wang yan <yan-yw.wang@broadcom.com>
2026-01-21 19:20:05 +08:00
Wang Yan
7f5ac5b57b add per-endpoint CA certificate support for registry endpoints (#22535)
* add per-endpoint CA certificate support for registry endpoints

fixes #22203

Allowing Harbor to trust self-signed or private CA certificates for individual registry endpoints without modifying the system-level trust store.

1. Database schema changes, API updates with PEM validation.
2. HTTP transport layer modifications across all the registry adapters.
3. UI field to fill in the certificate.

The feature is backward compatible - existing installations using system-level CA trust will continue to work without any changes.

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>

* resolve lint failures

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>

* add i18n changes

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>

* resolve review comments

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>

* make the input as non-required and updates i18n

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>

* resolve comments

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>

---------

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>
Co-authored-by: wang yan <yan-yw.wang@broadcom.com>
2026-01-13 17:10:22 +08:00
stonezdj(Daojun Zhang)
c004f2d3e6 Add max_upstream_conn parameter for each proxy_cache project (#22348)
limit the proxy connection to upstream registry

Signed-off-by: stonezdj <stonezdj@gmail.com>
2025-09-30 10:27:10 +00:00
Prasanth Baskar
221037378a feat: Single Active Replication (#21347)
feat(replication): add Single Active Replication per policy

* Added single_active_replication field to schema & DB table
* Updated API, controller & handler to enforce single execution per policy
* Added checkbox in UI to enable/disable single_active_replication for a
  policy
* Implemented necessary backend & frontend tests
* Prevents parallel runs per policy if single_active_replication is enabled

Signed-off-by: bupd <bupdprasanth@gmail.com>
2025-08-11 18:02:56 +08:00
stonezdj(Daojun Zhang)
171d9b4c0e Add HTTP 409 error when creating robot account (#22201)
fixes #22107

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2025-07-29 10:03:00 +00:00
Daniel Jiang
440f53ebbc Add status field to the API on secyurityHub (#22182)
This commit makes change to the API GET /api/v2.0/vul to make it include
"status" of CVEs in the response.

It also makes update in the UI to add the "Status" column to the data
grids in security hub and artifact details page.

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2025-07-18 16:02:29 +08:00
yuzhipeng
c93da7ff4b Add 400 code response in swagger.yaml for updateRegistry updateReplicationPolicy and headProject (#22165)
Signed-off-by: yuzhipeng <yuzp1996@gmail.com>
2025-07-14 14:26:12 +08:00
Wang Yan
5960bc8fb2 oidclogout (#21718)
* oidclogout

enable oidc session logout

1, give the option of logging out user session from OIDC provider.
2, try best to log out the user offline session if the offline_access in the scope.

Signed-off-by: wang yan <wangyan@vmware.com>
2025-03-18 11:52:35 +08:00
Chlins Zhang
d9e71f9dfc feat: implement the CNAI model processor (#21663)
feat: implement the AI model processor

Signed-off-by: chlins <chlins.zhang@gmail.com>
2025-03-13 02:04:45 +00:00
stonezdj(Daojun Zhang)
45659070b7 Update purge audit to purge both audit_log_ext and audit_log (#21608)
Fix integration issue with UI

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2025-02-18 09:45:46 +00:00
stonezdj(Daojun Zhang)
4d5bc19866 Implement audit log ext API (#21414)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2025-01-16 09:23:25 +00:00
Wang Yan
2140a283bf remove with_signature (#21420)
Signed-off-by: wang yan <wangyan@vmware.com>
2025-01-16 05:51:07 +00:00
Samuel Gaist
15d17a3338 Remove robotV1 from code base (#20958) (#20991)
It was deprecated in 2.4.0.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2025-01-10 13:36:28 +08:00
stonezdj(Daojun Zhang)
b0c74a0584 Add swagger api and audit_log_ext table model (#21360)
add auditlog-ext related api in swagger
  add audit_log_ext table

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2025-01-03 06:11:09 +00:00
Chlins Zhang
a548ab705f feat: extend the p2p preheat policy (#21115)
Add the field extra_attrs to the p2p preheat policy for the provider to
define their specified parameters when preheating.

Signed-off-by: chlins <chlins.zhang@gmail.com>
2024-12-18 10:30:36 +08:00
Chlins Zhang
c97253f660 Refactor: p2p preheat dragonfly driver (#20922) 2024-09-21 11:05:01 +08:00
Wang Yan
438d4c03bb update robot creator database scheme (#20918)
Signed-off-by: wang yan <wangyan@vmware.com>
2024-09-14 12:49:32 +08:00
Wang Yan
51eeb098ef add creator for robot (#20846)
* add creator for robot

add the creator for robot creation

Signed-off-by: wang yan <wangyan@vmware.com>

* resolve comments

Signed-off-by: wang yan <wangyan@vmware.com>

* fix ut

Signed-off-by: wang yan <wangyan@vmware.com>

---------

Signed-off-by: wang yan <wangyan@vmware.com>
2024-08-15 14:43:19 +08:00
Johan Kok
907709ff6d Fix typo in Swagger API docs (#20841)
Signed-off-by: Johan Kok <post@johankok.nl>
2024-08-13 16:31:10 +08:00
stonezdj(Daojun Zhang)
eb5193e0ef Parallel attach ldap group (#20705)
Parallel attach LDAP group

  Add configure LDAP group attach parallel UI
  Change the /c/login timeout from 60 (nginx default) to 900 seconds in nginx.conf

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-08-09 15:24:25 +08:00
Shengwen YU
1f75b7aaef feat: implement bandwidth limit for proxy-cache (#20812)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-08-08 19:02:54 +08:00
Wang Yan
b7f1b59495 add list project arifacts API (#20803)
* add list project arifacts API

This API supports listing all artifacts belonging to a specified project. It also allows fetching the latest artifact
in each repositry, with the option to filter by either media_type or artifact_type.

Signed-off-by: wang yan <wangyan@vmware.com>

* resolve the comments

Signed-off-by: wang yan <wangyan@vmware.com>

---------

Signed-off-by: wang yan <wangyan@vmware.com>
2024-08-06 18:29:13 +08:00
stonezdj(Daojun Zhang)
ec8d692fe6 Add scanner info and report_id to sbom_overview on listing artifact (#20358)
Add scan_status and report_id when scan has a failed task

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-25 17:00:35 +08:00
stonezdj(Daojun Zhang)
c80e9bf477 Add 422 in the swagger.yaml (#20344)
change log level with no content message
  fix time in sbom accessory
  fixes #20342 #20332 #20328

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-24 09:57:46 +08:00
stonezdj(Daojun Zhang)
fb2e0042d0 Rename scan request type (#20288)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-17 09:52:50 +00:00
stonezdj(Daojun Zhang)
654aa8edcf Add generate SBOM feature (#20251)
* Add SBOM scan feature

  Add scan handler for sbom
  Delete previous sbom accessory before the job service

Signed-off-by: stonezdj <daojunz@vmware.com>

* fix issue

Signed-off-by: stonezdj <stone.zhang@broadcom.com>

---------

Signed-off-by: stonezdj <daojunz@vmware.com>
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-16 13:34:19 +00:00
Wang Yan
461a5fa50d add stop sbom scanning API (#20200)
* add stop sbom scanning API

1. [UI] support to stop sbom scanning #20200
2. add type for stop scanning api, make it able to support both vulnerability and sbom.
3. refactor the db query to support multiple extra attributes.

Signed-off-by: wang yan <wangyan@vmware.com>
Signed-off-by: xuelichao <xuel@vmware.com>
Co-authored-by: xuelichao <xuel@vmware.com>
2024-04-09 16:07:47 +08:00
Shengwen YU
c8370faeeb fix: test robot account permission (#20240)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-04-08 12:57:38 +08:00
stonezdj(Daojun Zhang)
dd76fe47ce Add SBOM scan REST API (#20215)
Update swagger API for generate SBOM

Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-03 08:38:09 +00:00
Wang Yan
2eb5464603 add type for scanner metadata (#20108)
Signed-off-by: wang yan <wangyan@vmware.com>
2024-03-25 07:02:39 +00:00
jm-nab
8bec57ffd4 Update swagger.yaml bad request permission: helm-chart:read (#20094)
* Update swagger.yaml

Signed-off-by: jm-nab <146757414+jm-nab@users.noreply.github.com>

* Update swagger.yaml

reference the rbac/const.go source code

Signed-off-by: jm-nab <146757414+jm-nab@users.noreply.github.com>

---------

Signed-off-by: jm-nab <146757414+jm-nab@users.noreply.github.com>
2024-03-12 03:00:42 +00:00
Shengwen YU
d88a32089a feat: add auto_sbom_generation for SBOM auto generation on pushing a … (#19869)
feat: add auto_sbom_generation for SBOM auto generation on pushing a subject artifact

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-01-24 14:13:46 +08:00
Yang Jiao
eb125419cc Add verification that robot account duration is not 0 (#19829)
Signed-off-by: Yang Jiao <yang.jiao@broadcom.com>
2024-01-15 13:25:56 +08:00
Blueswen
0d157f2254 Fix OpenAPI Specification structural error (#19782)
Fix structural error

Signed-off-by: Blueswen <blueswen.tw@gmail.com>
2024-01-03 18:16:27 +08:00
Aaron Steinberg
3c56f2d1a0 [release-note/docs] swagger.yaml "repositoryName" parameter description update (#19651)
* swagger.yaml fix

Signed-off-by: Aaron Steinberg <asteinber-contractor@aurora.tech>

* Signed-off by: Aaron Steinberg <aaron@aa.codes>

Signed-off-by: Aaron Steinberg <asteinber-contractor@aurora.tech>

---------

Signed-off-by: Aaron Steinberg <asteinber-contractor@aurora.tech>
2023-11-30 09:17:05 +00:00
stonezdj(Daojun Zhang)
3f6c0298fe Add oidc provider name to systeminfo API (#19575)
fixes #13198

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-11-15 11:00:39 +08:00
Shengwen YU
e941f3272b fix: sorting quota (#19538)
fix: sort Project Quotas

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2023-11-13 14:37:41 +08:00
Wang Yan
5c02fd807e add permission api (#19543)
The permission api targets to return the full set of permissons for robot to use.
And only system and project admin have the access

Signed-off-by: wang yan <wangyan@vmware.com>
2023-11-09 09:47:07 +08:00
Wang Yan
403b616a5a fix ScheduleObj.type in swagger (#19109)
fixes #18262
Add Schedule as a valid enum values of ScheduleObj.type

Signed-off-by: wang yan <wangyan@vmware.com>
2023-08-07 11:08:25 +08:00
stonezdj(Daojun Zhang)
c62ec7daac Add artifact digest to query condition (#19102)
Fixes #19023

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-08-07 09:24:44 +08:00