Fixes#9704
As we do want to unify error handling, so just decreprates pkg errors, use lib/errors instead for Harbor internal used errors model.
1, The lib/errors can cover all of funcs of pkg/errors, and also it has code attribute to define the http return value.
2, lib/errors can give a OCI standard error format, like {"errors":[{"code":"UNAUTHORIZED","message":"unauthorized"}]}
If you'd like to use pkg/errors, use lib/errors instead. If it cannot meet your request, enhance it.
Signed-off-by: wang yan <wangyan@vmware.com>
Fixes#11016
1. src/pkg/q->src/internal/q
2. src/internal->src/lib (internal is a reserved package name of golang)
3. src/api->src/controller
Signed-off-by: Wenkai Yin <yinw@vmware.com>
1, enable audit logs for notifications
2, move the handler and meatadata into API
3, use the notification middleware to send out notification
Signed-off-by: wang yan <wangyan@vmware.com>
Chart client eats the http error if not status ok, after refactor, the
real http response will be catched in core api.
Signed-off-by: wang yan <wangyan@vmware.com>
- add new interface method to get total count of charts under namespaces by calling get index
- add new field 'chart_count' in project model
- append chart count to the project model in project API
Signed-off-by: Steven Zou <szou@vmware.com>
- add more cases in the ChartRepositoryAPI controller
- move chart utility testing functions to a separate go file under testing
- ignore testing coverage for testing folder
- update other UT cases to reflect the change of adding chart testing utility functions
Signed-off-by: Steven Zou <szou@vmware.com>
1. Update the nginx.conf
2. Update Makefile
3. Update docker-compose
4. Update image name
5. Rename folder ui to core
6. Change the harbor-ui's package name to core
7. Remove unused static file on harbor-core
8. Remove unused code for harbor-portal
Signed-off-by: Qian Deng <dengq@vmware.com>
- use unified proxy handler to handle all the proxy traffic
- define interfaces for the handlers
- implement the interface at chart controller level
- refactor UT cases
- update other related reference code
Signed-off-by: Steven Zou <szou@vmware.com>
- add related chart label API entries
- extract label related functionalities to a separate manager interface
- add a base controller for label related actions
- add related UT cases
Signed-off-by: Steven Zou <szou@vmware.com>
- add chart search interface method in utility handler
- update the search API handler
- update the search API UT case
Signed-off-by: Steven Zou <szou@vmware.com>
- add API route
- add DELETE chart method in utility handler of chart controller
- add UT case for the newly added methods
- update swagger.yaml to refelct the new change
Signed-off-by: Steven Zou <szou@vmware.com>