Shengwen YU
e9fca3de45
fix: refactor code for golangci-lint whitespace ( #17005 )
...
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-16 17:42:46 +08:00
Shengwen YU
c2a9f5de64
fix: update code for golangci-lint gosimple ( #16974 )
...
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-14 13:44:09 +08:00
Wang Yan
f946bd21f5
fixes 16940 ( #16987 )
...
Response the sign status to UI for the public project.
Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-06-13 10:55:38 +08:00
stonezdj(Daojun Zhang)
e778ec2edf
Add audit_log forward endpoint ( #16914 )
...
add config item to set log forward endpoint
fallback the audit log to default log when endpoint in error
Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-10 10:59:40 +08:00
Shengwen YU
b43ba15f40
fix: golangci-lint errcheck ( #16920 )
...
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-07 17:00:36 +08:00
stonezdj(Daojun Zhang)
0dc7a6806c
Add NextScheduledTime in schedule object ( #16925 )
...
Add NextSchedule in utils
Add NextScheduledTime in ScheduleObj to display it in UI
Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-06 22:17:41 +08:00
MinerYang
9d8e9158de
fix deadcode lint & update golangci-lint.yaml ( #16896 )
...
* fix deadcode lint & update golangci-lint.yaml
Signed-off-by: yminer <yminer@vmmware.com>
mock.go
Signed-off-by: yminer <yminer@vmmware.com>
commentfmt
Signed-off-by: yminer <yminer@vmmware.com>
mock.go update
Signed-off-by: yminer <yminer@vmmware.com>
update makefile
Signed-off-by: yminer <yminer@vmmware.com>
* update /pkg/allowlist/validator.go
Signed-off-by: yminer <yminer@vmmware.com>
Co-authored-by: yminer <yminer@vmmware.com>
2022-05-26 10:32:07 +08:00
stonezdj
3ac7281177
Add job service to purge audit_log
...
Add jobservice type PurgeAuditLog
Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-05-16 21:52:58 +08:00
Wang Yan
d3d4ad6a34
fix staticcheck issues ( #16828 )
...
Fix the staticcheck problems that reported by golangci-line staticcheck
Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-10 16:07:10 +08:00
MinerYang
083b44e719
bump up astaxie/beego@v1.12.1 to beego/beego/@v1.12.7 ( #16770 )
...
Signed-off-by: yminer <yminer@vmmware.com>
goo mod tidy
Signed-off-by: yminer <yminer@vmmware.com>
Co-authored-by: yminer <yminer@vmmware.com>
2022-04-28 11:58:44 +08:00
chlins
8c223135e7
feat: add cache layer for artifact ( #16739 )
...
Implement cache layer for resource artifact and define common
cache manager and workflow. Also add cache related options to
configuration yaml.
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-04-25 18:01:45 +08:00
He Weiwei
8554b7d7c5
refactor: replace lib/pq with jackc/pgx ( #16267 )
...
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2022-01-27 11:09:37 +08:00
Wang Yan
2111703d8d
Cosign artifact api
...
1,update artifact list & delete api to support accessory
2, add list accesories api
Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-01-05 11:13:40 +08:00
Wang Yan
7608df4b5c
add pull update control env ( #16051 )
...
These variables are temporary solution for issue: https://github.com/goharbor/harbor/issues/16039
When user disable the pull count/time/audit log, it will decrease the database access, especially in large concurrency pull scenarios.
1, PULL_TIME_UPDATE_DISABLE : The flag to indicate if pull time is disable for pull request.
2, PULL_COUNT_UPDATE_DISABLE : The flag to indicate if pull count is disable for pull request.
3, pull audit log will not create on disabling pull time.
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-11-26 18:13:23 +08:00
Chenyu Zhang
3aa698c7c9
fix(replication): list projects before replicate to reduce create duplicate project and requests to target registry ( #15934 )
...
Signed-off-by: chlins <chenyuzh@vmware.com>
2021-11-08 10:39:58 +08:00
chlins
9e8218f63b
fix: handle codeql golang security issues
...
Signed-off-by: chlins <chenyuzh@vmware.com>
2021-10-22 10:51:26 +08:00
stonezdj(Daojun Zhang)
2020bf383b
Merge pull request #15790 from stonezdj/21oct15_change_trace_name
...
Change the span name to <method>_<request uri>
2021-10-18 09:41:12 +08:00
Soumik Majumder
eb7329a471
Fix semgrep sprintf-host-port ( #15782 )
...
Signed-off-by: Soumik Majumder <soumikm@vmware.com>
2021-10-14 20:10:27 +08:00
stonezdj
3b2ac06639
Change the span name to <method>_<request uri>
...
Use the same trace option for HTTPTransport
fixes #15726
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-10-14 14:33:16 +08:00
stonezdj
06715af303
Allow empty email attribute for ldap/oidc user
...
Define user.Email as sql.NullString to avoid unique constraint when email is empty in LDAP/OIDC
Separate the common/models/User with the pkg/user/dao/User
Fixes #10400
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-09-30 14:35:18 +08:00
Qian Deng
31707dbf25
Using harbor lib config
...
using config manager to get env configs
Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
bad913cf6d
Refactor trace code
...
* use lib trace helper function
* add gracefull shutdown
* Add commens for new added exposed function
* Add licence on top of new created files
* Update trace library
* Update configs
* Add attribute and namespance in config
Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
879eecc926
Refactor and Add trace to http Transport
...
* Refactor common http GetTransport function signature
* Remove redendent GetHTTPTransport and similar functions
* Update Authorized function signature to meet new HTTPTransport
* Add trace for default Transport
Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Shengwen Yu
e2e3bcca1c
feat: add stop scan & stop scan-all feature
...
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2021-09-13 11:19:21 +08:00
Wang Yan
14f7274989
support robot to list project ( #15431 )
...
1, add permission check for API of List Projects
2, add permission check for API of List Repositories
3, use the self defined query to handle both names and public query
Signed-off-by: wang yan <wangyan@vmware.com>
2021-08-17 16:35:36 +08:00
Vadim Bauer
13d5e4a7de
fixes the broken pipe connection error with postgres. Similar as PR: #4719 ( #15211 )
...
Signed-off-by: Vadim Bauer <vb@container-registry.com>
Co-authored-by: Vadim Bauer <vb@container-registry.com>
2021-07-23 14:56:54 +08:00
Wang Yan
248be37c3e
clean code of common util ( #15287 )
...
Remove the useless code from the common util
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-09 15:35:05 +08:00
Wang Yan
1abe978e87
refactor job log
...
Move job service logger to new program model
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-06-29 13:37:45 +08:00
He Weiwei
c7a4af3170
test: mock the API requests for the huawei registry ( #15009 )
...
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-28 17:09:48 +08:00
Wang Yan
42a9d0d905
remove common project code ( #14939 )
...
move project model from common to pkg
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-05-25 11:01:19 +08:00
Daniel Jiang
dee6064e60
Merge pull request #14926 from reasonerjt/rm-common-dao-oidc-user-onboard
...
Remove the onboard and update funcs for OIDC user from common/dao
2021-05-20 19:34:59 +08:00
Daniel Jiang
66766a8f69
Remove the onboard and update funcs for OIDC user from common/dao
...
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-20 16:23:07 +08:00
Daniel Jiang
5be0c6d35a
Merge pull request #14911 from reasonerjt/fix-14386
...
Use system configuration resource for permission checking
2021-05-20 14:05:06 +08:00
Wenkai Yin(尹文开)
0fe551274d
Merge pull request #14921 from ywk253100/210519_db
...
Clean up tech debt codes
2021-05-20 13:44:10 +08:00
Wenkai Yin
998e392bb4
Clean up tech debt codes
...
Clean up tech debt codes
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-20 11:47:46 +08:00
Daniel Jiang
c41d75fb31
Use system configuration resource for permission checking
...
This commit uses system configuration resource for permission check
against API to ping OIDC and update systen CVE allowlist.
Fixes #14386
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-18 16:06:58 +08:00
Daniel Jiang
952644e23f
Remove GetUser and Onboard from common/dao
...
Replaced by funcs in src/pkg/user and src/controller/user
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-18 15:28:41 +08:00
Wang Yan
ad9569da26
refactor preheat model ( #14858 )
...
Move the notification to preheat models
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-05-12 22:29:01 +08:00
stonezdj(Daojun Zhang)
0dfc801a50
Error string should not be capitalized ( #14840 )
...
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-05-12 16:53:37 +08:00
Daniel Jiang
bd9a1c6722
Merge pull request #14829 from reasonerjt/user-common-dao-cleanup
...
Move user related funcs from common/dao
2021-05-12 10:56:18 +08:00
Daniel Jiang
6d0e391740
Move user related funcs from common/dao
...
This commit moves more user related funcs, such as ChangePassword,
Login, ChangeUserProfile from common/dao to rely on /pkg/user and
pkg/oidc.
It also removes the code for resetting user's password as it's disabled.
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-12 01:12:57 +08:00
Wenkai Yin(尹文开)
e006f4bab5
Support specifying multiple fields for default sorting ( #14788 )
...
Support specifying multiple fields for default sorting
Fixes #14433
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-10 17:04:10 +08:00
Daniel Jiang
a66809cf85
Remove register and userexists funcs from dao pkg ( #14798 )
...
This commit replaces them with funcs with user pkg
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-05 17:55:56 +08:00
Daniel Jiang
01858e3d71
Clean up user related funcs in common/dao
...
This commit remove some funcs from package `common/dao/user` that can be
covered by the manager in `pkg/user`.
Ideally all funcs should be replaced but the dependency relationships
are tricky for some of them I'll push other commit to clean them up.
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-04-29 18:08:16 +08:00
Wang Yan
f3260fdad1
move blob models ( #14776 )
...
1, move project_blob into pkg
2, move artifact_blob into pkg
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-04-29 12:36:08 +08:00
Daniel Jiang
5b526b8dc7
Remove dependencies from pkg/oidc to common/dao ( #14739 )
...
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-04-26 10:56:49 +08:00
Wang Yan
6e3c9e29df
Api refactor label ( #14650 )
...
* Refactor labl api
move to the new program model
Signed-off-by: wang yan <wangyan@vmware.com>
* continue resolve review comments
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-04-15 17:27:58 +08:00
stonezdj
9807a5a9ff
Merge branch 'master' into 21apr13_move_config_exp
...
# Conflicts:
# src/common/dao/project/projectmember_test.go
# src/core/api/projectmember.go
# src/core/auth/ldap/ldap_test.go
# src/server/v2.0/handler/project.go
2021-04-14 09:45:48 +08:00
stonezdj
751d404519
Refactor project member api to new programming model
...
Add pkg/member/dao
Add pkg/member/models
Add pkg/member/manager
Add controller/member
Remove the old project member API
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-04-13 21:28:54 +08:00
stonezdj
60478f4990
Move common config api to lib/config
...
Register all config managers, and get it by getConfigManger()
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-04-13 19:43:33 +08:00